hu_ARC4DecryptMsg()

Decrypts a ciphertext buffer using the given ARC4 parameters and key.

Synopsis:

#include "huarc4.h"
 
int hu_ARC4DecryptMsg(sb_Params arc4Params, sb_Key arc4Key, size_t length, const unsigned char *ciphertext, unsigned char *plaintext, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

arc4Params

An ARC4 parameters object.

arc4Key

An ARC4 key object.

length

The length (in bytes) of ciphertext.

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:

This function should only be called for buffers of plaintext and ciphertext that can be stored entirely in memory.

Returns:

SB_ERR_NULL_PARAMS

The arc4Params parameters object is NULL.

SB_ERR_BAD_PARAMS

The tag for the params object is not of the expected type.

SB_ERR_NULL_KEY

The arc4Key object is NULL.

SB_ERR_BAD_KEY

The arc4Key object is invalid.

SB_ERR_NULL_INPUT_BUF

The ciphertext buffer is NULL.

SB_ERR_BAD_INPUT_BUF_LEN

The length of the ciphertext buffer is invalid.

SB_ERR_NULL_OUTPUT_BUF

The plaintext buffer is NULL.

SB_SUCCESS

Success.