Struct ring::ec::suite_b::ops::CommonOps

source ·
pub struct CommonOps {
    num_limbs: usize,
    q: Modulus,
    n: Elem<Q, Unencoded>,
    pub a: Elem<Q, R>,
    pub b: Elem<Q, R>,
    elem_mul_mont: unsafe extern "C" fn(r: *mut u64, a: *const u64, b: *const u64),
    elem_sqr_mont: unsafe extern "C" fn(r: *mut u64, a: *const u64),
    point_add_jacobian_impl: unsafe extern "C" fn(r: *mut u64, a: *const u64, b: *const u64),
}
Expand description

Operations and values needed by all curve operations.

Fields§

§num_limbs: usize§q: Modulus§n: Elem<Q, Unencoded>§a: Elem<Q, R>§b: Elem<Q, R>§elem_mul_mont: unsafe extern "C" fn(r: *mut u64, a: *const u64, b: *const u64)§elem_sqr_mont: unsafe extern "C" fn(r: *mut u64, a: *const u64)§point_add_jacobian_impl: unsafe extern "C" fn(r: *mut u64, a: *const u64, b: *const u64)

Implementations§

source§

impl CommonOps

source

pub fn len(&self) -> usize

source

pub fn elem_add<E: Encoding>(&self, a: &mut Elem<Q, E>, b: &Elem<Q, E>)

source

pub fn elems_are_equal(&self, a: &Elem<Q, R>, b: &Elem<Q, R>) -> LimbMask

source

pub fn elem_unencoded(&self, a: &Elem<Q, R>) -> Elem<Q, Unencoded>

source

pub fn elem_mul(&self, a: &mut Elem<Q, R>, b: &Elem<Q, R>)

source

pub fn elem_product<EA: Encoding, EB: Encoding>( &self, a: &Elem<Q, EA>, b: &Elem<Q, EB>, ) -> Elem<Q, <(EA, EB) as ProductEncoding>::Output>

source

pub fn elem_square(&self, a: &mut Elem<Q, R>)

source

pub fn elem_squared(&self, a: &Elem<Q, R>) -> Elem<Q, R>

source

pub fn is_zero<M, E: Encoding>(&self, a: &Elem<M, E>) -> bool

source

pub fn elem_verify_is_not_zero(&self, a: &Elem<Q, R>) -> Result<(), Unspecified>

source

pub fn point_sum(&self, a: &Point, b: &Point) -> Point

source

pub fn point_x(&self, p: &Point) -> Elem<Q, R>

source

pub fn point_y(&self, p: &Point) -> Elem<Q, R>

source

pub fn point_z(&self, p: &Point) -> Elem<Q, R>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.