Skip to content

Commit

Permalink
Reorder previous pseudocode
Browse files Browse the repository at this point in the history
As discussed in #14.
  • Loading branch information
samuel-lucas6 committed Jun 22, 2024
1 parent 3587262 commit ffa1b17
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions draft-lucas-balloon-hashing.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,17 @@ for m = 1 to spaceCost - 1
buffer[m] = PRF(key, LE64(counter++) || buffer[m - 1])

emptyKey = List(1, 0)
previous = buffer[spaceCost - 1]
for t = 0 to timeCost - 1
for m = 0 to spaceCost - 1
if m == 0
previous = buffer[spaceCost - 1]
else
previous = buffer[m - 1]

pseudorandom = PRF(ZeroPad(emptyKey, HASH_LEN), LE64(counter++) || salt)
other1 = ReadLE64(pseudorandom.Slice(0, 8)) % spaceCost
other2 = ReadLE64(pseudorandom.Slice(8, 8)) % spaceCost
other3 = ReadLE64(pseudorandom.Slice(16, 8)) % spaceCost
buffer[m] = PRF(key, LE64(counter++) || previous || buffer[m] || buffer[other1] || buffer[other2] || buffer[other3])
previous = buffer[m]

return buffer[spaceCost - 1]
return previous
~~~

# Implementation Considerations
Expand Down

0 comments on commit ffa1b17

Please sign in to comment.