fn build_iv(nonce: [u8; 12]) -> [u8; 16] {
    let mut iv = [0; 16];
    // first byte is... magic, I guess
    iv[0] = 0x02;
    iv[1..13].copy_from_slice(&nonce);
    // 24-bit counter, apparently (starting at 1, not 0!)
    iv[13..16].copy_from_slice(&[0x00, 0x00, 0x01]);

    debug!("using nonce: {:?}", Blob(&nonce));
    debug!("using    iv: {:?}", Blob(&iv));

    iv
}
/// Builds the 16-byte IV from the 12-byte nonce stored in the encryption init
/// header.
Builds the 16-byte IV from the 12-byte nonce stored in the encryption init
header.
Builds the 16 - byte IV from the 12 - byte nonce stored in the encryption init header .
fn build_iv(nonce: [u8; 12]) -> [u8; 16] {
    let mut iv = [0; 16];
    // first byte is... magic, I guess
    iv[0] = 0x02;
    iv[1..13].copy_from_slice(&nonce);
    // 24-bit counter, apparently (starting at 1, not 0!)
    iv[13..16].copy_from_slice(&[0x00, 0x00, 0x01]);
    debug!("using nonce: {:?}", Blob(&nonce));
    debug!("using    iv: {:?}", Blob(&iv));
    iv
}
fn build_iv ( nonce : [ u8 ; 12 ] ) -> [ u8 ; 16 ] { let mut iv = [ 0 ; 16 ] ; // first byte is... magic, I guess iv [ 0 ] = 0x02 ; iv [ 1 .. 13 ] . copy_from_slice ( & nonce ) ; // 24-bit counter, apparently (starting at 1, not 0!) iv [ 13 .. 16 ] . copy_from_slice ( & [ 0x00 , 0x00 , 0x01 ] ) ; debug ! ( " " Blob ( nonce ) ) ; debug ! ( " " Blob ( iv ) ) ; iv }
Builds the 16-byte IV from the 12-byte nonce stored in the encryption init
header.
Builds the 16 - byte IV from the 12 - byte nonce stored in the encryption init header .
nonce
[u8; 12]