hu_AuthEncEncryptEnd()

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

Synopsis:

#include "huauthenc.h"
 
int hu_AuthEncEncryptEnd(sb_Context *authEncCtx, size_t macLen, 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 encryption operation. An authenticate encryption context must be destroyed before the corresponding symmetric key object and symmetric key parameters object are destroyed. The MAC computed from the authentication operation will be returned in the supplied buffer.

Returns:

SB_ERR_BAD_CONTEXT

The authEncCtx is of the wrong type.

SB_ERR_NULL_OUTPUT_BUF_LEN

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

SB_ERR_NULL_OUTPUT_BUF

The mac buffer is unexpectedly NULL.

Last modified: 2014-05-14



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

comments powered by Disqus