mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-12 00:51:28 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user