Add pwhash_SALTBYTES/0

This commit is contained in:
Nicolas goy
2020-04-17 13:52:33 +02:00
parent 5f95ee314f
commit a001404877
6 changed files with 21 additions and 0 deletions
+8
View File
@@ -116,6 +116,7 @@
shorthash_size/0,
shorthash/2,
pwhash_SALTBYTES/0,
pwhash/4,
pwhash_str/3,
@@ -395,6 +396,13 @@ generichash_final(State) ->
enacl_nif:crypto_generichash_final(State).
-type pwhash_limit() :: interactive | moderate | sensitive | pos_integer().
%% @doc pwhash_SALTBYTES/0 returns the number of bytes required for salt.
%% @end
-spec pwhash_SALTBYTES() -> pos_integer().
pwhash_SALTBYTES() ->
enacl_nif:crypto_pwhash_SALTBYTES().
%% @doc pwhash/2 hash a password
%%
%% This function generates a fixed size salted hash of a user defined password.
+2
View File
@@ -147,6 +147,7 @@
%% Password Hashing - Argon2 Algorithm
-export([
crypto_pwhash_SALTBYTES/0,
crypto_pwhash/4,
crypto_pwhash_str/3,
crypto_pwhash_str_verify/2
@@ -238,6 +239,7 @@ crypto_secretstream_xchacha20poly1305_init_pull(_Header, _Key) -> erlang:nif_err
crypto_secretstream_xchacha20poly1305_pull(_Ref, _CipherText, _AD) -> erlang:nif_error(nif_not_loaded).
crypto_secretstream_xchacha20poly1305_rekey(_Ref) -> erlang:nif_error(nif_not_loaded).
crypto_pwhash_SALTBYTES() -> erlang:nif_error(nif_not_loaded).
crypto_pwhash(_Password, _Salt, _Ops, _Mem) -> erlang:nif_error(nif_not_loaded).
crypto_pwhash_str(_Password, _Ops, _Mem) -> erlang:nif_error(nif_not_loaded).
crypto_pwhash_str_verify(_HashedPassword, _Password) -> erlang:nif_error(nif_not_loaded).