Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ISymmetricCrypto::setAESCounter ( const P6UCHAR pBuffer,
P6UINT32 pcBuffer,
P6AESCOUNTERINC  pfn 
)
pure virtual

Sets a new AES counter value.

RFC 3686 defines the AES counter mode encryption scheme and the format of the AES counter value. The counter block must be 16 bytes long (i.e., the AES block size) and its format is defined by the RFC 3686 "CTRBLK" specification or an application dependent format. This function can be called any number of times during an encryption or decryption.

Parameters
pBuffer[ in ] A pointer to a buffer containing the new counter value to set
pcBuffer[INOUT] The address of an P6UINT32 containing the size in bytes of pBuffer. If eTooBig is returned, then this parameter is assigned the maximum number of bytes that can be assigned to an AES counter.
pfn[ in ] Pointer to a callback function to be invoked each time the AES counter is to be incremented. This parameter can be NULL, in which case a built in funtion implementing the RFC 3686 increment specification is executed.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedObject is in an incorrect state.
P6R::eInvalidArgOne of the pointers is NULL or buffer size is zero.
P6R::eWrongKeyClassThe class of this key is not CKC_SYMMETRIC.
P6R::eTooBigpBuffer contains a value too long to fit into an AES counter.