Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Complete SHA-256 circuit tests #913

Merged
merged 4 commits into from
Aug 19, 2021

Conversation

jadephilipoom
Copy link
Contributor

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.

@jadephilipoom jadephilipoom requested a review from blaxill August 19, 2021 12:14
(**** list boolean equality decider ****)

(* TODO: this may be upstreamed, remove if
https://github.com/mit-plv/coqutil/pull/37 gets merged *)
Copy link
Contributor

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 😉

Copy link
Contributor Author

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.
Copy link
Contributor

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... 😉

Copy link
Contributor Author

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!

@jadephilipoom jadephilipoom merged commit e6aba92 into project-oak:main Aug 19, 2021
@jadephilipoom jadephilipoom deleted the fix-tests branch August 19, 2021 15:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants