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
.
Object Safety§
This trait is not object safe.