pub trait AffinePoint<const N: usize>: Clone + Sized {
const GENERATOR: [u64; N];
const GENERATOR_T: Self;
Show 13 methods
// Required methods
fn new(limbs: [u64; N]) -> Self;
fn identity() -> Self;
fn limbs_ref(&self) -> &[u64; N];
fn limbs_mut(&mut self) -> &mut [u64; N];
fn is_identity(&self) -> bool;
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 complete_add_assign(&mut self, other: &Self) { ... }
fn mul_assign(&mut self, scalar: &[u64]) { ... }
fn multi_scalar_multiplication(
a_bits_le: &[bool],
a: Self,
b_bits_le: &[bool],
b: Self,
) -> Self { ... }
}Required Associated Constants§
Sourceconst GENERATOR: [u64; N]
👎Deprecated: This const will have the Self type in the next major version.
const GENERATOR: [u64; N]
This const will have the Self type in the next major version.
The generator.
const GENERATOR_T: Self
Required Methods§
Sourcefn new(limbs: [u64; N]) -> Self
fn new(limbs: [u64; N]) -> Self
Creates a new AffinePoint from the given limbs.
This function does not check that the inputs form a valid point. Only use this function
when the input is either trusted or previously validated.
Sourcefn identity() -> Self
fn identity() -> Self
Creates a new AffinePoint that corresponds to the identity point.
Sourcefn limbs_mut(&mut self) -> &mut [u64; N]
fn limbs_mut(&mut self) -> &mut [u64; N]
Returns a mutable reference to the limbs. If the point is the infinity point, this will panic.
fn is_identity(&self) -> bool
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.
This function does not check that the inputs form a valid point. Only use this function
when the input is either trusted or previously validated.
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 complete_add_assign(&mut self, other: &Self)
fn complete_add_assign(&mut self, other: &Self)
Adds the given AffinePoint to self. Can be optionally overridden to use a different
implementation of addition in multi-scalar multiplication, which is used in secp256k1
recovery.
Sourcefn mul_assign(&mut self, scalar: &[u64])
fn mul_assign(&mut self, scalar: &[u64])
Multiplies self by the given scalar.
Sourcefn multi_scalar_multiplication(
a_bits_le: &[bool],
a: Self,
b_bits_le: &[bool],
b: Self,
) -> Self
fn multi_scalar_multiplication( a_bits_le: &[bool], a: Self, b_bits_le: &[bool], b: Self, ) -> 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".