![]() |
Synergy Software Package User's Manual
|
RTOS-integrated Crypto Key Framework Module. More...
Data Structures | |
| struct | sf_crypto_key_instance_ctrl_t |
Macros | |
| #define | SF_CRYPTO_KEY_CODE_VERSION_MAJOR (2U) |
Functions | |
| ssp_err_t | sf_crypto_key_open_aes (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_cfg_t const *const p_cfg) |
| Subroutine to open a Crypto AES HAL module. This function is called by SF_CRYPTO_KEY_Open(). More... | |
| ssp_err_t | sf_crypto_key_close_aes (sf_crypto_key_instance_ctrl_t *p_ctrl) |
| Subroutine to close a Crypto AES HAL module. This function is called by SF_CRYPTO_KEY_Close(). More... | |
| ssp_err_t | sf_crypto_key_generate_aes (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_t *const p_secret_key) |
| Subroutine to generate a AES key. This function is called by SF_CRYPTO_KEY_Generate(). More... | |
| void | sf_crypto_key_aes_interface_get (sf_crypto_key_instance_ctrl_t *const p_ctrl) |
| Subroutine to get a AES HAL API instance. This function is called by sf_crypto_key_open_aes(). Key framework control block's p_hal_api field is filled with HAL AES interface. This will be set to NULL if the API interface is not found on the particular MCU. More... | |
| void | sf_crypto_key_aes_get_available_api_interface (sf_crypto_key_instance_ctrl_t *const p_ctrl, crypto_interface_get_param_t *p_param) |
| Subroutine to get first available AES HAL API instance for ECB/CBC/CTR/GCM chaining modes. This function is called by sf_crypto_key_aes_interface_get(). Key framework control block's p_hal_api field is filled with HAL AES interface. This will be set to NULL if the API interface is not found on the particular MCU. More... | |
| ssp_err_t | sf_crypto_key_aes_verify_wrappedkey_buffersize (sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (indicates size of the secret AES Wrapped key) is sufficient or not, before proceeding with key Generate function. This function is called by AES Key Generate function before passing request to Crypto HAL Key generate API call. More... | |
| ssp_err_t | sf_crypto_key_aes_verify_wrapped_xtskey_buffersize (sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided num_words (indicates size of the secret AES Wrapped key for XTS AES chaining mode) is sufficient or not, before proceeding with key operations. This function is called by sf_crypto_key_aes_verify_wrappedkey_buffersize as an internal function call. More... | |
| ssp_err_t | sf_crypto_key_open_ecc (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_cfg_t const *const p_cfg) |
| Subroutine to open a Crypto ECC HAL module. This function is called by SF_CRYPTO_KEY_Open(). The configuration parameters are validated before opening the HAL module. More... | |
| ssp_err_t | sf_crypto_key_close_ecc (sf_crypto_key_instance_ctrl_t *p_ctrl) |
| Subroutine to close a Crypto ECC HAL module. This function is called by SF_CRYPTO_KEY_Close(). More... | |
| ssp_err_t | sf_crypto_key_generate_ecc (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_t *const p_secret_key, sf_crypto_key_t *const p_public_key) |
| Subroutine to generate a ECC key. This function is called by SF_CRYPTO_KEY_Generate(). More... | |
| ssp_err_t | sf_crypto_key_scalar_multiplication_ecc (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_t *const p_secret_key, sf_crypto_key_t *const p_point_on_curve, sf_crypto_key_t *const p_resultant_vector) |
| Subroutine to perform a ECC scalar multiplication. This function is called by SF_CRYPTO_KEY_ECDHCompute(). More... | |
| ssp_err_t | sf_crypto_key_open_rsa (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_cfg_t const *const p_cfg) |
| Subroutine to open a Crypto RSA HAL module. This function is called by SF_CRYPTO_KEY_Open(). More... | |
| ssp_err_t | sf_crypto_key_close_rsa (sf_crypto_key_instance_ctrl_t *p_ctrl) |
| Subroutine to close a Crypto RSA HAL module. This function is called by SF_CRYPTO_KEY_Close(). More... | |
| ssp_err_t | sf_crypto_key_generate_rsa (sf_crypto_key_instance_ctrl_t *p_ctrl, sf_crypto_key_t *const p_secret_key, sf_crypto_key_t *const p_public_key) |
| Subroutine to generate a RSA key. This function is called by SF_CRYPTO_KEY_Generate(). More... | |
| void | sf_crypto_key_rsa_interface_get (sf_crypto_key_instance_ctrl_t *const p_ctrl) |
| Subroutine to get a RSA HAL API instance. This function is called by sf_crypto_key_open_rsa(). More... | |
| ssp_err_t | sf_crypto_key_rsa_verify_privatekey_buffersize (sf_crypto_key_type_t key_type, sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA private key) is sufficient or not, before proceeding with key Generate function. This function is called by RSA Key Generate function before passing request to Crypto HAL Key generate API call. More... | |
| ssp_err_t | sf_crypto_key_rsa_verify_publickey_buffersize (sf_crypto_key_type_t key_type, sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Public key) is sufficient or not, before proceeding with key Generate function. This function is called by RSA Key Generate function before passing request to Crypto HAL Key generate API call. More... | |
| ssp_err_t | sf_crypto_key_rsa_verify_plaintext_buffersize (sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Plain text key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call. More... | |
| ssp_err_t | sf_crypto_key_rsa_verify_crtplaintext_buffersize (sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA CRT Plain text key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call. More... | |
| ssp_err_t | sf_crypto_key_rsa_verify_wrapped_buffersize (sf_crypto_key_size_t key_size, uint32_t buffer_length) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Wrapped key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call. More... | |
| ssp_err_t | SF_CRYPTO_KEY_Open (sf_crypto_key_ctrl_t *const p_api_ctrl, sf_crypto_key_cfg_t const *const p_cfg) |
| SSP Crypto KeyFramework Open operation. More... | |
| ssp_err_t | SF_CRYPTO_KEY_Close (sf_crypto_key_ctrl_t *const p_api_ctrl) |
| SSP Crypto Key Framework Close operation. More... | |
| ssp_err_t | SF_CRYPTO_KEY_Generate (sf_crypto_key_ctrl_t *const p_api_ctrl, sf_crypto_key_t *const p_secret_key, sf_crypto_key_t *const p_public_key) |
| SSP Crypto Framework Key Generate operation. More... | |
| ssp_err_t | SF_CRYPTO_KEY_EcdhSharedSecretCompute (sf_crypto_key_ctrl_t *const p_api_ctrl, sf_crypto_key_t *const p_local_secret_key, sf_crypto_key_t *const p_remote_public_key, sf_crypto_key_t *const p_shared_secret) |
| SSP Crypto Framework ECDH Shared Secret Computation operation. More... | |
| ssp_err_t | SF_CRYPTO_KEY_VersionGet (ssp_version_t *const p_version) |
| Gets driver version based on compile time macros. More... | |
RTOS-integrated Crypto Key Framework Module.
| #define SF_CRYPTO_KEY_CODE_VERSION_MAJOR (2U) |
The API version of SSP Crypto Framework
| void sf_crypto_key_aes_get_available_api_interface | ( | sf_crypto_key_instance_ctrl_t *const | p_ctrl, |
| crypto_interface_get_param_t * | p_param | ||
| ) |
Subroutine to get first available AES HAL API instance for ECB/CBC/CTR/GCM chaining modes. This function is called by sf_crypto_key_aes_interface_get(). Key framework control block's p_hal_api field is filled with HAL AES interface. This will be set to NULL if the API interface is not found on the particular MCU.
| [in,out] | p_ctrl | Pointer to a Key framework control block. |
| [in] | p_param | Interface get param. Algorithm type, key type and key size is set by the caller. |
| void sf_crypto_key_aes_interface_get | ( | sf_crypto_key_instance_ctrl_t *const | p_ctrl | ) |
Subroutine to get a AES HAL API instance. This function is called by sf_crypto_key_open_aes(). Key framework control block's p_hal_api field is filled with HAL AES interface. This will be set to NULL if the API interface is not found on the particular MCU.
| [in,out] | p_ctrl | Pointer to a Key framework control block. interface. This indicates NULL, for not supported MCUs |
| ssp_err_t sf_crypto_key_aes_verify_wrapped_xtskey_buffersize | ( | sf_crypto_key_size_t | key_size, |
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided num_words (indicates size of the secret AES Wrapped key for XTS AES chaining mode) is sufficient or not, before proceeding with key operations. This function is called by sf_crypto_key_aes_verify_wrappedkey_buffersize as an internal function call.
| [in] | key_size | Indicates AES key sizes - 128/256-bits, supported chaining mode - XTS |
| [in] | buffer_length | Length of the secret key which shall be filled by AES Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with AES Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of AES |
| ssp_err_t sf_crypto_key_aes_verify_wrappedkey_buffersize | ( | sf_crypto_key_size_t | key_size, |
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (indicates size of the secret AES Wrapped key) is sufficient or not, before proceeding with key Generate function. This function is called by AES Key Generate function before passing request to Crypto HAL Key generate API call.
| [in] | key_size | Indicates AES key sizes - 128/192/256-bits, supported chaining modes - CBC, ECB, GCM, CTR |
| [in] | buffer_length | Length of the secret key which shall be filled by AES Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with AES Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of AES |
| ssp_err_t SF_CRYPTO_KEY_Close | ( | sf_crypto_key_ctrl_t *const | p_api_ctrl | ) |
SSP Crypto Key Framework Close operation.
| SSP_SUCCESS | The module was successfully closed. |
| SSP_ERR_ASSERTION | NULL is passed through the argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
Get a Crypto common control block and the interface.
Check if the Crypto Framework has been opened. If not yet opened, return an error.
Close Crypto HAL module.
Decrement the open counter to enable users to close SF_CRYPTO module.
| ssp_err_t sf_crypto_key_close_aes | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl | ) |
Subroutine to close a Crypto AES HAL module. This function is called by SF_CRYPTO_KEY_Close().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| SSP_SUCCESS | AES HAL module is successfully closed. |
| ssp_err_t sf_crypto_key_close_ecc | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl | ) |
Subroutine to close a Crypto ECC HAL module. This function is called by SF_CRYPTO_KEY_Close().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| SSP_SUCCESS | ECC HAL module is successfully closed. |
Close the Crypto HAL driver.
Release the control block memory back to byte pool
| ssp_err_t sf_crypto_key_close_rsa | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl | ) |
Subroutine to close a Crypto RSA HAL module. This function is called by SF_CRYPTO_KEY_Close().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| SSP_SUCCESS | RSA HAL module is successfully closed. |
| ssp_err_t SF_CRYPTO_KEY_EcdhSharedSecretCompute | ( | sf_crypto_key_ctrl_t *const | p_api_ctrl, |
| sf_crypto_key_t *const | p_local_secret_key, | ||
| sf_crypto_key_t *const | p_remote_public_key, | ||
| sf_crypto_key_t *const | p_shared_secret | ||
| ) |
SSP Crypto Framework ECDH Shared Secret Computation operation.
| SSP_SUCCESS | The module created a key successfully. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
| SSP_ERR_UNSUPPORTED | The module does not support scalar multiplication operation. |
| SSP_ERR_INVALID_SIZE | The length of the buffer supplied for the key to be generated, is insufficient. |
Check if ECDH computation is used with ECC, otherwise return an error.
Check if the Crypto Framework has been opened. If not yet opened, return an error.
Lock the module to access to Crypto HAL module.
Perform the scalar multiplication.
Unlock the module.
| ssp_err_t SF_CRYPTO_KEY_Generate | ( | sf_crypto_key_ctrl_t *const | p_api_ctrl, |
| sf_crypto_key_t *const | p_secret_key, | ||
| sf_crypto_key_t *const | p_public_key | ||
| ) |
SSP Crypto Framework Key Generate operation.
| SSP_SUCCESS | The module created a key successfully. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_NOT_OPEN | The module has yet been opened. Call Open API first. |
| SSP_ERR_UNSUPPORTED | The module does not support the key type specified by user. |
| SSP_ERR_INVALID_SIZE | The length of the buffer supplied for the key to be generated, is insufficient. |
Check if the Crypto Framework has been opened. If not yet opened, return an error.
Lock the module to access to Crypto HAL module.
Generate a key.
Unlock the module.
| ssp_err_t sf_crypto_key_generate_aes | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_t *const | p_secret_key | ||
| ) |
Subroutine to generate a AES key. This function is called by SF_CRYPTO_KEY_Generate().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block. |
| [out] | p_secret_key | Pointer to a secret key. |
| SSP_SUCCESS | The module created the AES Secret key successfully. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key buffer length is not sufficient for the AES Key generation operation. |
| SSP_ERR_UNSUPPORTED | Procedure is not supported for the supplied parameters. |
| ssp_err_t sf_crypto_key_generate_ecc | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_t *const | p_secret_key, | ||
| sf_crypto_key_t *const | p_public_key | ||
| ) |
Subroutine to generate a ECC key. This function is called by SF_CRYPTO_KEY_Generate().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [out] | p_secret_key | Pointer to a secret key |
| [out] | p_public_key | Pointer to a public key |
| SSP_SUCCESS | The module created a key successfully. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key buffer length is not sufficient for the ECC Key generation operation. |
| SSP_ERR_UNSUPPORTED | Procedure is not supported for the supplied parameters. |
Verify the domain parameter input buffer size. The length has to be exactly as specified
Verify the public key buffer size that holds the generated public key.
Verify the secret key buffer size that holds the generated private key.
Local variable created to call the HAL API.
Note that the HAL driver requires data in WORDS
Call Crypto HAL driver.
| ssp_err_t sf_crypto_key_generate_rsa | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_t *const | p_secret_key, | ||
| sf_crypto_key_t *const | p_public_key | ||
| ) |
Subroutine to generate a RSA key. This function is called by SF_CRYPTO_KEY_Generate().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [out] | p_secret_key | Pointer to a secret key |
| [out] | p_public_key | Pointer to a public key |
| SSP_SUCCESS | The module created a key successfully. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key buffer length is not sufficient for the RSA Key generation operation. |
| SSP_ERR_UNSUPPORTED | Procedure is not supported for the supplied parameters. |
| ssp_err_t SF_CRYPTO_KEY_Open | ( | sf_crypto_key_ctrl_t *const | p_api_ctrl, |
| sf_crypto_key_cfg_t const *const | p_cfg | ||
| ) |
SSP Crypto KeyFramework Open operation.
| SSP_SUCCESS | The module was successfully opened. |
| SSP_ERR_ASSERTION | NULL is passed through an argument. |
| SSP_ERR_CRYPTO_COMMON_NOT_OPENED | Crypto Framework Common Module has yet been opened. |
| SSP_ERR_ALREADY_OPEN | The module has been already opened. |
| SSP_ERR_UNSUPPORTED | The module does not support the key type specified by user. |
| SSP_ERR_INVALID_SIZE | The buffer length of one of the configuration parameters is invalid. |
Get a Crypto common control block and the interface.
Check if the Crypto Framework has been opened. If not yet opened, return an error.
Check if the Crypto key framework module has been already opened. If yes, return an error.
Set a key type, size, domain and generator point. Generator point and domain are UNUSED for RSA and AES algorithms, applicable only for ECC.
Open Crypto HAL module.
| ssp_err_t sf_crypto_key_open_aes | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_cfg_t const *const | p_cfg | ||
| ) |
Subroutine to open a Crypto AES HAL module. This function is called by SF_CRYPTO_KEY_Open().
| [in,out] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [in] | p_cfg | Pointer to a Crypto Key Framework module configuration structure |
| SSP_SUCCESS | AES HAL module is successfully opened. |
| SSP_ERR_OUT_OF_MEMORY | Failed to allocate memory to store AES HAL module control block. |
| SSP_ERR_INTERNAL | RTOS service returned a unexpected error. |
| ssp_err_t sf_crypto_key_open_ecc | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_cfg_t const *const | p_cfg | ||
| ) |
Subroutine to open a Crypto ECC HAL module. This function is called by SF_CRYPTO_KEY_Open(). The configuration parameters are validated before opening the HAL module.
| [in,out] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [in,out] | p_cfg | Pointer to a Crypto Key Framework module configuration structure |
| SSP_SUCCESS | ECC HAL module is successfully opened. |
| SSP_ERR_OUT_OF_MEMORY | Failed to allocate memory to store ECC HAL module control block. |
| SSP_ERR_INTERNAL | RTOS service returned a unexpected error. |
Validate the cfg parameters. The key type is already validated.
Verify the key size.
Verify the domain parameter input buffer size. The length has to be exactly as specified
Verify the generator point input buffer size. The length has to be exactly as specified
Get a Crypto common control block and the interface.
Allocate memory for a Crypto HAL control block in the byte pool.
Get a ECC interface instance.
Set Crypto HAL API instance with the control common hardware api.
Open the Crypto HAL module.
| ssp_err_t sf_crypto_key_open_rsa | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_cfg_t const *const | p_cfg | ||
| ) |
Subroutine to open a Crypto RSA HAL module. This function is called by SF_CRYPTO_KEY_Open().
| [in,out] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [in,out] | p_cfg | Pointer to a Crypto Key Framework module configuration structure |
| SSP_SUCCESS | RSA HAL module is successfully opened. |
| SSP_ERR_OUT_OF_MEMORY | Failed to allocate memory to store RSA HAL module control block. |
| SSP_ERR_INTERNAL | RTOS service returned a unexpected error. |
| void sf_crypto_key_rsa_interface_get | ( | sf_crypto_key_instance_ctrl_t *const | p_ctrl | ) |
Subroutine to get a RSA HAL API instance. This function is called by sf_crypto_key_open_rsa().
| [in,out] | p_ctrl | Pointer to a Key framework control block, whose p_hal_api filled with HAL RSA interface. This indicates NULL, for not supported MCUs |
| ssp_err_t sf_crypto_key_rsa_verify_crtplaintext_buffersize | ( | sf_crypto_key_size_t | key_size, |
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA CRT Plain text key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call.
| [in] | key_size | Indicates RSA key size - 1024/2048-bits. |
| [in] | buffer_length | Length of the secret key which shall be filled by RSA Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with RSA Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of RSA. |
| ssp_err_t sf_crypto_key_rsa_verify_plaintext_buffersize | ( | sf_crypto_key_size_t | key_size, |
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Plain text key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call.
| [in] | key_size | Indicates RSA key size - 1024/2048-bits. |
| [in] | buffer_length | Length of the secret key which shall be filled by RSA Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with RSA Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of RSA. |
| ssp_err_t sf_crypto_key_rsa_verify_privatekey_buffersize | ( | sf_crypto_key_type_t | key_type, |
| sf_crypto_key_size_t | key_size, | ||
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA private key) is sufficient or not, before proceeding with key Generate function. This function is called by RSA Key Generate function before passing request to Crypto HAL Key generate API call.
| [in] | key_type | Indicates RSA key type - Plain text/CRT Plain Text/ Wrapped key. |
| [in] | key_size | Indicates RSA key size - 1024/2048-bits. |
| [in] | buffer_length | Length of the secret key which shall be filled by RSA Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with RSA Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of RSA. |
| ssp_err_t sf_crypto_key_rsa_verify_publickey_buffersize | ( | sf_crypto_key_type_t | key_type, |
| sf_crypto_key_size_t | key_size, | ||
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Public key) is sufficient or not, before proceeding with key Generate function. This function is called by RSA Key Generate function before passing request to Crypto HAL Key generate API call.
| [in] | key_type | Indicates RSA key type - Plain text/CRT Plain Text/ Wrapped key. |
| [in] | key_size | Indicates RSA key size - 1024/2048-bits. |
| [in] | buffer_length | Length of the secret key which shall be filled by RSA Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with RSA Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of RSA. |
| ssp_err_t sf_crypto_key_rsa_verify_wrapped_buffersize | ( | sf_crypto_key_size_t | key_size, |
| uint32_t | buffer_length | ||
| ) |
Subroutine to verify that the provided buffer_length (buffer to hold the secret RSA Wrapped key) is sufficient or not, before proceeding with key Generate function. This function is called by sf_crypto_key_rsa_verify_privatekey_buffersize as an internal function call.
| [in] | key_size | Indicates RSA key size - 1024/2048-bits. |
| [in] | buffer_length | Length of the secret key which shall be filled by RSA Key generation algorithm. |
| SSP_SUCCESS | Key length is successful, and proceed with RSA Key Generation. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key length is not sufficient for the Key generation operation of RSA. |
| ssp_err_t sf_crypto_key_scalar_multiplication_ecc | ( | sf_crypto_key_instance_ctrl_t * | p_ctrl, |
| sf_crypto_key_t *const | p_secret_key, | ||
| sf_crypto_key_t *const | p_point_on_curve, | ||
| sf_crypto_key_t *const | p_resultant_vector | ||
| ) |
Subroutine to perform a ECC scalar multiplication. This function is called by SF_CRYPTO_KEY_ECDHCompute().
| [in] | p_ctrl | Pointer to a Crypto Key Framework module control block |
| [in] | p_secret_key | Pointer to a secret key |
| [in] | p_point_on_curve | Pointer to a point specified on the curve. |
| [in] | p_resultant_vector | Pointer to the resultant point on the curve. |
| SSP_SUCCESS | The module created a key successfully. |
| SSP_ERR_INVALID_SIZE | Failed, as the allocated key buffer length is not sufficient for the ECC Key generation operation. |
| SSP_ERR_UNSUPPORTED | Procedure is not supported for the supplied parameters. |
Verify the secret key buffer size that holds the generated private key.
Verify the input buffer size for holding the data, representing point on the curve data.
Verify the output buffer size to hold the resultant data, representing point on the curve.
Local variable created to call the HAL API.
Note that the HAL driver requires data in WORDS
Call Crypto HAL driver.
| ssp_err_t SF_CRYPTO_KEY_VersionGet | ( | ssp_version_t *const | p_version | ) |
Gets driver version based on compile time macros.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |