zinc_utils/inner_transparent_field.rs
1use crypto_primitives::PrimeField;
2
3/// A trait for fields that allow to perform operations
4/// on inner Montgomery representations of field elements.
5pub trait InnerTransparentField: PrimeField {
6 /// Add inner Montgomery representations using a config.
7 fn add_inner(lhs: &Self::Inner, rhs: &Self::Inner, config: &Self::Config) -> Self::Inner;
8
9 /// Subtract inner Montgomery representations using a config.
10 fn sub_inner(lhs: &Self::Inner, rhs: &Self::Inner, config: &Self::Config) -> Self::Inner;
11
12 /// Multiply a field element by an inner Montgomery representation.
13 fn mul_assign_by_inner(&mut self, rhs: &Self::Inner);
14}