hu_DESEncrypt()

Encrypts one or more blocks of plaintext using the given DES context.

Synopsis:

#include "hudes.h"
 
int hu_DESEncrypt(sb_Context desContext, size_t length, const unsigned char *plaintext, unsigned char *ciphertext, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

desContext

A DES context object.

length

The length (in bytes) of plaintext. The acceptable values are multiples of SB_DES_BLOCK_SIZE.

plaintext

The plaintext buffer.

ciphertext

The ciphertext 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 encrypt more blocks of plaintext.

Returns:

SB_ERR_NULL_CONTEXT

The desContext object is NULL.

SB_ERR_BAD_CONTEXT

The desContext object is invalid.

SB_ERR_NULL_INPUT_BUF

The plaintext buffer is NULL.

SB_ERR_BAD_INPUT_BUF_LEN

The length of the plaintext buffer is invalid.

SB_ERR_NULL_OUTPUT_BUF

The ciphertext buffer is NULL.

SB_SUCCESS

Success.