Closed josephlr closed 1 year ago
Thanks for doing this! Two comments:
getHashingCosts()
, a HashingCosts
is being initialized without TruncationFixed: true
.func (h *HashingCosts) CheckValidity()
already does some of the new checks that are being added to PassphraseHash()
. Should they be consolidated into one place?
As pointed out in #363, we are not currently handling cases with 256 or more CPUs correctly. Our current behavior:
costs.parallelism
to auint8
NumCPU
is a multiple of 256costs.parallelism
is > 256, we silently use the truncated parallelism cost. This is the worst part.This PR does multiple things (see the commits for more detailed information):
truncation_fixed
boolean field to theHashingCosts
proto, indicating that this bug is fixed.getHashingCosts
, cap the number of threads to 255.