Decrypts a ciphertext buffer using the given AES parameters and key.
#include "huaes.h"
int hu_AESDecryptMsg(sb_Params aesParams, sb_Key aesKey, size_t ivLen, const unsigned char *iv, size_t length, const unsigned char *ciphertext, unsigned char *plaintext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The AES parameters object.
The AES key object.
The length (in bytes) of initial vector. The only acceptable value is SB_AES_128_BLOCK_BYTES.
The initial vector.
The length (in bytes) of ciphertext. For ECB, CBC and XTS modes of operation the length must be a multiple of SB_AES_128_BLOCK_BYTES. For XTS mode, the data length shall not exceed the data size that Data Unit Sequence Number can represent. The Data Unit Sequence Number is limited to the value that can be expressed in type size_t.
The ciphertext buffer.
The plaintext buffer.
A global context.
An initial vector is required for the SB_AES_CBC, SB_AES_CFB128, SB_AES_CFB8, SB_AES_OFB128, SB_AES_CTR(ctrBits) and SB_AES_XTS(unitBytes) modes of operation.
For SB_AES_CTR(ctrBits), iv will be used as the initial counter block.
iv is ignored for SB_AES_ECB, as an initial vector is not required for that mode. The plaintext and ciphertext buffers must be the same length, and may overlap in memory subject to the constraints described in the API Reference section on overlapping buffers.
This function should only be called for blocks of plaintext and ciphertext that can be stored entirely in memory.
The aesParams object is NULL.
The tag for the params object is not of the expected type.
The aesKey object is NULL.
The aesKey object is invalid.
iv, the initial vector, is NULL.
ivLen is an invalid vector length.
The ciphertext buffer is NULL.
The ciphertext buffer length, length, is invalid.
The plaintext buffer is NULL.
Success.