fn pick_random_element(disc: &BigInt) -> BinaryQF {
    let mut i = 0;
    let two = BigInt::from(2);
    let max = BigInt::from(20);
    let mut b = &two * BigInt::sample(disc.bit_length()) + BigInt::one();
    let mut c = two.clone();
    let mut b2_minus_disc: BigInt = b.pow(2) - disc;
    let four = BigInt::from(4);
    let mut u = b2_minus_disc.div_floor(&four);
    while u.mod_floor(&c) != BigInt::zero() {
        b = &two * BigInt::sample(disc.bit_length()) + BigInt::one();
        b2_minus_disc = b.pow(2) - disc;
        u = b2_minus_disc.div_floor(&four);
        i = i + 1;
        c = (&c.nextprime()).mod_floor(&max);
    }
    let a = u.div_floor(&c);
    let a_b_delta = ABDeltaTriple {
        a,
        b,
        delta: disc.clone(),
    };

    let g = BinaryQF::binary_quadratic_form_disc(&a_b_delta).reduce();
    g
}
// helper function: generate random group element from disc (used in setup)
// see protocol description in vdf h_g function
helper function: generate random group element from disc (used in setup)
see protocol description in vdf h_g function
helper function : generate random group element from disc ( used in setup ) see protocol description in vdf h_g function
fn pick_random_element(disc: &BigInt) -> BinaryQF {
    let mut i = 0;
    let two = BigInt::from(2);
    let max = BigInt::from(20);
    let mut b = &two * BigInt::sample(disc.bit_length()) + BigInt::one();
    let mut c = two.clone();
    let mut b2_minus_disc: BigInt = b.pow(2) - disc;
    let four = BigInt::from(4);
    let mut u = b2_minus_disc.div_floor(&four);
    while u.mod_floor(&c) != BigInt::zero() {
        b = &two * BigInt::sample(disc.bit_length()) + BigInt::one();
        b2_minus_disc = b.pow(2) - disc;
        u = b2_minus_disc.div_floor(&four);
        i = i + 1;
        c = (&c.nextprime()).mod_floor(&max);
    }
    let a = u.div_floor(&c);
    let a_b_delta = ABDeltaTriple {
        a,
        b,
        delta: disc.clone(),
    };
    let g = BinaryQF::binary_quadratic_form_disc(&a_b_delta).reduce();
    g
}
fn pick_random_element ( disc : & BigInt ) -> BinaryQF { let mut i = 0 ; let two = BigInt :: from ( 2 ) ; let max = BigInt :: from ( 20 ) ; let mut b = & two * BigInt :: sample ( disc . bit_length ( ) ) + BigInt :: one ( ) ; let mut c = two . clone ( ) ; let mut b2_minus_disc : BigInt = b . pow ( 2 ) - disc ; let four = BigInt :: from ( 4 ) ; let mut u = b2_minus_disc . div_floor ( & four ) ; while u . mod_floor ( & c ) != BigInt :: zero ( ) { b = & two * BigInt :: sample ( disc . bit_length ( ) ) + BigInt :: one ( ) ; b2_minus_disc = b . pow ( 2 ) - disc ; u = b2_minus_disc . div_floor ( & four ) ; i = i + 1 ; c = ( & c . nextprime ( ) ) . mod_floor ( & max ) ; } let a = u . div_floor ( & c ) ; let a_b_delta = ABDeltaTriple { a , b , delta : disc . clone ( ) , } ; let g = BinaryQF :: binary_quadratic_form_disc ( & a_b_delta ) . reduce ( ) ; g }
helper function: generate random group element from disc (used in setup)
see protocol description in vdf h_g function
helper function : generate random group element from disc ( used in setup ) see protocol description in vdf h_g function
disc
&BigInt
disc
&BigInt