More documentation.

master
Didactic Drunk 2019-06-28 02:18:23 -07:00
parent b07de55a28
commit da8f97ae47
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# cox # cox
[![Build Status](https://travis-ci.org/didactic-drunk/cox.svg?branch=master)](https://travis-ci.org/didactic-drunk/cox) [![Build Status](https://travis-ci.org/didactic-drunk/cox.svg?branch=master)](https://travis-ci.org/didactic-drunk/cox)
[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://didactic-drunk.github.io/cox/)
Updated Crystal bindings for the [libsodium API](https://libsodium.gitbook.io/doc/) Updated Crystal bindings for the [libsodium API](https://libsodium.gitbook.io/doc/)

View File

@ -2,6 +2,8 @@ module Cox
# [Argon2 Password Hashing](https://libsodium.gitbook.io/doc/password_hashing/the_argon2i_function) # [Argon2 Password Hashing](https://libsodium.gitbook.io/doc/password_hashing/the_argon2i_function)
# * #store #verify #needs_rehash? are used together for password verification. # * #store #verify #needs_rehash? are used together for password verification.
# * #key_derive is used on it's own to generate password based keys. # * #key_derive is used on it's own to generate password based keys.
#
# See `examples/pwhash_selector.cr` for help on selecting parameters.
class Pwhash class Pwhash
class PasswordVerifyError < Cox::Error class PasswordVerifyError < Cox::Error
end end
@ -16,6 +18,7 @@ module Cox
MEMLIMIT_MAX = LibSodium.crypto_pwhash_memlimit_max MEMLIMIT_MAX = LibSodium.crypto_pwhash_memlimit_max
MEMLIMIT_INTERACTIVE = LibSodium.crypto_pwhash_memlimit_interactive MEMLIMIT_INTERACTIVE = LibSodium.crypto_pwhash_memlimit_interactive
# Use the most recent algorithm Argon2id13 for new applications.
enum Algorithm enum Algorithm
Argon2i13 = 1 Argon2i13 = 1
Argon2id13 = 2 Argon2id13 = 2