HSM Functions Reference

The Luna FM SDK package has a number of libraries that are required to use the functionality provided to the FM. This section provides information on these functions and the libraries that provide the function set.

Apart from the functions described in this section, the full set of PKCS#11 functions are also available to the FM. The PKCS#11 functions are described in the Cprov Programmer Manual, and the PKCS#11 standard. The library libfmcprov.a provides the PKCS#11 functions.

The HSM Functions section contains reference material for the following functions:

>Message Streaming Functions

>HIFACE Reply Management Functions

>Functionality Module Dispatch Switcher Functions

>FM Support Functions

>Extensions to the Standard C Library

>Extensions to PKCS#11

>Serial Communication Functions

>High Resolution Timer Functions

>Current Application ID functions

> PKCS#11 State Management Functions

>FM Header Definition Macro

Subset of ISO C99 standard library

The FM SDK supports a subset of the ISO C 99 standard library as defined by ISO/IEC 9899:1999.  In general, floating point math, multibyte character, localization and I/O APIs are not supported.  printf and vprintf are exceptions and are redirected to the logging channel.

In addition to the standard library, C99 language features not present in ANSI C (C89/90) can be used.

The following functions are provided by libfmcrt.a:

assert.h assert

tolower, toupper


printf, sprintf, sscanf, vprintf, vsprintf, snprintf, vsnprintf, vsscanf


va_arg(), va_start(), va_end(), va_copy()


abs, atoi, atol, atoll, bsearch, calloc, div, free, labs, llabs, ldiv, lldiv, malloc,, realloc, strtol, strtoll, strtoull, stroul


memchr, memcmp, memcpy, memmove, memset, strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strrchr, strspn, strstr, strerror, strtok 


asctime, clock, ctime, gmtime, localtime, mktime, strftime, time, difftime, clock, gettime

Unsupported Standard C APIs

The following standard headers and their contained APIs are not supported by the FM SDK:










Request/Reply Message management functions

The following functions are provided by libfmsupt.a:











High Precision Timers



Register Functionality module Custom handler function

The following functions are provided by libfmsupt.a :



Serial communication functions

The following functions are provided by libfmsupt.a :












USB Access functions

NOTE   There is no direct USB support at this time.

Support Functions