-
Notifications
You must be signed in to change notification settings - Fork 16
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
Make RSA API more usable #766
base: main
Are you sure you want to change the base?
Conversation
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.
I think it looks good!
Could you add some tests that trigger the new errors, as well?
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.
Nice! Thanks for adding more docs, as well. :)
/// Returns `Ok(())` on success. | ||
/// | ||
/// Returns an error in any of the following cases: | ||
/// - the secret key is invalid |
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.
Is that the SigningFailed
error?
/// Returns an error in any of the following cases: | ||
/// - the secret key is invalid | ||
/// - the length of `msg` exceeds `u32::MAX` | ||
/// - `salt_len` exceeds `u32::MAX - alg.hash_len() - 8` |
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.
/// - `salt_len` exceeds `u32::MAX - alg.hash_len() - 8` | |
/// - `salt_len` exceeds `u32::MAX - alg.hash_len() - 8` | |
/// - the length of `sig` does not match the length of `sk` |
&salt, | ||
&mut signature[..], | ||
) | ||
.expect_err("expected singing with wrong length to fail"); |
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.
.expect_err("expected singing with wrong length to fail"); | |
.expect_err("expected signing with wrong length to fail"); |
@keks can this get merged? |
There are still the outstanding comments by Jonas. I'll get this ready on Monday |
This PR makes changes to the API of the
libcrux-rsa
crate: