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§
sourcefn two_to_limb() -> Self
fn two_to_limb() -> Self
2^{LIMB_BITS}
sourcefn two_to_2limb() -> Self
fn two_to_2limb() -> Self
2^{2 * LIMB_BITS}
sourcefn binary_modulus() -> Self
fn binary_modulus() -> Self
2^t
sourcefn max_foreign_field_modulus<F: PrimeField>() -> Self
fn max_foreign_field_modulus<F: PrimeField>() -> Self
2^259 (see foreign field multiplication RFC)
sourcefn to_compact_limbs(&self) -> [BigUint; 2]
fn to_compact_limbs(&self) -> [BigUint; 2]
Convert to 2 limbs of 2 * LIMB_BITS each. The compressed term is the bottom part
sourcefn to_field_limbs<F: Field>(&self) -> [F; 3]
fn to_field_limbs<F: Field>(&self) -> [F; 3]
Convert to 3 PrimeField limbs of LIMB_BITS each
sourcefn to_compact_field_limbs<F: Field>(&self) -> [F; 2]
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.