Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify ML-DSA: portable/encoding/commitment #745

Open
4 tasks
karthikbhargavan opened this issue Jan 14, 2025 · 2 comments · May be fixed by #776
Open
4 tasks

Verify ML-DSA: portable/encoding/commitment #745

karthikbhargavan opened this issue Jan 14, 2025 · 2 comments · May be fixed by #776
Assignees

Comments

@karthikbhargavan
Copy link
Contributor

Verify https://github.com/cryspen/libcrux/blob/main/libcrux-ml-dsa/src/simd/portable/encoding/commitment.rs

  • Write a spec for the functions
  • Design tactic to prove correctness
  • Prove panic freedom
  • Prove correctness
@W95Psp
Copy link
Contributor

W95Psp commented Jan 16, 2025

The F* spec for the function will be something like:

let n = ${serialized.len()} in
let inputs = bit_vec_of_int_t_array ${simd_unit.values} n in
let outputs = bit_vec_of_int_t_array ${future(serialized)} 8 in
(forall (i: nat {i < 8 * n}). inputs i == outputs i)

In other words, the two following sequences of bits should be equal. Let n be the length of serialized.

  • the n first bits of the 8 i32 found in simd_unit.value;
  • the 8 bits of each u8 in serialized after calling (serialize(simd_unit, serialized)).

For the tactic, the previous tactic should work, but we need to make fold_enumerated_chunked_slice normalizable: currently it is not defined, we only have a signature.

Questions:

  • shall we still do F*-only specs, or do we want to reflect that in Rust? no, we still will do that in F*

@W95Psp
Copy link
Contributor

W95Psp commented Jan 23, 2025

cryspen/hax#1238 was required for this to happen.
That PR is now in the merge queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants