Skip to content

Commit

Permalink
Unify duplicated call to pbkdf2
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Dec 28, 2023
1 parent 66dc569 commit c8a233d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/fast_scram.erl
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ server_key(Sha, SaltedPassword) ->
server_signature(Sha, ServerKey, AuthMessage) ->
fast_scram_definitions:server_signature(Sha, ServerKey, AuthMessage).

%%%===================================================================
%%% NIF
%%%===================================================================
-spec hi(sha_type(), binary(), binary(), non_neg_integer()) -> binary().
hi(Hash, Password, Salt, IterationCount)
when ?is_valid_hash(Hash), is_binary(Password), is_binary(Salt), ?is_positive_integer(IterationCount) ->
fast_pbkdf2:pbkdf2(Hash, Password, Salt, IterationCount).
hi(Hash, Password, Salt, IterationCount) ->
fast_scram_definitions:salted_password(Hash, Password, Salt, IterationCount).

0 comments on commit c8a233d

Please sign in to comment.