/// Get G2Projective elements by primitive double and add.
// TODO(DFN-1240): Write our own unit tests for all the pairing library
// functions to make sure that their implementation is correct and that the
// operations are what we expect them to be.
Get G2Projective elements by primitive double and add.
TODO(DFN-1240): Write our own unit tests for all the pairing library
functions to make sure that their implementation is correct and that the
operations are what we expect them to be.
Get G2Projective elements by primitive double and add . TODO ( DFN - 1240 ) : Write our own unit tests for all the pairing library functions to make sure that their implementation is correct and that the operations are what we expect them to be .
pub fn uint_to_g2(num: u32) -> G2Projective {
    let mut num = num;
    let mut power = G2Projective::generator();
    let mut ans = G2Projective::identity();
    while num != 0 {
        if (num & 1) != 0 {
            ans += &power;
        }
        power = power.double();
        num >>= 1;
    }
    ans
}
pub fn uint_to_g2 ( num : u32 ) -> G2Projective { let mut num = num ; let mut power = G2Projective :: generator ( ) ; let mut ans = G2Projective :: identity ( ) ; while num != 0 { if ( num & 1 ) != 0 { ans += & power ; } power = power . double ( ) ; num >>= 1 ; } ans }
Get G2Projective elements by primitive double and add.
Get G2Projective elements by primitive double and add .
num
u32