FiloSottile / FiloSottile/mostly-harmless
Cryptopals Set 4 - Last two tests
- Dominant language
- JavaScript
- Stars
- 318
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
Hi @FiloSottile ! Thanks for the cryptopals videos, they're awesome!
I know this is a silly thing, but I just wanted to point it out, because maybe someone wants to run the tests for the last two challenges in the fourth set and they're always failing trying to recover the last bytes of the signature. Since the sleep in the code is before the comparison of the bytes, for the last one, there's no noticeable timing difference between the two possible outcomes, because if the two bytes are different, it just returns `false`, but if they're the same, the loop ends and it returns `true`.
I guess you can always compare the fist `signatureLen - 1` bytes, and just bruteforce the last one. Or just move the `time.Sleep(pause)` after the comparison (that's what I did to make the test pass).
Anyway, thanks again!
Contributor guide
Assessment
This issue has not been assessed yet.