pub fn run(
        aes: &mut pac::AES,
        cipher_mode: cipher_mode,
        encrypt_sel: encrypt_sel,
        key: &[u8],
        iv: &[u8],
        aad: &[u8],
        ind: &[u8],
        outd: &mut [u8],
        tag: Option<&mut [u8]>,
    ) -> Option<bool>
{
    setup(aes, cipher_mode, encrypt_sel, key, iv, aad, ind.len());

    unsafe {
        // Send and receive plaintext/ciphertext
        let mut iptr = 0;
        let mut optr = 0;
        while optr < ind.len() {
            while iptr < ind.len() && aes.data_in_flag.read().data_in_flag() == DATA_IN_FLAG_A::CAN_INPUT {
                aes.text_data.write(|w| w.bits(read4pad(ind, iptr)));
                iptr += 4;
            }
            while aes.data_out_flag.read().data_out_flag() == DATA_OUT_FLAG_A::CAN_OUTPUT {
                write4pad(outd, optr, aes.out_data.read().bits());
                optr += 4;
            }
        }

    }

    finish(aes, cipher_mode, tag)
}
/** AES operation (encrypt or decrypt) using hardware engine. Takes a &mut
 * AES as only one operation can be active at a time.
 * In GCM mode, a mutable array can be passed which both provides the
 * tag to check against, as well as receives the computed tag.
 * Returns tag validation status (true if input tag matches computed tag,
 * false otherwise). This comparison is done in hardware in (one would expect)
 * constant time.
 *
 * Supported modes:
 *
 * Mode Keybits           Extra input              Extra output
 * ---- ---------------   ------------------------ ----------------
 * ECB  128 / 192 / 256   no IV
 * CBC  128 / 192 / 256   128 bit IV
 * GCM  128 / 192 / 256   96 bit IV + ? bytes AAD) 128 bit tag (optional)
 */
AES operation (encrypt or decrypt) using hardware engine. Takes a &mut
AES as only one operation can be active at a time.
In GCM mode, a mutable array can be passed which both provides the
tag to check against, as well as receives the computed tag.
Returns tag validation status (true if input tag matches computed tag,
false otherwise). This comparison is done in hardware in (one would expect)
constant time.

Supported modes.


AES operation ( encrypt or decrypt ) using hardware engine . Takes a &mut AES as only one operation can be active at a time . In GCM mode a mutable array can be passed which both provides the tag to check against as well as receives the computed tag . Returns tag validation status ( true if input tag matches computed tag false otherwise ) . This comparison is done in hardware in ( one would expect ) constant time . Supported modes .
pub fn run(
        aes: &mut pac::AES,
        cipher_mode: cipher_mode,
        encrypt_sel: encrypt_sel,
        key: &[u8],
        iv: &[u8],
        aad: &[u8],
        ind: &[u8],
        outd: &mut [u8],
        tag: Option<&mut [u8]>,
    ) -> Option<bool>
{
    setup(aes, cipher_mode, encrypt_sel, key, iv, aad, ind.len());
    unsafe {
        // Send and receive plaintext/ciphertext
        let mut iptr = 0;
        let mut optr = 0;
        while optr < ind.len() {
            while iptr < ind.len() && aes.data_in_flag.read().data_in_flag() == DATA_IN_FLAG_A::CAN_INPUT {
                aes.text_data.write(|w| w.bits(read4pad(ind, iptr)));
                iptr += 4;
            }
            while aes.data_out_flag.read().data_out_flag() == DATA_OUT_FLAG_A::CAN_OUTPUT {
                write4pad(outd, optr, aes.out_data.read().bits());
                optr += 4;
            }
        }
    }
    finish(aes, cipher_mode, tag)
}
pub fn run ( aes : & mut pac :: AES , cipher_mode : cipher_mode , encrypt_sel : encrypt_sel , key : & [ u8 ] , iv : & [ u8 ] , aad : & [ u8 ] , ind : & [ u8 ] , outd : & mut [ u8 ] , tag : Option < & mut [ u8 ] > , ) -> Option < bool > { setup ( aes , cipher_mode , encrypt_sel , key , iv , aad , ind . len ( ) ) ; unsafe { // Send and receive plaintext/ciphertext let mut iptr = 0 ; let mut optr = 0 ; while optr < ind . len ( ) { while iptr < ind . len ( ) && aes . data_in_flag . read ( ) . data_in_flag ( ) == DATA_IN_FLAG_A :: CAN_INPUT { aes . text_data . write ( | w | w . bits ( read4pad ( ind , iptr ) ) ) ; iptr += 4 ; } while aes . data_out_flag . read ( ) . data_out_flag ( ) == DATA_OUT_FLAG_A :: CAN_OUTPUT { write4pad ( outd , optr , aes . out_data . read ( ) . bits ( ) ) ; optr += 4 ; } } } finish ( aes , cipher_mode , tag ) }
AES operation (encrypt or decrypt) using hardware engine.
AES operation ( encrypt or decrypt ) using hardware engine .
aes
&mut pac::AES
cipher_mode
cipher_mode
encrypt_sel
encrypt_sel
key
&[u8]
iv
&[u8]
aad
&[u8]
ind
&[u8]
outd
&mut [u8]
tag
Option<&mut [u8]>
aes
&mut pac::AES
cipher_mode
cipher_mode
encrypt_sel
encrypt_sel
key
&[u8]
iv
&[u8]
aad
&[u8]
ind
&[u8]
outd
&mut [u8]
tag
Option<&mut [u8]>