Encrypts a plaintext buffer using the given ARC2 parameters and key.
#include "huarc2.h"
int hu_ARC2EncryptMsg(sb_Params arc2Params, sb_Key arc2Key, size_t ivLen, const unsigned char *iv, size_t length, const unsigned char *plaintext, unsigned char *ciphertext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An ARC2 parameters object.
An ARC2 key object.
The length (in bytes) of initial vector. The only acceptable value is SB_ARC2_IV_SIZE.
The initial vector.
The length (in bytes) of plaintext. The acceptable values are multiples of SB_ARC2_BLOCK_SIZE.
The plaintext buffer.
The ciphertext buffer.
A global context.
An initial vector, iv, is required for the SB_ARC2_CBC, SB_ARC2_CFB64 and SB_ARC2_OFB64 modes of operation. iv is ignored for SB_ARC2_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 arc2Params parameters object is NULL.
The tag for the params object is not of the expected type.
The arc2Key key object is NULL.
The arc2Key key object is invalid.
The initial vector, iv, is NULL.
ivLen is an invalid initial vector length.
The plaintext plaintext buffer is NULL.
The plaintext plaintext buffer length is invalid.
The ciphertext ciphertext buffer is NULL.
Success.