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
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | Object is in an incorrect state. |
P6R::eInvalidArg | One of the pointers is NULL or buffer size is zero. |
P6R::eWrongKeyClass | The class of this key is not CKC_SYMMETRIC. |
P6R::eTooBig | pBuffer contains a value too long to fit into an AES counter. |