pub fn compute_windowed_naf(&self, width: u8) -> [i8; 256] {
        let mut k = self.reduce();
        let mut i = 0;
        let one = Fr::one().reduce();
        let mut res = [0i8; 256];

        while k >= one {
            if !k.is_even() {
                let ki = k.mods_2_pow_k(width);
                res[i] = ki;
                k = k - Fr::from(ki);
            } else {
                res[i] = 0i8;
            };

            k.divn(1u32);
            i += 1;
        }
        res
    }
/// Computes the windowed-non-adjacent for a
/// given an element in the JubJub Scalar field.
Computes the windowed-non-adjacent for a
given an element in the JubJub Scalar field.
Computes the windowed - non - adjacent for a given an element in the JubJub Scalar field .
pub fn compute_windowed_naf(&self, width: u8) -> [i8; 256] {
        let mut k = self.reduce();
        let mut i = 0;
        let one = Fr::one().reduce();
        let mut res = [0i8; 256];
        while k >= one {
            if !k.is_even() {
                let ki = k.mods_2_pow_k(width);
                res[i] = ki;
                k = k - Fr::from(ki);
            } else {
                res[i] = 0i8;
            };
            k.divn(1u32);
            i += 1;
        }
        res
    }
pub fn compute_windowed_naf ( & self , width : u8 ) -> [ i8 ; 256 ] { let mut k = self . reduce ( ) ; let mut i = 0 ; let one = Fr :: one ( ) . reduce ( ) ; let mut res = [ 0i8 ; 256 ] ; while k >= one { if ! k . is_even ( ) { let ki = k . mods_2_pow_k ( width ) ; res [ i ] = ki ; k = k - Fr :: from ( ki ) ; } else { res [ i ] = 0i8 ; } ; k . divn ( 1u32 ) ; i += 1 ; } res }
Computes the windowed-non-adjacent for a
given an element in the JubJub Scalar field.
Computes the windowed - non - adjacent for a given an element in the JubJub Scalar field .
&self
width
u8