fn full_prefix_blocks_count<T: DeterministicOracle>(oracle: &T) -> Result<usize> {
    if let Some(result) = oracle
        .encrypt(&[0])?
        .chunks(BLOCK_SIZE)
        .zip(oracle.encrypt(&[1])?.chunks(BLOCK_SIZE))
        .position(|(x, y)| x != y)
    {
        Ok(result)
    } else {
        Err("no differing blocks found, something is wrong with the provided oracle".into())
    }
}
// For an oracle prepending prefix and appending suffix to its input, this function returns
// prefix.len()/BLOCK_SIZE, that is the number of blocks fully occupied by the prefix.
//
// To determine this number, we pass two different cleartexts to the oracle and count the number
// of identical blocks at the start of the corresponding ciphertexts.
For an oracle prepending prefix and appending suffix to its input, this function returns
prefix.len()/BLOCK_SIZE, that is the number of blocks fully occupied by the prefix.

To determine this number, we pass two different cleartexts to the oracle and count the number
of identical blocks at the start of the corresponding ciphertexts.
For an oracle prepending prefix and appending suffix to its input this function returns prefix . len () / BLOCK_SIZE that is the number of blocks fully occupied by the prefix . To determine this number we pass two different cleartexts to the oracle and count the number of identical blocks at the start of the corresponding ciphertexts .
fn full_prefix_blocks_count<T: DeterministicOracle>(oracle: &T) -> Result<usize> {
    if let Some(result) = oracle
        .encrypt(&[0])?
        .chunks(BLOCK_SIZE)
        .zip(oracle.encrypt(&[1])?.chunks(BLOCK_SIZE))
        .position(|(x, y)| x != y)
    {
        Ok(result)
    } else {
        Err("no differing blocks found, something is wrong with the provided oracle".into())
    }
}
fn full_prefix_blocks_count < T : DeterministicOracle > ( oracle : & T ) -> Result < usize > { if let Some ( result ) = oracle . encrypt ( & [ 0 ] ) ? . chunks ( BLOCK_SIZE ) . zip ( oracle . encrypt ( & [ 1 ] ) ? . chunks ( BLOCK_SIZE ) ) . position ( | ( x , y ) | x != y ) { Ok ( result ) } else { Err ( " " . into ( ) ) } }
For an oracle prepending prefix and appending suffix to its input, this function returns
prefix.len()/BLOCK_SIZE, that is the number of blocks fully occupied by the prefix.
For an oracle prepending prefix and appending suffix to its input this function returns prefix . len () / BLOCK_SIZE that is the number of blocks fully occupied by the prefix .
oracle
&T
oracle
&T