Trait sp1_core::operations::field::params::NumWords

source ·
pub trait NumWords: Clone + Debug {
    type WordsFieldElement: ArrayLength + Debug;
    type WordsCurvePoint: ArrayLength + Debug;
}
Expand description

Trait that holds number of words needed to represent a field element and a curve point.

Required Associated Types§

source

type WordsFieldElement: ArrayLength + Debug

The number of words needed to represent a field element.

source

type WordsCurvePoint: ArrayLength + Debug

The number of words needed to represent a curve point (two field elements).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<N: NumLimbs> NumWords for N
where N::Limbs: Div<U4> + Div<U2>, <N::Limbs as Div<U4>>::Output: ArrayLength + Debug, <N::Limbs as Div<U2>>::Output: ArrayLength + Debug,

Implement NumWords for NumLimbs where # Limbs is divisible by 4.

Using typenum we can do N/4 and N/2 in type-level arithmetic. Having it as a separate trait avoids needing the Div where clauses everywhere.