aes128CcmEncrypt - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_security/ccm.hpp"
template <
    unsigned int _t = 16,
    unsigned int _q = 8
    >
void aes128CcmEncrypt (
    hls::stream <ap_uint <128>>& payloadStrm,
    hls::stream <ap_uint <128>>& cipherkeyStrm,
    hls::stream <ap_uint <8* (15-_q)>>& nonceStrm,
    hls::stream <ap_uint <128>>& ADStrm,
    hls::stream <ap_uint <64>>& lenADStrm,
    hls::stream <ap_uint <64>>& lenPldStrm,
    hls::stream <bool>& endLenStrm,
    hls::stream <ap_uint <128>>& cipherStrm,
    hls::stream <ap_uint <64>>& lenCphStrm,
    hls::stream <ap_uint <8*_t>>& tagStrm,
    hls::stream <bool>& endTagStrm
    )

aes128CcmEncrypt is CCM encryption mode with AES-128 single block cipher.

The algorithm reference is: “Recommendation for Block Cipher Modes of Operation: The CCM Mode for Authentication and Confidentiality” The implementation is modified for better performance.

Parameters:

_t Length of the MAC in byte, t is an element of {4, 6, 8, 10, 12, 14, 16}.
_q Length in byte of the binary representation of the length of the payload in byte, q is an element of {2, 3, 4, 5, 6, 7, 8}.
payloadStrm Input block stream text to be encrypted.
cipherkeyStrm Input cipher key used in encryption.
nonceStrm The nonce stream.
ADStrm Associated data stream.
lenADStrm Length of associated data in byte.
lenPldStrm Length of payload in byte.
endLenStrm Flag to signal the end of the length streams.
cipherStrm Output encrypted block stream text.
lenCphStrm Length of cipher in byte.
tagStrm The MAC stream.
endTagStrm Flag to signal the end of the MAC stream.