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: Add length pre- and post-conditions to functions #789

Open
karthikbhargavan opened this issue Feb 3, 2025 · 0 comments
Open

Comments

@karthikbhargavan
Copy link
Contributor

This is more of a meta-issue, but we will start with specific modules.
We need to add length pre- and post-conditions on all functions that have slice inputs.

As an illustrative example, see

#[hax_lib::requires(serialized.len() == 4 || serialized.len() == 6)]

The general pattern is:

#[hax_lib::requires(input.len() == 10 && output.len == 12)]
#[hax_lib::ensures(|_| future(output).len ==  output.len)]
fn f(input: &[i32], output: &mut [u8]) {...}

The ensures clause above is a bit stupid and we will try to get rid of it, but is needed for now.

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

No branches or pull requests

2 participants