hu_AuthEncAuthenticate()

Authenticates any provided additional data.

Synopsis:

#include "huauthenc.h"
 
int hu_AuthEncAuthenticate(sb_Context authEncCtx, size_t addDataLen, const unsigned char *addData, sb_GlobalCtx sbCtx)

Arguments:

authEncCtx

Authenticate encryption context object.

addDataLen

The length (in bytes) of additional data. If the mode is SB_CCM_STAR and the macLen specified in hu_authEncBegin() was 0, then addDataLen must be 0.

addData

The additional data buffer.

sbCtx

Global context.

Library:

libhuapi

Description:

This function should be called for any additional data that must be authenticated but not encrypted. This function can be called repeatedly to authenticate more additional data. All additional data must be processed before the hu_AuthEncEncrypt() function is called.

Returns:

SB_ERR_BAD_CONTEXT

The authEncCtx parameter is of the wrong type.

SB_ERR_BAD_LENGTH

The addDataLen parameter violates acceptable values.

SB_ERR_NULL_INPUT_BUF

The addData buffer is unexpectedly NULL.