argonautica
argonautica copied to clipboard
Memory parameter has to be a power of 2
Why does the parameter for configure_memory_size()
have to be a power of 2?
It doesn't have to be in other implementations, e.g. argon2 for Haskell.
Good question; the Argon2 spec states “Memory size m
can be any integer number of kilobytes from 8p
to 2³²−1. The actual number of blocks is m′
, which is m
rounded down to the nearest multiple of 4p
” (where p
is the degree of parallelism).