EncryptAndGenerateAes128Ccm

nn::crypto::EncryptAndGenerateAes128Ccm Function

Syntax

void EncryptAndGenerateAes128Ccm(
     void * pDst,
     const void * pSrc,
     size_t srcSize,
     const void * pKey
);

Parameters

Name Description
out pDst Pointer to the buffer storing the encryption results. This buffer must be at least as big as srcSize + GENERATE_HEADER_SIZE.
in pSrc Pointer to the buffer storing data to encrypt.
in srcSize Size in bytes of the data to encrypt.
in pKey Pointer to the buffer storing the key. The key is 16 bytes in length.

Return Values

None.

Description

Encrypts and generates data for tampering tests.

Internally generates IV and other elements needed for encryption and uses 128-bit AES in CCM mode to encrypt.

Use the DecryptAndVerifyAes128Ccm function to decrypt and verify data encrypted by this function.

Data encrypted by this function is increased in size by GENERATE_HEADER_SIZE (that is, 32) bytes. Consequently, the buffer pointed to by pDst must be big enough to hold srcSize + GENERATE_HEADER_SIZE bytes of data.

Revision History

2011/10/27
Initial version.

CONFIDENTIAL