hu_InitSbg56()

Initializes the module and performs a series of self-tests to ensure the integrity of the module and correct operation of its cryptographic algorithms.

Synopsis:

#include "hugse56.h"
 
int hu_InitSbg56(sb_GlobalCtx sbCtx)

Arguments:

sbCtx

A global context.

Library:

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

Description:

Upon a successful call to this function, the state of the module will be set to SBG56_STATE_ENABLED.

If for any reason the self-tests fail, the state of the module will be set to SBG56_STATE_DISABLED.

This function may only be called if the state of the module is SBG56_STATE_INSTALLED. Calling this function from any other state will result in a SB_FAIL_LIBRARY_ALREADY_INIT error.

Note: This function must be called once to initialize the module before any cryptographic functions are called. It is not re-entrant.

Returns:

SB_FAIL_KAT

The module failed one or more known-answer tests.

SB_FAIL_INTEGRITY

The integrity test failed.

SB_FAIL_LIBRARY_ALREADY_INIT

The module has already been initialized.

SB_FAIL_LIBRARY_DISABLED

The module is disabled and this operation is not allowed.

SB_SUCCESS

Success.