Encrypts one or more blocks of plaintext using the given AES context.
#include "huaes.h"
int hu_AESEncrypt(sb_Context aesContext, size_t length, const unsigned char *plaintext, unsigned char *ciphertext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
AES context object.
The length (in bytes) of plaintext. 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 plaintext buffer.
The ciphertext buffer.
A global context.
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 can be called repeatedly to encrypt more blocks of plaintext.
The key associated with aesContext cannot be used for encryption.
The aesContext object is NULL.
The aesContext object is invalid.
The plaintext buffer, plaintext, is NULL.
length, the length of the plaintext buffer, is invalid.
The ciphertext buffer is NULL.
Success.