fn miller_loop<D: MillerLoopDriver>(driver: &mut D) -> D::Output {
    let mut f = D::one();

    let mut found_one = false;
    for i in (0..64).rev().map(|b| (((BLS_X >> 1) >> b) & 1) == 1) {
        if !found_one {
            found_one = i;
            continue;
        }

        f = driver.doubling_step(f);

        if i {
            f = driver.addition_step(f);
        }

        f = D::square_output(f);
    }

    f = driver.doubling_step(f);

    if BLS_X_IS_NEGATIVE {
        f = D::conjugate(f);
    }

    f
}
/// This is a "generic" implementation of the Miller loop to avoid duplicating code
/// structure elsewhere; instead, we'll write concrete instantiations of
/// `MillerLoopDriver` for whatever purposes we need (such as caching modes).
This is a "generic" implementation of the Miller loop to avoid duplicating code
structure elsewhere; instead, we'll write concrete instantiations of
`MillerLoopDriver` for whatever purposes we need (such as caching modes).
This is a " generic " implementation of the Miller loop to avoid duplicating code structure elsewhere ; instead we ' ll write concrete instantiations of ` MillerLoopDriver ` for whatever purposes we need ( such as caching modes ) .
fn miller_loop<D: MillerLoopDriver>(driver: &mut D) -> D::Output {
    let mut f = D::one();
    let mut found_one = false;
    for i in (0..64).rev().map(|b| (((BLS_X >> 1) >> b) & 1) == 1) {
        if !found_one {
            found_one = i;
            continue;
        }
        f = driver.doubling_step(f);
        if i {
            f = driver.addition_step(f);
        }
        f = D::square_output(f);
    }
    f = driver.doubling_step(f);
    if BLS_X_IS_NEGATIVE {
        f = D::conjugate(f);
    }
    f
}
fn miller_loop < D : MillerLoopDriver > ( driver : & mut D ) -> D :: Output { let mut f = D :: one ( ) ; let mut found_one = false ; for i in ( 0 .. 64 ) . rev ( ) . map ( | b | ( ( ( BLS_X >> 1 ) >> b ) & 1 ) == 1 ) { if ! found_one { found_one = i ; continue ; } f = driver . doubling_step ( f ) ; if i { f = driver . addition_step ( f ) ; } f = D :: square_output ( f ) ; } f = driver . doubling_step ( f ) ; if BLS_X_IS_NEGATIVE { f = D :: conjugate ( f ) ; } f }
This is a "generic" implementation of the Miller loop to avoid duplicating code
structure elsewhere; instead, we'll write concrete instantiations of
`MillerLoopDriver` for whatever purposes we need (such as caching modes).
This is a " generic " implementation of the Miller loop to avoid duplicating code structure elsewhere ; instead we ' ll write concrete instantiations of ` MillerLoopDriver ` for whatever purposes we need ( such as caching modes ) .
driver
&mut D