#include "xf_security/ccm.hpp"
template < unsigned int _t = 16, unsigned int _q = 8 > void aes256CcmDecrypt ( hls::stream <ap_uint <128>>& payloadStrm, hls::stream <ap_uint <256>>& 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 )
aes256CcmDecrypt is CCM decryption mode with AES-256 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 decrypted. |
cipherkeyStrm | Input cipher key used in decryption. |
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 decrypted block stream text. |
lenCphStrm | Length of cipher in byte. |
tagStrm | The MAC stream. |
endTagStrm | Flag to signal the end of the MAC stream. |