pub trait BigUintForeignFieldHelpers {
    // Required methods
    fn two() -> Self;
    fn two_to_limb() -> Self;
    fn two_to_2limb() -> Self;
    fn binary_modulus() -> Self;
    fn max_foreign_field_modulus<F: PrimeField>() -> Self;
    fn to_limbs(&self) -> [BigUint; 3];
    fn to_compact_limbs(&self) -> [BigUint; 2];
    fn to_field_limbs<F: Field>(&self) -> [F; 3];
    fn to_compact_field_limbs<F: Field>(&self) -> [F; 2];
    fn negate(&self) -> BigUint;
}
Expand description

Foreign field helpers

Required Methods§

source

fn two() -> Self

2

source

fn two_to_limb() -> Self

2^{LIMB_BITS}

source

fn two_to_2limb() -> Self

2^{2 * LIMB_BITS}

source

fn binary_modulus() -> Self

2^t

source

fn max_foreign_field_modulus<F: PrimeField>() -> Self

2^259 (see foreign field multiplication RFC)

source

fn to_limbs(&self) -> [BigUint; 3]

Convert to 3 limbs of LIMB_BITS each

source

fn to_compact_limbs(&self) -> [BigUint; 2]

Convert to 2 limbs of 2 * LIMB_BITS each. The compressed term is the bottom part

source

fn to_field_limbs<F: Field>(&self) -> [F; 3]

Convert to 3 PrimeField limbs of LIMB_BITS each

source

fn to_compact_field_limbs<F: Field>(&self) -> [F; 2]

Convert to 2 PrimeField limbs of 2 * LIMB_BITS each. The compressed term is the bottom part.

source

fn negate(&self) -> BigUint

Negate: 2^T - self

Implementations on Foreign Types§

source§

impl BigUintForeignFieldHelpers for BigUint

source§

fn two() -> Self

source§

fn two_to_limb() -> Self

source§

fn two_to_2limb() -> Self

source§

fn binary_modulus() -> Self

source§

fn max_foreign_field_modulus<F: PrimeField>() -> Self

source§

fn to_limbs(&self) -> [Self; 3]

source§

fn to_compact_limbs(&self) -> [Self; 2]

source§

fn to_field_limbs<F: Field>(&self) -> [F; 3]

source§

fn to_compact_field_limbs<F: Field>(&self) -> [F; 2]

source§

fn negate(&self) -> BigUint

Implementors§