pub trait GroupOperations {
type Point;
type Scalar;
// Required methods
fn add(
left_point: &Self::Point,
right_point: &Self::Point,
) -> Option<Self::Point>;
fn subtract(
left_point: &Self::Point,
right_point: &Self::Point,
) -> Option<Self::Point>;
fn multiply(
scalar: &Self::Scalar,
point: &Self::Point,
) -> Option<Self::Point>;
}
Required Associated Types§
Required Methods§
Sourcefn add(
left_point: &Self::Point,
right_point: &Self::Point,
) -> Option<Self::Point>
fn add( left_point: &Self::Point, right_point: &Self::Point, ) -> Option<Self::Point>
Adds two curve points: P_0 + P_1.
Sourcefn subtract(
left_point: &Self::Point,
right_point: &Self::Point,
) -> Option<Self::Point>
fn subtract( left_point: &Self::Point, right_point: &Self::Point, ) -> Option<Self::Point>
Subtracts two curve points: P_0 - P_1.
NOTE: Altneratively, one can consider replacing this with a negate
function that maps a
curve point P -> -P. Then subtraction can be computed by combining negate
and add
syscalls. However, subtract
is a much more widely used function than negate
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.