fn pow_p(base: u64, exp: u64) -> u64 {
    if exp == 0 {
        1
    } else if exp % 2 == 1 {
        let x = pow_p(base, exp / 2);
        (((x * x) % P) * base) % P
    } else {
        let x = pow_p(base, exp / 2);
        (x * x) % P
    }
}
// Compute the power of an element in Z_P using an
// "exponentiation by squaring" approach.
Compute the power of an element in Z_P using an
"exponentiation by squaring" approach.
Compute the power of an element in Z_P using an " exponentiation by squaring " approach .
fn pow_p(base: u64, exp: u64) -> u64 {
    if exp == 0 {
        1
    } else if exp % 2 == 1 {
        let x = pow_p(base, exp / 2);
        (((x * x) % P) * base) % P
    } else {
        let x = pow_p(base, exp / 2);
        (x * x) % P
    }
}
fn pow_p ( base : u64 , exp : u64 ) -> u64 { if exp == 0 { 1 } else if exp % 2 == 1 { let x = pow_p ( base , exp / 2 ) ; ( ( ( x * x ) % P ) * base ) % P } else { let x = pow_p ( base , exp / 2 ) ; ( x * x ) % P } }
Compute the power of an element in Z_P using an
"exponentiation by squaring" approach.
Compute the power of an element in Z_P using an " exponentiation by squaring " approach .
base
u64
exp
u64