Unverified KMAC-128 and KMAC-256 implementation#1292
Unverified KMAC-128 and KMAC-256 implementation#1292kraemv wants to merge 10 commits intocryspen:mainfrom
Conversation
jschneider-bensch
left a comment
There was a problem hiding this comment.
Thank you!
I haven't had time for a detailed look yet, just a few comments.
|
@kraemv do you think you could add runtime safety, i.e. that the code never panics, if you help you with the set up? |
|
In this PR to your branch, I've added a basic setup for doing runtime safety proofs. Let me know what you think! |
a45d10b to
c93fb3e
Compare
|
The fstar runtime safety proof now goes through. |
* [kmac] Add basic hax extraction setup * [kmac] Add hax-lib dependency * [kmac] Comment out const blocks (unsupported by hax)
|
It's very nice that you can extract and typecheck this code for runtime safety without any annotations!
Would you be okay with incorporating these changes here? |
|
Hi Jonas, |
|
I think we have found in ML-KEM and ML-DSA as well that doing a functional correctness proof on a generic implementation can be advantageous since you only do the proof once and it should hold for all different (valid!) parameters the generic implementation can be instantiated with. I made a few more small changes on the refactoring branch, updating changelogs and removing the obsolete code you found. I think with these also merged into your PR this looks very good to me already! |
|
Well, then I am very happy to have the generic code now :) |
|
Okay, then I'll take care of the rest. 👍 Thanks a lot for your efforts! |
|
Thank you for your feedback on the code and the support to prove runtime safety! |
Hello everyone,
I implemented KMAC-128 and KMAC-256 in Rust and would like to contribute my code to libcrux. I am not familiar with hax and F*, hence my commit does not contain a correctness proof.
I have tested my code with the wycheproof project, the test vectors and the changes to the /tests repository are included in this PR.
I made changes to sha3/src/portable.rs to implement an iterative CShake API with the correct Keccak padding. An iterative API is required to make the code no_std compatible.
Could you please share your thoughts about the length values (e.g. key_length) in hacl/kmac.rs, as they will panic for inputs larger than 2^61 bytes.