Trait sp1_lib::utils::AffinePoint
source · pub trait AffinePoint<const N: usize>: Clone + Sized {
const GENERATOR: [u32; N];
// Required methods
fn new(limbs: [u32; N]) -> Self;
fn limbs_ref(&self) -> &[u32; N];
fn limbs_mut(&mut self) -> &mut [u32; N];
fn add_assign(&mut self, other: &Self);
fn double(&mut self);
// Provided methods
fn from(x: &[u8], y: &[u8]) -> Self { ... }
fn from_le_bytes(bytes: &[u8]) -> Self { ... }
fn to_le_bytes(&self) -> Vec<u8> { ... }
fn mul_assign(&mut self, scalar: &[u32]) -> Result<(), MulAssignError> { ... }
fn multi_scalar_multiplication(
a_bits_le: &[bool],
a: Self,
b_bits_le: &[bool],
b: Self,
) -> Option<Self> { ... }
}
Required Associated Constants§
Required Methods§
sourcefn new(limbs: [u32; N]) -> Self
fn new(limbs: [u32; N]) -> Self
Creates a new AffinePoint
from the given limbs.
sourcefn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Adds the given AffinePoint
to self
.
Provided Methods§
sourcefn from(x: &[u8], y: &[u8]) -> Self
fn from(x: &[u8], y: &[u8]) -> Self
Creates a new AffinePoint
from the given x and y coordinates.
The bytes are the concatenated little endian representations of the coordinates.
sourcefn from_le_bytes(bytes: &[u8]) -> Self
fn from_le_bytes(bytes: &[u8]) -> Self
Creates a new AffinePoint
from the given bytes in little endian.
sourcefn to_le_bytes(&self) -> Vec<u8>
fn to_le_bytes(&self) -> Vec<u8>
Creates a new AffinePoint
from the given bytes in big endian.
sourcefn mul_assign(&mut self, scalar: &[u32]) -> Result<(), MulAssignError>
fn mul_assign(&mut self, scalar: &[u32]) -> Result<(), MulAssignError>
Multiplies self
by the given scalar.
sourcefn multi_scalar_multiplication(
a_bits_le: &[bool],
a: Self,
b_bits_le: &[bool],
b: Self,
) -> Option<Self>
fn multi_scalar_multiplication( a_bits_le: &[bool], a: Self, b_bits_le: &[bool], b: Self, ) -> Option<Self>
Performs multi-scalar multiplication (MSM) on slices of bit vectors and points. Note: a_bits_le and b_bits_le should be in little endian order.
Object Safety§
This trait is not object safe.