hu_ARC2Decrypt()

Decrypts one or more blocks of ciphertext using the given ARC2 context.

Synopsis:

#include "huarc2.h"
 
int hu_ARC2Decrypt(sb_Context arc2Context, size_t length, const unsigned char *ciphertext, unsigned char *plaintext, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc2Context

An ARC2 context object.

length

The length (in bytes) of ciphertext. The acceptable values are multiples of SB_ARC2_BLOCK_SIZE.

ciphertext

The ciphertext buffer.

plaintext

The plaintext buffer.

sbCtx

A global context.

Library:

libhuapi (For the qcc command, use the -l huapi option to link against this library)

Description:

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 decrypt more blocks of ciphertext.

Returns:

SB_ERR_NULL_CONTEXT

The arc2Context context object is NULL.

SB_ERR_BAD_CONTEXT

The arc2Context context object is invalid.

SB_ERR_NULL_INPUT_BUF

The ciphertext ciphertext buffer is NULL.

SB_ERR_BAD_INPUT_BUF_LEN

The ciphertext ciphertext buffer length is invalid.

SB_ERR_NULL_OUTPUT_BUF

The plaintext plaintext buffer is NULL.

SB_SUCCESS

Success.