Struct ntru::types::NtruPrivPoly [] [src]

pub struct NtruPrivPoly {
    // some fields omitted
}

Private polynomial, can be ternary or product-form

Methods

impl NtruPrivPoly
[src]

fn new_with_prod_poly(poly: NtruProdPoly) -> NtruPrivPoly

Create a new NtruPrivPoly with a NtruProdPoly

fn new_with_tern_poly(poly: NtruTernPoly) -> NtruPrivPoly

Create a new NtruPrivPoly with a NtruTernPoly

fn is_product(&self) -> bool

If the NtruPrivPoly contains a NtruProdPoly

fn get_poly_prod(&self) -> &NtruProdPoly

fn get_poly_tern(&self) -> &NtruTernPoly

fn invert(&self, mod_mask: u16) -> (NtruIntPoly, bool)

Inverse modulo q

Computes the inverse of 1+3a mod q; q must be a power of 2. It also returns if the polynomial is invertible.

The algorithm is described in "Almost Inverses and Fast NTRU Key Generation" at http://www.securityinnovation.com/uploads/Crypto/NTRUTech014.pdf

fn invert_32(&self, mod_mask: u16) -> (NtruIntPoly, bool)

Inverse modulo q

Computes the inverse of 1+3a mod q; q must be a power of 2. This function uses 32-bit arithmetic. It also returns if the polynomial is invertible.

The algorithm is described in "Almost Inverses and Fast NTRU Key Generation" at http://www.securityinnovation.com/uploads/Crypto/NTRUTech014.pdf

fn invert_64(&self, mod_mask: u16) -> (NtruIntPoly, bool)

Inverse modulo q

Computes the inverse of 1+3a mod q; q must be a power of 2. This function uses 64-bit arithmetic. It also returns if the polynomial is invertible.

The algorithm is described in "Almost Inverses and Fast NTRU Key Generation" at http://www.securityinnovation.com/uploads/Crypto/NTRUTech014.pdf

Trait Implementations

impl Clone for NtruPrivPoly
[src]

fn clone(&self) -> NtruPrivPoly

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for NtruPrivPoly
[src]

fn default() -> NtruPrivPoly

Returns the "default value" for a type. Read more

impl Debug for NtruPrivPoly
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for NtruPrivPoly
[src]

fn eq(&self, other: &NtruPrivPoly) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.