[][src]Trait zerocaf::traits::ops::Pow

pub trait Pow<T> {
    type Output;
#[must_use]
    fn pow(self, exp: T) -> Self::Output;
}
[]

Trait that represents the modular exponentiation operation, ie.a ^ b (mod l), for any kind of element on the library (except points).

This trait is implemented following the rules that mandate over the Type that is being implemented.

Associated Types

type Output

Required methods

#[must_use] fn pow(self, exp: T) -> Self::Output[]

Returns a^b (mod l).

Implementors

impl<'a, 'b> Pow<&'b FieldElement> for &'a FieldElement[src][]

type Output = FieldElement

fn pow(self, exp: &'b FieldElement) -> FieldElement[src][]

Performs the op: a^b (mod l).

Exponentiation by squaring classical algorithm implementation for FieldElement.

Schneier, Bruce (1996). Applied Cryptography: Protocols, Algorithms, and Source Code in C, Second Edition (2nd ed.).

impl<'a, 'b> Pow<&'b Scalar> for &'a Scalar[src][]

Performs the op: a^b (mod l).

Exponentiation by squaring classical algorithm implementation for Scalar.

Schneier, Bruce (1996). Applied Cryptography: Protocols, Algorithms, and Source Code in C, Second Edition (2nd ed.).