You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On page 25, HMAC is defined using zipWith twice. What is zipWith buying us here? Doesn't xor work pairwise already?
Cryptol> zipWith (^) (join [0..7]) (join (repeat 0x5c))
Showing a specific instance of polymorphic result:
* Using '3' for type argument 'n' of 'Cryptol::repeat'
0x59652b
Cryptol> (join [0..7]) ^ (join (repeat 0x5c))
Showing a specific instance of polymorphic result:
* Using '3' for type argument 'n' of 'Cryptol::repeat'
0x59652b
The text was updated successfully, but these errors were encountered:
Not sure about the reasoning, might be just an oversight. I agree that using ^ without zipWith is more direct, and xor-ing words together is really not that exotic.
That particular part of the book is explaining how modules work; it is not trying to explain the code itself. So I think it probably makes sense to just change the code without changing any of the surrounding text.
On page 25, HMAC is defined using
zipWith
twice. What iszipWith
buying us here? Doesn't xor work pairwise already?The text was updated successfully, but these errors were encountered: