DecryptAndVerifyAes128Ccm

nn::crypto::DecryptAndVerifyAes128Ccm Function

Syntax

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

Parameters

Name Description
out pDst Pointer to the buffer storing the decryption results. This buffer must be at least as big as srcSize - GENERATE_HEADER_SIZE.
in pSrc Pointer to the buffer storing the ciphertext.
in srcSize Ciphertext size in bytes.
in pKey Pointer to the buffer storing the key. The key is 16 bytes in length.

Return Values

Returns whether the validity test succeeded. If TRUE, there is likely no tampering. If FALSE, the file has likely been tampered with.

Description

Decrypts and tests for tampering.

Decrypts data encrypted using the EncryptAndGenerateAes128Ccm function, and tests the decrypted data to see if it has been tampered with.

Data decrypted by this function is reduced in size by GENERATE_HEADER_SIZE (that is, 16) 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