![]() |
Synergy Software Package User's Manual
|
The Crypto Framework layer is composed of multiple Crypto modules providing varied cryptographic services. It includes:
SF_CRYPTO for resource synchronization between the crypto modules.
SF_CRYPTO_TRNG for true random number generation.
SF_CRYPTO_HASH for message digest generation. Provides support for MD5, SHA1, SHA 224, SHA 256 algorithms.
SF_CRYPTO_KEY for Key Generation services. Provides support for AES, ECC and RSA keys.
SF_CRYPTO_CIPHER for encryption and decryption services. Provides support for AES and RSA algorithms.
SF_CRYPTO_SIGNATURE for RSA signature generation and verification services.
SF_CRYPTO_KEY_INSTALLATION for key installation services. Provides support for AES, ECC and RSA keys.
The terms "key wrapping" and "key installation" in the context of SSP are defined as follows:
Key Wrapping: The APIs to generate symmetric keys or asymmetric key pairs on the Synergy platform where the private / secret key is a wrapped key (encrypted key).
Key Installation: User generated private /secret keys on a PC (system outside of the Synergy platform) will be installed (no storage) on the Synergy platform and the wrapped private /secret key returned to the user.
Wrapped keys provide the following advantages:
The Crypto Framework Module defines APIs for a variety of cryptographic services. A complete list of the available APIs, an example API call and a short description of each can be found in the following table. A table of status return values follows the API summary table.
Crypto Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto0.p_api->open(g_sf_crypto0.p_ctrl, g_sf_crypto0.p_cfg);This function is used to open the crypto framework module and the r_sce HAL module. |
| close | g_sf_crypto0.p_api->close(g_sf_crypto0.p_ctrl);This function is used to close the crypto framework module and the r_sce HAL module. |
| lock | g_sf_crypto0.p_api->lock(g_sf_crypto0.p_ctrl);This function locks shared resources for cryptography operations. |
| unlock | g_sf_crypto0.p_api->unlock(g_sf_crypto0.p_ctrl);Unlock shared resources for cryptography operations. |
| getStatus | g_sf_crypto0.p_api->statusGet(g_sf_crypto0.p_ctrl, &p_status);This function gets the status of the Crypto Framework common module. |
| versionGet | g_sf_crypto0.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto HASH Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_hash0.p_api->open(g_sf_crypto_hash0.p_ctrl, g_sf_crypto_hash0.p_cfg);This function is used to open the crypto hash framework module. |
| close | g_sf_crypto_hash0.p_api->close(g_sf_crypto_hash0.p_ctrl);This function is used to close the crypto hash framework module. |
| hashInit | g_sf_crypto_hash0.p_api->hashInit(g_sf_crypto_hash0.p_ctrl);This function initializes the calculation of the hash function. It has to be invoked first and only once, at the beginning of each new calculation. |
| hashUpdate | g_sf_crypto_hash0.p_api->hashUpdate(g_sf_crypto_hash0.p_ctrl, &p_data_in);This function calculates the hash on the data pointed to by the p_data_in pointer. |
| hashFinal | g_sf_crypto_hash0.p_api->hashFinal(g_sf_crypto_hash0.p_ctrl, &p_data_in, &p_size);This function finalizes the hash operation on the data pointed to by the p_data_in pointer and stores the output size in the 32-bit word defined by the p_size pointer. |
| versionGet | g_sf_crypto_hash0.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto TRNG Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_trng0.p_api->open( g_sf_crypto_trng0.p_ctrl, g_sf_crypto_trng0.p_cfg);This function is used to open the Crypto TRNG framework module. |
| close | g_sf_crypto_trng0.p_api->close( g_sf_crypto_trng0.p_ctrl);This function is used to close the Crypto TRNG framework module. |
| randomNumberGenerate | g_sf_crypto_trng0.p_api-> randomNumberGenerate (&p_buffer);This function generates the random number and stores it in memory starting at the address defined by the p_buffer pointer. |
| versionGet | g_sf_crypto_trng0.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto Key Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_key0.p_api->open( g_sf_crypto_key0.p_ctrl, g_sf_crypto_key0.p_cfg);This function is used to open the crypto key framework module. |
| keyGenerate | g_sf_crypto_key0.p_api->keyGenerate( g_sf_crypto_key0.p_ctrl, &p_secret_key, &p_public_key);This function is used to generate a key or key pair and store it at the p_secret_key and p_public_key pointers. |
| EcdhSharedSecretCompute | g_sf_crypto_key0.p_api->EcdhSharedSecretCompute( g_sf_crypto_key0.p_ctrl, &p_local_secret_key, &p_remote_public_key, &p_shared_secret);This function is used to perform ECC scalar multiplication |
| close | g_sf_crypto_key0.p_api->close( g_sf_crypto_key0.p_ctrl);This function is used to close the crypto key framework module and the r_sce HAL module. |
| versionGet | g_sf_crypto_key0.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto Key Installation Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_key_installation.p_api->open( g_sf_crypto_key_installation.p_ctrl, g_sf_crypto_key_installation.p_cfg);This function is used to open the crypto key initialization framework module. |
| keyInstall | g_sf_crypto_key_installation.p_api->keyInstall( g_sf_crypto_key_installation.p_ctrl, p_user_key_input, p_install_key_input, p_key_data_out );This function is used to install a key using the p_user_key_input, p_install_key_input and p_key_data_out pointers. |
| close | g_sf_crypto_key_installation.p_api->close( g_sf_crypto_key_installation.p_ctrl);This function is used to close the crypto key installation framework module. |
| versionGet | g_sf_crypto_key_installation.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto Cipher Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_cipher.p_api->open( g_sf_crypto_cipher.p_ctrl, g_sf_crypto_cipher.p_cfg);This function is used to open the crypto cipher framework module. |
| cipherInit | g_sf_crypto_cipher.p_api->cipherInit( g_sf_crypto_cipher.p_ctrl, mode, p_key, p_params);This function is used to initialize the crypto cipher framework module. |
| signUpdate | g_sf_crypto_cipher.p_api->cipherUpdate( g_sf_crypto_cipher.p_ctrl, p_datain, p_dataout);This function performs the cipher encrypt or decrypt operation. It can be called multiple times on additional blocks of data. Result is placed in p_dataout. |
| cipherFinal | g_sf_crypto_cipher.p_api->cipherFinal( g_sf_crypto_signature.p_ctrl, p_datain, p_dataout);This function performs the final encrypt or decrypt operation. Result is placed in p_dataout. |
| cipherAadUpdate | g_sf_crypto_cipher.p_api->cipherAadUpdate( g_sf_crypto_cipher.p_ctrl, p_aad);This function updates AAD (Additional Authenticated Data) for AES GCM operation using the p_aad pointer to the AAD data and length. It can be called multiple times on additional blocks of data. |
| close | g_sf_crypto_cipher.p_api->close( g_sf_crypto_cipher.p_ctrl);This function is used to close the crypto signature framework module. |
| versionGet | g_sf_crypto_cipher.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
Crypto Signature Framework Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| open | g_sf_crypto_signature.p_api->open( g_sf_crypto_signature.p_ctrl, g_sf_crypto_signature.p_cfg);This function is used to open the crypto signature framework module. |
| contextInit | g_sf_crypto_signature.p_api->contextInit( g_sf_crypto_signature.p_ctrl, mode, p_params, p_key);This function is used to initialize the crypto signature framework module. |
| signUpdate | g_sf_crypto_signature.p_api->signUpdate( g_sf_crypto_signature.p_ctrl, p_message);This function performs the signature update operation. It can be called multiple times to accumulate the message to be signed. |
| verifyUpdate | g_sf_crypto_signature.p_api->verifyUpdate( g_sf_crypto_signature.p_ctrl, p_message);This function performs the signature verification update operation. It can be called multiple times to accumulate the message whose signature is to be verified. |
| signFinal | g_sf_crypto_signature.p_api->signFinal( g_sf_crypto_signature.p_ctrl, p_message, p_dest);This function generates the signature and writes it to the destination. |
| verifyFinal | g_sf_crypto_signature.p_api->verifyFinal( g_sf_crypto_signature.p_ctrl, p_signature, p_message);This function performs the signature verify operation. |
| close | g_sf_crypto_signature.p_api->close( g_sf_crypto_signature.p_ctrl);This function is used to close the crypto signature framework module. |
| versionGet | g_sf_crypto_signature.p_api->versionGet(&version);This function retrieves the API version using the version pointer. |
The Framework APIs return common SSP error codes and in addition may return error codes from low level modules. Crypto Framework specific error codes can be found in the API Reference section for the specific function.
The following notes apply to SF_CRYPTO, SF_CRYPTO_TRNG, SF_CRYPTO_HASH, SF_CRYPTO_KEY, SF_CRYPTO_KEY_INSTALLATION, SF_CRYPTO_CIPHER and SF_CRYPTO_SIGNATURE modules.
Endianness configuration parameter
Alignment for data buffers
Blocking calls
SF CRYPTO Framework Services
VersionGet API
This API can be called at any time, that is, even before a module is opened.
The SF CRYPTO Framework provides a high-level API and is implemented on sf_crypto. The SF CRYPTO Framework provides a foundation for the Framework Crypto services through the Secure Cryptographic Engine (SCE) HAL module.
SF CRYPTO Framework Module Features
SF CRYPTO Framework Module Operational Notes
However, if the application is making a direct call to HAL APIs, use sf_crypto_api_t::lock API just before making the call to HAL module.
Configuration Settings for the SF CRYPTO Framework Module
| Configuration parameter | Description |
|---|---|
| uint32_t wait_option | Wait option for RTOS service calls Defines how the service behaves if there is not enough memory available. The wait options are defined as follows: TX_NO_WAIT (0x00000000) T X_WAIT_FOREVER (0xFFFFFFFF) timeout value (0x00000001 through 0xFFFFFFFE) Selecting TX_NO_WAIT results in an immediate return from this service regardless of whether or not it was successful. This is the only valid option if the service is called from initialization. Selecting TX_WAIT_FOREVER causes the calling thread to suspend indefinitely until enough memory is available. Selecting a numeric value (1-0xFFFFFFFE) specifies the maximum number of timer-ticks to stay suspended while waiting for the memory. Default set through ISDE isTX_WAIT_FOREVER. |
| crypto_instance_t * p_lower_lvl_crypto | Pointer to a low-level Crypto engine HAL driver instance. Configured by Synergy Configurator. |
| void const * p_extend | Extension parameter for hardware specific settings. Configured by Synergy Configurator. |
| void const * p_context | Placeholder for user data. For future expansion. |
| void * p_memory_pool | Byte pool address. Configured by Synergy Configurator. |
| uint32_t memory_pool_size | Byte pool size. Default set by ISDE is 128 bytes. Caller to allocate pool based on the number of SF_CRYPTO_XXX module instances created. Recommended sizes: In addition to the default byte pool:
|
| sf_crypto_close_option_t close_option | Close option Selects how the SCE module can be closed. SF_CRYPTO_CLOSE_OPTION_DEFAULT - Close the module only if none of the other SF_CRYPTO_XXX modules are opened.
|
SF CRYPTO Framework Module Limitations
It is the responsibility of the caller to ensure that the SF CRYPTO module is not closed when any of the other Crypto Framework modules are open.
Using the SF CRYPTO Framework Module in an Application
The typical steps in using the SF CRYPTO Framework module in an application are:
To use the SF CRYPTO module.
open function cannot be called again until the module is closed.The SF CRYPTO TRNG Framework provides a high-level API and is implemented on sf_crypto_trng. The SF CRYPTO TRNG Framework provides True Random Number Generation services through the Secure Cryptographic Engine (SCE) HAL module.
SF CRYPTO TRNG Framework Module Features
Configuration Settings for the SF TRNG CRYPTO Framework Module
| Configuration Parameter | Description |
|---|---|
| sf_crypto_instance_t * p_lower_lvl_common; | Pointer to a low-level Crypto engine HAL driver instance. Configured by Synergy Configurator. |
| trng_instance_t * p_lower_lvl_instance; | Pointer to a TRNG HAL driver instance. Configured by Synergy Configurator. |
| void * p_extend; | Extension parameter for hardware specific settings. For future use. |
The configuration is set through the ISDE for the TRNG HAL driver:
Configuration Parameter for the TRNG HAL Module on r_sce_trng
| Configuration parameter | Description |
|---|---|
| uint32_t num_attempts | Number of attempts within which a true random number is to be generated. Set to 2 by default. |
SF CRYPTO TRNG Framework Module Limitations
None.
The SF CRYPTO HASH Framework provides a high-level API and is implemented on sf_crypto_hash. The SF CRYPTO HASH Framework provides hash/message digest services through the Secure Cryptographic Engine (SCE) HAL module.
The hash functions supported are MD5, SHA-1, SHA-224 and SHA-256.
From FIPS Secure Hash Standard:
All of the algorithms are iterative, one-way hash functions that can process a message to produce a condensed representation called a message digest. These algorithms enable the determination of a message's integrity: any change to the message will, with a very high probability, result in a different message digest. This property is useful in the generation and verification of digital signatures and message authentication codes, and in the generation of random numbers or bits.
For the supported hash functions, the message size should be < 264 bits.
The message digest sizes are as follows:
MD5 : 16 bytes
SHA-1 : 20 bytes
SHA-224: 28 bytes
SHA-256: 32 bytes
SF CRYPTO HASH Framework Module Features
Configuration Settings for the SF CRYPTO HASH Framework Module
| Configuration Parameter | Description |
|---|---|
| sf_crypto_hash_type_t hash_type; | HASH algorithm type. Select MD5, SHA1, SHA 224 or SHA256. See the header file for the definitions. |
| crypto_instance_t * p_lower_lvl_crypto | Pointer to a low-level Crypto engine HAL driver instance. Configured by Synergy Configurator. |
| hash_instance_t * p_lower_lvl_instance; | pointer to HASH lower-level module instance. Configured by ISDE. |
| void * p_extend | Extension parameter for hardware specific settings. Optional. Configured by Synergy Configurator. |
SF CRYPTO HASH Framework Module Limitations
None
The SF CRYPTO KEY Framework provides a high-level API and is implemented on sf_crypto_key. The SF CRYPTO KEY Framework provides cryptographic key generation services through the Secure Cryptographic Engine (SCE) HAL module.
The wrapped keys are often referred to by different names, for example encrypted key, key handle, wrapped key. Key wrapping on Synergy platform is considered secure as those keys cannot be used outside of the platform.
SF CRYPTO KEY Framework Module Features
The following key types can be generated using the services of the SF CRYPTO KEY module:
SF CRYPTO KEY Framework Module Operational Notes
AES Keys
AES wrapped key sizes are as follows:
RSA Keys
The format of RSA plain text keys generated by the keyGenerate API is as follows:
RSA Public key
Byte 0 to Byte 3: Public key exponent
Byte 4 : Start of RSA modulus
(128 bytes for RSA 1024-bit and 256 bytes for RSA 2048-bit keys)
RSA Private key in standard format
Byte 0: Private key exponent (128 bytes for RSA 1024-bit and 256 bytes for RSA 2048-bit keys)
Followed by RSA modulus. (128 bytes for RSA 1024-bit and 256 bytes for RSA 2048-bit keys)
RSA Private key in CRT format
The components are ordered in the following order with exponent2 at byte 0:
exponent2 // the second factor's CRT exponent, a positive integer
prime2 // the second factor, a positive integer
exponent1 // the first factor's CRT exponent, a positive integer
prime1 // the first factor, a positive integer
coefficient // the (first) CRT coefficient, a positive integer
The format of RSA wrapped keys generated by the keyGenerate API is as follows:
RSA Public key is always in plain text.
Byte 0 to Byte 3: Public key exponent
Byte 4 : Start of RSA modulus
(128 bytes for RSA 1024-bit and 256 bytes for RSA 2048-bit keys)
RSA Private key in standard format
Byte 0: Private key exponent is wrapped. (Length is 148 bytes for RSA 1024-bit and 276 bytes for RSA 2048-bit keys)
Followed by RSA modulus in plain text. (Length is 128 bytes for RSA 1024-bit and 256 bytes for RSA 2048-bit keys)
Configuration Settings for the SF CRYPTO KEY Framework Module
| Configuration parameter | Description |
|---|---|
| sf_crypto_key_type_t key_type | Key type to be generated. Plain text or Wrapped keys. See the header file for the definitions. |
| sf_crypto_key_size_t key_size | Key size to be generated. See the header file for the definitions. |
| sf_crypto_data_handle_t domain_params; | Pointer to domain parameters for the requested key type. Structure contains, pointer to the data (contains the domain data) and data length. Structure contains the domain data in the order a||b||p||n for ECC as defined in FIPS186-3 and data length. To be filled appropriately for ECC and set to NULL for RSA and AES Key types, since this parameter only applies to the ECC function. |
| sf_crypto_data_handle_t generator_point | Pointer to the generator base point of curve in the order Gx||Gy for ECC (where Gx and Gy are x and y coordinates respectively) and data length. To be set to NULL for RSA and AES key types. |
| sf_crypto_instance_t * p_lower_lvl_crypto_common | Pointer to a Crypto Framework common instance. Configured by Synergy Configurator. |
| void const * p_extend | Extension parameter for hardware specific settings (Reserved for future use). Configured by Synergy Configurator. |
The SF CRYPTO Signature Framework provides a high-level API and is implemented on sf_crypto_signature. This module is in the SSP framework layer that interfaces with Synergy HAL drivers for the hardware level cryptography operations. The module functions specified herein are used to sign / verify messagethat is provided as input.
SF Crypto Signature Module Features
SF Crypto Signature Framework Module Operational Notes
Configuration Settings for SF CRYPTO Signature Framework Module
| Configuration parameter | Description |
|---|---|
| sf_crypto_key_type_t key_type; | Type of Key RSA plain text or wrapped. See the header file for the definitions. |
| sf_crypto_key_size_t key_size | Size of Key RSA 1024-bit /2048-bit key. See the header file for the definitions. |
| sf_crypto_hash_instance_t * p_lower_lvl_sf_crypto_hash | Pointer to the Crypto Hash framework module instance structure. Configured by Synergy Configurator. |
| sf_crypto_instance_t * p_lower_lvl_crypto_common | Pointer to Crypto Common module instance. Configured by Synergy Configurator. |
| void const * p_extend | Extension parameter for hardware specific settings. Optional. Configured by Synergy Configurator. |
| void const * p_extend | Extension parameter for hardware specific settings (Reserved for future use). Configured by Synergy Configurator. |
SF CRYPTO Signature Framework Module Limitations
None
The SF CRYPTO Cipher Framework provides a high-level API and is implemented on sf_crypto_cipher. This module is in the SSP framework layer and provides encryption and decryption services through the Secure Cryptographic Engine (SCE) HAL module.
SF Crypto Cipher Module Features
AES algorithm support:
RSA algorithm support:
SF Crypto Cipher Framework Module Operational Notes
Configuration Settings for the SF Crypto Cipher Framework Module
| Configuration Parameter | Description |
|---|---|
| sf_crypto_key_type_t key_type | Key type for cipher operation: AES or RSA plain text or wrapped. Please refer to the header file for the definitions. |
| sf_crypto_key_size_t key_size | Key size for cipher operation: AES 128-bit / 192-bit/256-bit key or RSA 1024-bit /2048-bit key. Please refer to the header file for the definitions. |
| sf_crypto_cipher_mode_t cipher_chaining_mode | Applicable only to AES algorithm: ECB, CBC, CTR, XTS or GCM chaining modes Set to ECB for RSA. Please refer to the header file for the definitions. |
| sf_crypto_instance_t * p_lower_lvl_crypto_common | Pointer to Crypto Framework Common module instance. Configured by Synergy Configurator. |
| sf_crypto_trng_instance_t * p_lower_lvl_crypto_trng | Pointer to Crypto Framework TRNG module instance. Configured by Synergy Configurator. |
| void const * p_extend | Extension parameter for hardware specific settings.Optional. Configured by Synergy Configurator. |
SF CRYPTO Cipher Framework Module Limitations
The SF Crypto Key Installation Framework provides a high-level API and is implemented on sf_crypto_key_installation. The SF Crypto Key Installation Framework Key Installation services through the Secure Cryptographic Engine (SCE) HAL module.
SF Crypto Key Installation Framework Module Features
Configuration Settings for the SF Crypto Key Installation Framework Module
| Configuration parameter | Description |
|---|---|
| sf_crypto_key_type_t key_type; | Type of key to be installed. The prepared key will be of the encrypted type. Please refer to the header file for the definitions. |
| sf_crypto_key_size_t key_size; | Size of key to be installed. Please refer to the header file for the definitions. |
| sf_crypto_instance_t * p_lower_lvl_common; | Pointer to a Crypto Framework common instance. Configured by Synergy Configurator. |
| key_installation_instance_t * p_lower_lvl_instance; | Pointer to Crypto Key Install HAL instance Configured by Synergy Configurator. |
| void const * p_extend; | Extension parameter for hardware specific settings. For future use. |
This section describes how to include the Crypto Framework module in an application using the SSP configurator.
To add the Crypto Framework module to an application, simply add it to a HAL /Common thread using the stacks selection sequence given in the following table. (The default name for the Crypto Framework module is g_sf_crypto0. This name can be changed in the associated Properties window.)
Crypto Framework Module Selection Sequence
| Resource | ISDE Tab | Stacks Selection Sequence |
|---|---|---|
| g_sf_crypt0 Crypto Framework on sf_crypto | Threads | New Stack> Framework> Crypto> Crypto Framework on sf_crypto |
| g_sf_crypt_key0 Crypto Key Framework on sf_crypto_key | Threads | New Stack> Framework> Crypto> Crypto Key Framework on sf_crypto_key |
| g_sf_crypt0 Crypto TRNG Framework on sf_crypto_trng | Threads | New Stack> Framework> Crypto> Crypto TRNG Framework |
| g_sf_crypt0 Crypto HASH Framework on sf_crypto_hash | Threads | New Stack> Framework> Crypto> Crypto HASH Framework |
| g_sf_crypt_key0 Crypto Key Installation Framework on sf_crypto_key_installation | Threads | New Stack> Framework> Crypto> Crypto Key Installation Framework on sf_crypto_key_installation |
| g_sf_crypt0 Crypto cipher Framework on sf_crypto_cipher | Threads | New Stack> Framework> Crypto> Crypto cipher Framework |
| g_sf_crypt0 Crypto signature Framework on sf_crypto_signature | Threads | New Stack> Framework> Crypto> Crypto signature Framework |
When the Crypto Framework module on sf_crypto is added to the thread stack as shown in the following figure, the configurator automatically adds any needed lower‑level modules. Any modules needing additional configuration information have the box text highlighted in Red. Modules with a Gray band are individual modules that stand alone. Modules with a Blue band are shared or common; they need only be added once and can be used by multiple stacks. Modules with a Pink band can require the selection of lower-level modules; these are either optional or recommended. (This is indicated in the block with the inclusion of this text.) If the addition of lower-level modules is required, the module description include Add in the text. Clicking on any Pink banded modules brings up the New icon and displays possible choices.
The Crypto Framework module must be configured by the user for the desired operation. The SSP configuration window will automatically identify (by highlighting the block in red) any required configuration selections, such as interrupts or operating modes, which must be configured for lower-level modules in order to ensure successful operation. Furthermore, only those properties that can be changed without causing conflicts are available for modification. Other properties are 'locked' and are not available for changes, and are identified with a lock icon for the 'locked' property in the Properties window in the ISDE. This approach simplifies the configuration process and makes it much less error-prone than previous 'manual' approaches to configuration. The available configuration settings and defaults for all the user-accessible properties are given in the Properties tab within the SSP configurator, and are shown in the following tables for easy reference.
Configuration Settings for the Crypto Framework on sf_crypto
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto0 | Module name. |
| Wait time | TX_WAIT_FOREVER | Value must be a non-negative integer. |
| Byte Pool Size | 128 | Specify the size of the byte pool in bytes. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto will be initialized during startup. |
| Force Closure Support | Default, Force Close Default: Default | Select Force Close to close the crypto module regardless of the status of submodules. |
Configuration Settings for the Crypto HASH Framework on sf_crypto_hash
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Instance Name | g_sf_crypto_hash0 | Module name. |
| Name of generated initialization function | sf_crypto_hash_init0 | Select the name of the generated initialization function. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_hash will be initialized during startup. |
Configuration Settings for the Crypto TRNG Framework on sf_crypto_trng
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto_trng0 | Module name. |
| Name of generated initialization function | sf_crypt_trng_init0 | Select the name of the generated initialization function. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_trng will be initialized during startup. |
Configuration Settings for the Crypto Cipher Framework on sf_crypto_cipher
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto_cipher0 | Module name. |
| Key type | RSA Plain text, RSA CRT Plain text, RSA Wrapped, AES Wrapped, ECC Plain text, ECC Wrapped Default: RSA Plain text | Select the key type. |
| Key size | RSA 1024-bits, RSA 2048-bits, AES 128-bits, AES XTS 128-bits, AES 192-bits, AES 256-bits, AES XTS 256-bits, ECC 192-bits, ECC 256-bits Default: RSA 2048-bits | Select the key size. |
| Cipher chaining mode | ECB, CBC, CTR, GCM, XTS Default: ECB | Select the cipher chaining mode. |
| Name of generated initialization function | sf_crypto_cipher_init0 | Select the name of the generated initialization function. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_cipher will be initialized during startup. |
Configuration Settings for the Crypto Key Framework on sf_crypto_key
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto_key0 | Module name. |
| Key type | RSA Plain text, RSA CRT Plain text, RSA Wrapped, AES Wrapped, ECC Plain text, ECC Wrapped Default: RSA Plain text | Select the key type. For AES, the byte pool size defined in sf_crypto must be >= 280 bytes. |
| Key size | RSA 1024-bits, RSA 2048-bits, AES 128-bits, AES XTS 128-bits, AES 192-bits, AES 256-bits, AES XTS 256-bits, ECC 192-bits, ECC 224-bits, ECC 256-bits, ECC 384-bits Default: RSA 2048-bits | Select the key size. |
| Name of generated initialization function | sf_crypto_key_init0 | Select the name of the generated initialization function. |
| Name of Domain Parameter (Applicable only for ECC) | sf_crypto_key_domain_params0 | Specify the name of the ECC domain partner. |
| Name of Generator Point (Applicable only for ECC) | sf_crypto_key_generator_point0 | Specify the name of the ECC generator point. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_key_will be initialized during startup. |
Configuration Settings for the Crypto Key Installation Framework on sf_crypto_key_installation
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto_key_installation0 | Module name. |
| Key type | Encrypted RSA Key, Encrypted AES Key, Encrypted ECC Key Default: Encrypted RSA Key | Select the key type. |
| Key size | RSA 1024-bits, RSA 2048-bits, AES 128-bits, AES XTS 128-bits, AES 192-bits, AES 256-bits, AES XTS 256-bits, ECC 192-bits, ECC 256-bits Default: RSA 2048-bits | Select the key size. |
| Name of generated initialization function | sf_crypto_key_installation_init0 | Select the name of the generated initialization function. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_key_installation will be initialized during startup. |
Configuration Settings for the Crypto Signature Framework on sf_crypto_signature
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Select if code for parameter checking is to be included in the build. |
| Name | g_sf_crypto_signature0 | Module name. |
| Key type | RSA Plain text, RSA CRT Plain text, RSA Wrapped Default: RSA Plain text | Select the key type. Byte Pool size in sf_crypto must be > = 1450 bytes. |
| Key size | RSA 1024-bits, RSA 2048-bits Default: RSA 2048-bits | Select the key size. |
| Name of generated initialization function | sf_crypto_signature_init0 | Select the name of the generated initialization function. |
| Auto Initialization | Enable, Disable Default: Enable | Select if sf_crypto_signature will be initialized during startup. |
The typical steps in using the SF CRYPTO Framework module in an application are:
To use the SF CRYPTO module.
Using the SF CRYPTO HASH Framework Module in an Application
The typical steps in using the SF CRYPTO HASH Framework module in an application are:
Calling the APIs in this order: sf_crypto_hash_api_t::open -> sf_crypto_hash_api_t::hashInit -> sf_crypto_hash_api_t::hashUpdate -> sf_crypto_hash_api_t::hashFinal -> sf_crypto_hash_api_t::close.
Details:
Using the SF CRYPTO TRNG Framework Module in an Application
The typical steps in using the SF CRYPTO TRNG Framework module in an application are:
Using the SF CRYPTO Cipher Framework Module in an Application
The typical steps in using the SF CRYPTO Cipher Framework module in an application are:
Calling the APIs in this order: sf_crypto_cipher_api_t::open -> sf_crypto_cipher_api_t::cipherInit -> sf_crypto_cipher_api_t::cipherUpdate -> sf_crypto_cipher_api_t::cipherFinal -> sf_crypto_cipher_api_t::close.
Details:
AES GCM operation specifics:
Using the SF CRYPTO KEY Framework Module in an Application
The typical steps in using the SF CRYPTO KEY Framework module in an application are:
Calling the APIs in this order: sf_crypto_key_api_t::open -> sf_crypto_key_api_t::keyGenerate -> sf_crypto_key_api_t::EcdhSharedSecretCompute -> sf_crypto_key_api_t::close.
Details:
Using the SF Crypto Key Installation Framework Module in an Application
The typical steps in using the SF Crypto Key Installation Framework module in an application are:
Calling the APIs in this order: sf_crypto_key_installation_api_t::open -> sf_crypto_key_installation_api_t::keyInstall -> sf_crypto_key_installation_api_t::close.
Details:
Using the SF CRYPTO Signature Framework Module in an Application
The typical steps in using the SF CRYPTO Signature Framework module in an application are:
Calling the APIs in this order: sf_crypto_signature_api_t::open -> sf_crypto_signature_api_t::contextInit -> sf_crypto_signature_api_t::signUpdate -> sf_crypto_signature_api_t::signFinal -> sf_crypto_signature_api_t::close.
Calling the APIs in this order: sf_crypto_signature_api_t::open -> sf_crypto_signature_api_t::contextInit -> sf_crypto_signature_api_t::verifyUpdate -> sf_crypto_signature_api_t::verifyFinal -> sf_crypto_signature_api_t::close.
Details: