/// Encrypts input bytes with a 4 bytes big-endian length header where each byte is
/// XOR'ed with the previous encrypted byte.
Encrypts input bytes with a 4 bytes big-endian length header where each byte is
XOR'ed with the previous encrypted byte.
Encrypts input bytes with a 4 bytes big - endian length header where each byte is XOR ' ed with the previous encrypted byte .
pub fn encrypt_with_header(bytes: &[u8]) -> Vec<u8> {
    let num_bytes = bytes.len();
    let header = (num_bytes as u32).to_be_bytes();
    let mut buf = Vec::with_capacity(header.len() + num_bytes);
    buf.extend(&header);
    buf.extend(&encrypt(bytes));
    buf
}
pub fn encrypt_with_header ( bytes : & [ u8 ] ) -> Vec < u8 > { let num_bytes = bytes . len ( ) ; let header = ( num_bytes as u32 ) . to_be_bytes ( ) ; let mut buf = Vec :: with_capacity ( header . len ( ) + num_bytes ) ; buf . extend ( & header ) ; buf . extend ( & encrypt ( bytes ) ) ; buf }
Encrypts input bytes with a 4 bytes big-endian length header where each byte is
XOR'ed with the previous encrypted byte.
Encrypts input bytes with a 4 bytes big - endian length header where each byte is XOR ' ed with the previous encrypted byte .
bytes
&[u8]