EncryptAes128Ctr

nn::crypto::EncryptAes128Ctr Function

Syntax

void EncryptAes128Ctr(
     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 + ENCRYPT_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.

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

Use the DecryptAes128Ctr function to decrypt data encrypted by this function.

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

Revision History

2011/10/27
Initial version.

CONFIDENTIAL