pub fn encrypt(data: &mut [u8], key: &[u8]) {
    check_sizes_and_alignment(data, key);
    // # SAFETY:
    // `data` is of the proper size and alignment as verified by `check_sizes_and_alignment`
    let data_aligned: &mut [u32] =
        unsafe { core::slice::from_raw_parts_mut(data.as_mut_ptr() as *mut u32, data.len() / 4) };

    // # SAFETY:
    // `key` is of the proper size and alignment as verified by `check_sizes_and_alignment`
    let key_aligned: &[u32] =
        unsafe { core::slice::from_raw_parts(key.as_ptr() as *const u32, data.len() / 4) };

    encrypt_words(data_aligned, key_aligned);
}
/// Encrypt a u8 vector with XXTEA
///
/// *Note:* XXTEA works on 32 bit words. If input is not evenly dividable by
/// four, this function will panic.
///
/// # Arguments
///
/// * `data` - The data to be encrypted
/// * `key` - encryption key. Must be 16 bytes
///
Encrypt a u8 vector with XXTEA
Note:* XXTEA works on 32 bit words. If input is not evenly dividable by
four, this function will panic.
Encrypt a u8 vector with XXTEA Note : * XXTEA works on 32 bit words . If input is not evenly dividable by four this function will panic .
pub fn encrypt(data: &mut [u8], key: &[u8]) {
    check_sizes_and_alignment(data, key);
    // # SAFETY:
    // `data` is of the proper size and alignment as verified by `check_sizes_and_alignment`
    let data_aligned: &mut [u32] =
        unsafe { core::slice::from_raw_parts_mut(data.as_mut_ptr() as *mut u32, data.len() / 4) };
    // # SAFETY:
    // `key` is of the proper size and alignment as verified by `check_sizes_and_alignment`
    let key_aligned: &[u32] =
        unsafe { core::slice::from_raw_parts(key.as_ptr() as *const u32, data.len() / 4) };
    encrypt_words(data_aligned, key_aligned);
}
pub fn encrypt ( data : & mut [ u8 ] , key : & [ u8 ] ) { check_sizes_and_alignment ( data , key ) ; // # SAFETY: // `data` is of the proper size and alignment as verified by `check_sizes_and_alignment` let data_aligned : & mut [ u32 ] = unsafe { core :: slice :: from_raw_parts_mut ( data . as_mut_ptr ( ) as * mut u32 , data . len ( ) / 4 ) } ; // # SAFETY: // `key` is of the proper size and alignment as verified by `check_sizes_and_alignment` let key_aligned : & [ u32 ] = unsafe { core :: slice :: from_raw_parts ( key . as_ptr ( ) as * const u32 , data . len ( ) / 4 ) } ; encrypt_words ( data_aligned , key_aligned ) ; }
Encrypt a u8 vector with XXTEA
Note:* XXTEA works on 32 bit words.
Encrypt a u8 vector with XXTEA Note : * XXTEA works on 32 bit words .
data
&mut [u8]
key
&[u8]
data
&mut [u8]
key
&[u8]