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 7520427 commit e17e088
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 e17e088

Please sign in to comment.