Make Nova's ecc gadgets read curve parameters from the group trait (#115)

* make ecc gadgets defined over Group rather than PrimeField

* use curve parameters from Group trait
This commit is contained in:
Srinath Setty
2022-09-22 13:31:55 -07:00
committed by GitHub
parent d2844089ba
commit f9672faf23
6 changed files with 324 additions and 348 deletions

View File

@@ -12,6 +12,7 @@ use merlin::Transcript;
use num_bigint::BigInt;
/// Represents an element of a group
/// This is currently tailored for an elliptic curve group
pub trait Group:
Clone
+ Copy
@@ -62,14 +63,14 @@ pub trait Group:
/// Returns the affine coordinates (x, y, infinty) for the point
fn to_coordinates(&self) -> (Self::Base, Self::Base, bool);
/// Returns the order of the group as a big integer
fn get_order() -> BigInt;
/// Returns an element that is the additive identity of the group
fn zero() -> Self;
/// Returns the generator of the group
fn get_generator() -> Self;
/// Returns A, B, and the order of the group as a big integer
fn get_curve_params() -> (Self::Base, Self::Base, BigInt);
}
/// Represents a compressed version of a group element