pub fn new(key: &[u8; KEY_SIZE], iv: [u8; IV_SIZE]) -> Self {
        let state = [
            CONSTANTS[0],
            CONSTANTS[1],
            CONSTANTS[2],
            CONSTANTS[3],
            u32::from_le_bytes(key[..4].try_into().unwrap()),
            u32::from_le_bytes(key[4..8].try_into().unwrap()),
            u32::from_le_bytes(key[8..12].try_into().unwrap()),
            u32::from_le_bytes(key[12..16].try_into().unwrap()),
            u32::from_le_bytes(key[16..20].try_into().unwrap()),
            u32::from_le_bytes(key[20..24].try_into().unwrap()),
            u32::from_le_bytes(key[24..28].try_into().unwrap()),
            u32::from_le_bytes(key[28..32].try_into().unwrap()),
            0,
            0,
            u32::from_le_bytes(iv[0..4].try_into().unwrap()),
            u32::from_le_bytes(iv[4..].try_into().unwrap()),
        ];

        Self {
            state,
            rounds: PhantomData,
        }
    }
/// Initialize core function with the given key, IV, and number of rounds
Initialize core function with the given key, IV, and number of rounds
Initialize core function with the given key IV and number of rounds
pub fn new(key: &[u8; KEY_SIZE], iv: [u8; IV_SIZE]) -> Self {
        let state = [
            CONSTANTS[0],
            CONSTANTS[1],
            CONSTANTS[2],
            CONSTANTS[3],
            u32::from_le_bytes(key[..4].try_into().unwrap()),
            u32::from_le_bytes(key[4..8].try_into().unwrap()),
            u32::from_le_bytes(key[8..12].try_into().unwrap()),
            u32::from_le_bytes(key[12..16].try_into().unwrap()),
            u32::from_le_bytes(key[16..20].try_into().unwrap()),
            u32::from_le_bytes(key[20..24].try_into().unwrap()),
            u32::from_le_bytes(key[24..28].try_into().unwrap()),
            u32::from_le_bytes(key[28..32].try_into().unwrap()),
            0,
            0,
            u32::from_le_bytes(iv[0..4].try_into().unwrap()),
            u32::from_le_bytes(iv[4..].try_into().unwrap()),
        ];
        Self {
            state,
            rounds: PhantomData,
        }
    }
pub fn new ( key : & [ u8 ; KEY_SIZE ] , iv : [ u8 ; IV_SIZE ] ) -> Self { let state = [ CONSTANTS [ 0 ] , CONSTANTS [ 1 ] , CONSTANTS [ 2 ] , CONSTANTS [ 3 ] , u32 :: from_le_bytes ( key [ .. 4 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 4 .. 8 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 8 .. 12 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 12 .. 16 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 16 .. 20 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 20 .. 24 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 24 .. 28 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( key [ 28 .. 32 ] . try_into ( ) . unwrap ( ) ) , 0 , 0 , u32 :: from_le_bytes ( iv [ 0 .. 4 ] . try_into ( ) . unwrap ( ) ) , u32 :: from_le_bytes ( iv [ 4 .. ] . try_into ( ) . unwrap ( ) ) , ] ; Self { state , rounds : PhantomData , } }
Initialize core function with the given key, IV, and number of rounds
Initialize core function with the given key IV and number of rounds
key
&[u8; KEY_SIZE]
iv
[u8; IV_SIZE]
key
&[u8; KEY_SIZE]
iv
[u8; IV_SIZE]