-
Notifications
You must be signed in to change notification settings - Fork 2
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
From_str for PolyRingZq #411
Conversation
@@ -31,7 +31,7 @@ impl MatZ { | |||
/// to the standard deviation `sigma * sqrt(2 * pi) = s` | |||
/// | |||
/// Returns a matrix with each entry sampled independently from the | |||
/// specified discrete Gaussian distribution. | |||
/// specified discrete Gaussian distribution or an error if the `n <= 1` or `s <= 0`. |
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.
/// specified discrete Gaussian distribution or an error if the `n <= 1` or `s <= 0`. | |
/// specified discrete Gaussian distribution or an error if `n <= 1` or `s <= 0`. |
@@ -81,7 +81,9 @@ impl MatZ { | |||
/// - `s`: specifies the Gaussian parameter, which is proportional | |||
/// to the standard deviation `sigma * sqrt(2 * pi) = s` | |||
/// | |||
/// Returns a lattice vector sampled according to the discrete Gaussian distribution. | |||
/// Returns a lattice vector sampled according to the discrete Gaussian distribution | |||
/// or an error if the `n <= 1` or `s <= 0`, the number of rows of the `basis` and `center` differ, |
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.
/// or an error if the `n <= 1` or `s <= 0`, the number of rows of the `basis` and `center` differ, | |
/// or an error if `n <= 1` or `s <= 0`, the number of rows of the `basis` and `center` differ, |
see the others as well -> this occurs more often
/// - Returns a [`MathError`] of type [`InvalidIntegerInput`](MathError::InvalidIntegerInput) | ||
/// if the `base` is not greater than `1`. | ||
/// if the `base` is smaller than `2`. |
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.
maybe look for subseuent changes in crypto
mod test_from_str { | ||
use super::PolynomialRingZq; | ||
use std::str::FromStr; |
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.
you can also call to_string
on PolynomialRingZq options. Please add a test where you instantiate a PolynomialRingZq, then call to_string
and then use from_str
to reinitiate
Description
This PR implements from_str for PolyRingZq and refactors Doc comments (casing and spacing in parameters, punctuation in Returns, Adding missing error explanations and minor spelling mistakes).
Testing
Checklist: