fn discrete_log<E: Engine>(base: E::Gt, result: E::Gt) -> Result<E::Fr, ()> {
        if result == E::Gt::identity() {
            return Ok(E::Fr::zero());
        } else if result == base {
            return Ok(E::Fr::one());
        }
        let mut cur_guess = base;
        for exponent in 2..2_u64.pow(SAVER_BLOCK_SIZE) {
            cur_guess += &base;
            if result == cur_guess {
                return Ok(<E::Fr as From<u64>>::from(exponent));
            }
        }
        Err(())
    }
// Determine the discrete log of a certain value `result`, and base `base`.
Determine the discrete log of a certain value `result`, and base `base`.
Determine the discrete log of a certain value ` result ` and base ` base ` .
fn discrete_log<E: Engine>(base: E::Gt, result: E::Gt) -> Result<E::Fr, ()> {
        if result == E::Gt::identity() {
            return Ok(E::Fr::zero());
        } else if result == base {
            return Ok(E::Fr::one());
        }
        let mut cur_guess = base;
        for exponent in 2..2_u64.pow(SAVER_BLOCK_SIZE) {
            cur_guess += &base;
            if result == cur_guess {
                return Ok(<E::Fr as From<u64>>::from(exponent));
            }
        }
        Err(())
    }
fn discrete_log < E : Engine > ( base : E :: Gt , result : E :: Gt ) -> Result < E :: Fr , ( ) > { if result == E :: Gt :: identity ( ) { return Ok ( E :: Fr :: zero ( ) ) ; } else if result == base { return Ok ( E :: Fr :: one ( ) ) ; } let mut cur_guess = base ; for exponent in 2 .. 2_u64 . pow ( SAVER_BLOCK_SIZE ) { cur_guess += & base ; if result == cur_guess { return Ok ( < E :: Fr as From < u64 > > :: from ( exponent ) ) ; } } Err ( ( ) ) }
Determine the discrete log of a certain value `result`, and base `base`.
Determine the discrete log of a certain value ` result ` and base ` base ` .
base
E::Gt
result
E::Gt
base
E::Gt
result
E::Gt