samuel-lucas6 / draft-lucas-balloon-hashing

An Internet-Draft for the Balloon password hashing and password-based key derivation function.
Other
3 stars 1 forks source link

Use UInt64 instead of BigInteger #1

Closed samuel-lucas6 closed 1 month ago

samuel-lucas6 commented 6 months ago

The other variable currently uses BigInteger before being converted to an Int32:

for (int i = 0; i < delta; i++) {
    IntsToBlock(idxBlock, t, m, i);
    Hash(idxBlock, counter++, salt, idxBlock);
    var other = new BigInteger(idxBlock, isUnsigned: true, isBigEndian: false) % spaceCost;
    Hash(buffer[m], counter++, buffer[m], buffer[(int)other]);
}

This is done for interoperability with existing implementations, but it seems preferable to use UInt64 like everywhere else. However, this would mean all implementations would have to be updated in line with the draft.