DecryptAndVerify

nn::crypto::CcmDecryptor::DecryptAndVerify Member Function

Syntax

static bool DecryptAndVerify(
     void * pDst,
     size_t dstSize,
     const void * pAdata,
     size_t adataSize,
     const void * pCdata,
     size_t cdataSize,
     const void * pIv,
     size_t ivSize,
     const void * pMac,
     size_t macSize,
     const BlockCipher & c
);

Parameters

Name Description
out pDst Pointer to the buffer storing the decryption results.
in dstSize Size of the buffer pointed to by pDst.
in pAdata Pointer to the buffer storing the Adata.
in adataSize Adata size in bytes.
in pCdata Pointer to the buffer storing the Cdata.
in cdataSize Cdata size in bytes.
in pIv Pointer to the buffer storing the IV.
in ivSize IV size in bytes.
in pMac Pointer to the buffer storing the MAC.
in macSize MAC size in bytes.
in c Instance of the block cipher implementation used in decryption.

Return Values

Returns whether MAC verification succeeded. Returns TRUE if MAC verification succeeded and FALSE otherwise. If TRUE, there is likely no tampering.

Description

Handles batch decryption and verification when in CTR mode.

When all data is loaded into memory, you can call this function to decrypt and verify all of the data at once.

For c, specify the same key used in encryption for the block cipher of the same algorithm used in encryption.

Specify a pointer to an IV object in pIv, and its size in ivSize. You must specify the same IV, adataSize, and macSize values as those used for encryption.

You must specify the same cdataSize value as the pdataSize value used for encryption.

Revision History

2011/10/27
Initial version.

CONFIDENTIAL