le_iks_aesGcm_common.h
Go to the documentation of this file.
31 //--------------------------------------------------------------------------------------------------35 //--------------------------------------------------------------------------------------------------38 //--------------------------------------------------------------------------------------------------42 //--------------------------------------------------------------------------------------------------46 //--------------------------------------------------------------------------------------------------50 //--------------------------------------------------------------------------------------------------57 //--------------------------------------------------------------------------------------------------61 //--------------------------------------------------------------------------------------------------68 //--------------------------------------------------------------------------------------------------72 //--------------------------------------------------------------------------------------------------79 //--------------------------------------------------------------------------------------------------83 * GCM is an AEAD (Authenticated Encryption with Associated Data) which means that it provides both84 * confidentiality and integrity protection for plaintext data and provides integrity protection for99 * This is especially useful in communication protocols where a packet's payload needs to be secret102 * The AAD and plaintext are optional but they cannot both be omitted. If the AAD is omitted then106 * The ciphertext size is the same as the plaintext size and it is assumed that the ciphertextPtr109 * The tag size is always LE_IKS_AES_GCM_TAG_SIZE bytes and it is assumed that the tagPtr buffer is121 * Repeated nonces in GCM are particularly problematic as they can be used to recover the integrity134 //--------------------------------------------------------------------------------------------------165 //--------------------------------------------------------------------------------------------------196 //--------------------------------------------------------------------------------------------------227 //--------------------------------------------------------------------------------------------------249 * world. This is a critical security requirement but can be difficult to satisfy. Therefore keys260 //--------------------------------------------------------------------------------------------------273 //--------------------------------------------------------------------------------------------------275 * Process a chunk of AAD (Additional Authenticated Data). Either le_iks_aesGcm_StartEncrypt() or276 * le_iks_aesGcm_StartDecrypt() must have been previously called to start either an encryption or289 //--------------------------------------------------------------------------------------------------302 //--------------------------------------------------------------------------------------------------304 * Encrypt a chunk of plaintext. le_iks_aesGcm_StartEncrypt() must have been previously called to316 //--------------------------------------------------------------------------------------------------332 //--------------------------------------------------------------------------------------------------345 //--------------------------------------------------------------------------------------------------358 //--------------------------------------------------------------------------------------------------360 * Starts a process to decrypt and verify the integrity of a long packet with AES in GCM mode. This386 //--------------------------------------------------------------------------------------------------399 //--------------------------------------------------------------------------------------------------401 * Decrypt a chunk of ciphertext. le_iks_aesGcm_StartDecrypt() must have been previously called to413 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------