1 comment

[ 2.8 ms ] story [ 11.6 ms ] thread
From a footnote:

By the way, high quality specs should have intermediate test cases, not just test cases for the whole algorithm. There are two reasons: first, in cryptography when you get something wrong it can be extremely hard to narrow down where the mistake is, all you know is that you wrote 300 lines and the result is wrong, great; second, you get to more easily write test cases for edge cases that are hard to hit from the high-level API.

It also encourages clearer, more functional, const-correct code; things reference implementations are often lacking in.