Skip to content

Commit

Permalink
Hash the pepper length
Browse files Browse the repository at this point in the history
Helps prevent equivalent keys with HMAC. Moving the lengths to the back feels cleaner due to this change.
  • Loading branch information
samuel-lucas6 committed Oct 5, 2024
1 parent 82d9a08 commit 9e5f1b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion draft-lucas-bkdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ if pepper.Length == 0
else
key = pepper

key = PRF(key, LE32(password.Length) || password || LE32(salt.Length) || salt || LE32(associatedData.Length) || associatedData)
key = PRF(key, password || salt || associatedData || LE32(pepper.Length) || LE32(password.Length) || LE32(salt.Length) || LE32(associatedData.Length))

parallel for i = 0 to parallelism - 1
outputs[i] = BalloonCore(key, spaceCost, timeCost, parallelism, i + 1)
Expand Down

0 comments on commit 9e5f1b8

Please sign in to comment.