snark_verifier::loader

Trait LoadedScalar

Source
pub trait LoadedScalar<F: PrimeField>:
    Clone
    + Debug
    + PartialEq
    + FieldOps {
    type Loader: ScalarLoader<F, LoadedScalar = Self>;

    // Required methods
    fn loader(&self) -> &Self::Loader;
    fn pow_var(&self, exp: &Self, exp_max_bits: usize) -> Self;

    // Provided methods
    fn square(&self) -> Self { ... }
    fn invert(&self) -> Option<Self> { ... }
    fn pow_const(&self, exp: u64) -> Self { ... }
    fn powers(&self, n: usize) -> Vec<Self> { ... }
}
Expand description

Loaded field element.

Required Associated Types§

Source

type Loader: ScalarLoader<F, LoadedScalar = Self>

Required Methods§

Source

fn loader(&self) -> &Self::Loader

Returns Loader.

Source

fn pow_var(&self, exp: &Self, exp_max_bits: usize) -> Self

Returns power to exponent, where exponent is also LoadedScalar. If Loader is for Halo2, then exp must have at most exp_max_bits bits (otherwise constraints will fail).

Currently unimplemented for EvmLoader

Provided Methods§

Source

fn square(&self) -> Self

Returns square.

Source

fn invert(&self) -> Option<Self>

Returns inverse if any.

Source

fn pow_const(&self, exp: u64) -> Self

Returns power to exponent.

Source

fn powers(&self, n: usize) -> Vec<Self>

Returns powers up to exponent n-1.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C: CurveAffine, EccChip: EccInstructions<C>> LoadedScalar<<C as PrimeCurveAffine>::Scalar> for snark_verifier::loader::halo2::Scalar<C, EccChip>

Source§

type Loader = Rc<Halo2Loader<C, EccChip>>

Source§

impl<F: PrimeField> LoadedScalar<F> for F

Source§

impl<F: PrimeField<Repr = [u8; 32]>> LoadedScalar<F> for snark_verifier::loader::evm::Scalar