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

Move common fields into ModelParameters #365

Merged
merged 16 commits into from
Dec 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more documentation
  • Loading branch information
alexander-zw committed Dec 11, 2021
commit 1020349ea3f59c97e00ea5dc7b6fa0502223732e
4 changes: 3 additions & 1 deletion ec/src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub mod mnt6;
pub mod short_weierstrass_jacobian;
pub mod twisted_edwards_extended;

/// Required for the is_in_correct_subgroup_assuming_on_curve function.
/// Required for the is_in_correct_subgroup_assuming_on_curve() function in ModelParameters.
pub trait MultipliablePoint<R: Zero> {
fn mul_bits(&self, bits: impl Iterator<Item = bool>) -> R;
}
Expand All @@ -21,6 +21,8 @@ pub trait ModelParameters: Send + Sync + 'static {
const COFACTOR: &'static [u64];
const COFACTOR_INV: Self::ScalarField;

/// Checks that the current point is in the prime order subgroup given
/// the point on the curve.
/// Requires type parameters G: the type of point passed in, and H: the type of
/// point that results from multiplying G by a scalar.
fn is_in_correct_subgroup_assuming_on_curve<G, H>(item: &G) -> bool
Expand Down