hu_AuthEncDecryptEnd()

Destroys an authenticated encryption context object, and verifies the MAC.

Synopsis:

#include "huauthenc.h"
 
int hu_AuthEncDecryptEnd(sb_Context *authEncCtx, size_t macLen, const unsigned char *mac, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

authEncCtx

The AuthEnc context object pointer.

macLen

The length of the mac buffer in bytes. The macLen must match the value supplied in the hu_AuthEncBegin() function.

mac

The mac buffer.

sbCtx

Global context.

Library:

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

Description:

This function must be called to terminate an authenticated decryption operation. An authenticate encryption context must be destroyed before the corresponding symmetric key object and symmetric key parameters object are destroyed. The MAC supplied will be verified.

Returns:

SB_ERR_BAD_CONTEXT

The authEncCtx is of the wrong type.

SB_ERR_NULL_INPUT_BUF_LEN

The macLen parameter does not match the length specified in the hu_AuthEncBegin function.

SB_ERR_NULL_INPUT_BUF

The mac buffer is unexpectedly NULL.

SB_ERR_MAC_INVALID

The value of mac is invalid

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus