#include "xf_security/gcm.hpp"
static void aes128GcmEncrypt ( hls::stream <ap_uint <128>>& payloadStrm, hls::stream <ap_uint <128>>& cipherkeyStrm, hls::stream <ap_uint <96>>& IVStrm, hls::stream <ap_uint <128>>& AADStrm, hls::stream <ap_uint <64>>& lenAADStrm, 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 <128>>& tagStrm, hls::stream <bool>& endTagStrm )
aes128GcmEncrypt is GCM encryption mode with AES-128 single block cipher.
The algorithm reference is : “IEEE Standard for Authenticated Encryption with Length Expansion for Storage Devices” The implementation is modified for better performance.
Parameters:
payloadStrm | Input block stream text to be encrypted. |
cipherkeyStrm | Input cipher key used in encryption. |
IVStrm | Initialization vector stream. |
AADStrm | Additional authenticated data stream. |
lenAADStrm | Length of additional authenticated data in bits. |
lenPldStrm | Length of payload in bits. |
endLenStrm | Flag to signal the end of the length streams. |
cipherStrm | Output encrypted block stream text. |
lenCphStrm | Length of cipher in bits. |
tagStrm | The MAC stream. |
endTagStrm | Flag to signal the end of the MAC stream. |