Trait ff::BatchInvert

source ·
pub trait BatchInvert<F: Field> {
    // Required method
    fn batch_invert(self) -> F;
}
Expand description

Extension trait for iterators over mutable field elements which allows those field elements to be inverted in a batch.

I: IntoIterator<Item = &'a mut F: Field + ConstantTimeEq> implements this trait when the alloc feature flag is enabled.

For non-allocating contexts, see the BatchInverter struct.

Required Methods§

source

fn batch_invert(self) -> F

Consumes this iterator and inverts each field element (when nonzero). Zero-valued elements are left as zero.

Returns the inverse of the product of all nonzero field elements.

Implementors§

source§

impl<'a, F, I> BatchInvert<F> for I
where F: Field + ConstantTimeEq, I: IntoIterator<Item = &'a mut F>,