-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
…it after passing block to padder
(**** list boolean equality decider ****) | ||
|
||
(* TODO: this may be upstreamed, remove if | ||
https://github.com/mit-plv/coqutil/pull/37 gets merged *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "gets merged" has happened, happy recompiling 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! On it 🙂
: list (list N) := | ||
let digests := List.map (fun '(done, (digest, accept_input)) => digest) out in | ||
(* remove repetitions of the same digest *) | ||
dedup (list_eqb N.eqb) digests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be possible to get the same digest twice, which would make this code wrong? I'd estimate that the probability of this is roughly in the same order of magnitude as the probability of finding hash collisions, ie in the range of don't care, but my formal correctness mindset just couldn't refrain from commenting here... 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my formal correctness brain also considered this but decided it was probably not likely enough to work around!
For #880
All SHA-256 tests, including the ones that test intermediate digests and only-padding, are now run on the cava2 SHA-256 implementation. I removed the "sanity check", since it's a bit annoying to update when something about the signalling changes and is now superseded by the tests file.
Part of the code here is a boolean list equality decider that I've submitted upstream to coqutil (see mit-plv/coqutil#37), so hopefully that will get merged and the code will no longer live in our test file.