Skip to content

Commit

Permalink
Merge pull request #11 from ioerror/opt-no-wipe-argon2_32-pyx
Browse files Browse the repository at this point in the history
Opt no wipe argon2 32 pyx
  • Loading branch information
mliberty1 authored Aug 17, 2024
2 parents 0ada0c8 + b8a991a commit 923757f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions c_monocypher.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ cdef uint32_t _validate_u32(variable_name, value):
return <uint32_t> value


def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None) -> bytes:
def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None, _wipe=True) -> bytes:
key = b'' if key is None else key
ad = b'' if ad is None else ad

Expand Down Expand Up @@ -347,7 +347,8 @@ def argon2i_32(nb_blocks, nb_iterations, password, salt, key=None, ad=None) -> b
crypto_argon2(hash, <uint32_t> len(hash), work_area, config, inputs, extras)
finally:
free(work_area)
crypto_wipe(password, len(password))
if _wipe:
crypto_wipe(password, len(password))
return hash


Expand Down

0 comments on commit 923757f

Please sign in to comment.