Trait blstrs::PrimeField[][src]

pub trait PrimeField: Field {
    type Repr: PrimeFieldRepr + From<Self>;

    pub const NUM_BITS: u32;
    pub const CAPACITY: u32;
    pub const S: u32;

    pub fn from_repr(Self::Repr) -> Result<Self, PrimeFieldDecodingError>;
pub fn into_repr(&self) -> Self::Repr;
pub fn char() -> Self::Repr;
pub fn multiplicative_generator() -> Self;
pub fn root_of_unity() -> Self; pub fn from_str(s: &str) -> Option<Self> { ... } }

This represents an element of a prime field.

Associated Types

type Repr: PrimeFieldRepr + From<Self>[src]

The prime field can be converted back and forth into this biginteger representation.

Loading content...

Associated Constants

pub const NUM_BITS: u32[src]

How many bits are needed to represent an element of this field.

pub const CAPACITY: u32[src]

How many bits of information can be reliably stored in the field element.

pub const S: u32[src]

2^s * t = char() - 1 with t odd.

Loading content...

Required methods

pub fn from_repr(Self::Repr) -> Result<Self, PrimeFieldDecodingError>[src]

Convert this prime field element into a biginteger representation.

pub fn into_repr(&self) -> Self::Repr[src]

Convert a biginteger representation into a prime field element, if the number is an element of the field.

pub fn char() -> Self::Repr[src]

Returns the field characteristic; the modulus.

pub fn multiplicative_generator() -> Self[src]

Returns the multiplicative generator of char() - 1 order. This element must also be quadratic nonresidue.

pub fn root_of_unity() -> Self[src]

Returns the 2^s root of unity computed by exponentiating the multiplicative_generator() by t.

Loading content...

Provided methods

pub fn from_str(s: &str) -> Option<Self>[src]

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string.

Loading content...

Implementors

impl PrimeField for Fp[src]

type Repr = FpRepr

fn into_repr(&self) -> Self::Repr[src]

Convert a biginteger representation into a prime field element, if the number is an element of the field.

impl PrimeField for Scalar[src]

type Repr = ScalarRepr

fn into_repr(&self) -> Self::Repr[src]

Convert a biginteger representation into a prime field element, if the number is an element of the field.

Loading content...