HAL PKA Functions ¶
Initialization and de-initialization functions ¶
- group PKA_Exported_Functions_Group1
-
This sub-section provides a set of functions allowing to initialize and de-initialize the PKA peripheral:
-
Call the function HAL_PKA_Init() to initialize the HAL PKA handle and associate a PKA peripheral instance.
-
Call the function HAL_PKA_DeInit() to de-initialize the HAL PKA instance by stopping any ongoing process and resetting the state machine.
Functions
-
hal_status_t
HAL_PKA_Init
(
hal_pka_handle_t
*
hpka
,
hal_pka_t
instance
)
¶
-
Initialize the PKA handle and associate physical instance.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
instance – Specify the PKA instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hpka pointer is NULL.
-
HAL_OK – PKA is successfully initialized.
-
-
void
HAL_PKA_DeInit
(
hal_pka_handle_t
*
hpka
)
¶
-
De-initialize the PKA handle by aborting any PKA operation in progress.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
- group PKA_Exported_Functions_Group1
-
This sub-section provides a set of functions allowing to initialize and de-initialize the PKA peripheral:
-
Call the function HAL_PKA_Init() to initialize the HAL PKA handle and associate a PKA peripheral instance.
-
Call the function HAL_PKA_DeInit() to de-initialize the HAL PKA instance by stopping any ongoing process and resetting the state machine.
Functions
-
hal_status_t
HAL_PKA_Init
(
hal_pka_handle_t
*
hpka
,
hal_pka_t
instance
)
-
Initialize the PKA handle and associate physical instance.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
instance – Specify the PKA instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hpka pointer is NULL.
-
HAL_OK – PKA is successfully initialized.
-
-
void
HAL_PKA_DeInit
(
hal_pka_handle_t
*
hpka
)
-
De-initialize the PKA handle by aborting any PKA operation in progress.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
- group PKA_Exported_Functions_Group1
-
This sub-section provides a set of functions allowing to initialize and de-initialize the PKA peripheral:
-
Call the function HAL_PKA_Init() to initialize the HAL PKA handle and associate a PKA peripheral instance.
-
Call the function HAL_PKA_DeInit() to de-initialize the HAL PKA instance by stopping any ongoing process and resetting the state machine.
Functions
-
hal_status_t
HAL_PKA_Init
(
hal_pka_handle_t
*
hpka
,
hal_pka_t
instance
)
-
Initialize the PKA handle and associate physical instance.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
instance – Specify the PKA instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hpka pointer is NULL.
-
HAL_OK – PKA is successfully initialized.
-
-
void
HAL_PKA_DeInit
(
hal_pka_handle_t
*
hpka
)
-
De-initialize the PKA handle by aborting any PKA operation in progress.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
Configuration functions ¶
- group PKA_Exported_Functions_Group2
-
This sub-section provides a set of functions allowing to configure the PKA operations.
PKA Modular exponentiation configuration functions
-
Call the function HAL_PKA_SetConfigModExp() to configure the Modular exponentiation operation.
-
Call the function HAL_PKA_SetConfigModExpFast() to configure the Modular exponentiation (fast) operation.
-
Call the function HAL_PKA_SetConfigModExpProtect() to configure the Modular exponentiation (protected) operation.
PKA arithmetic configuration functions
-
Call the function HAL_PKA_SetConfigAdd() to configure the Arithmetic addition operation.
-
Call the function HAL_PKA_SetConfigSub() to configure the Arithmetic subtraction operation.
-
Call the function HAL_PKA_SetConfigCmp() to configure the Arithmetic comparison operation.
-
Call the function HAL_PKA_SetConfigMul() to configure the Arithmetic multiplication operation.
-
Call the function HAL_PKA_SetConfigModAdd() to configure the Modular addition operation.
-
Call the function HAL_PKA_SetConfigModSub() to configure the Modular subtraction operation.
-
Call the function HAL_PKA_SetConfigModInv() to configure the Modular inversion operation.
-
Call the function HAL_PKA_SetConfigModRed() to configure the Modular reduction operation.
-
Call the function HAL_PKA_SetConfigMontgomeryMul() to configure the Montgomery multiplication operation.
-
Call the function HAL_PKA_SetConfigMontgomery() to configure the Montgomery parameter operation.
PKA RSA configuration functions
-
Call the function HAL_PKA_RSA_SetConfigCRTExp() to configure the RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_SetConfigSignature() to configure the RSA signature operation.
-
Call the function HAL_PKA_RSA_SetConfigVerifSignature() to configure the RSA verification operation.
PKA ECDSA configuration functions
-
Call the function HAL_PKA_ECDSA_SetConfigSignature() to configure the elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_SetConfigVerifSignature() to configure the elliptic curves over prime fields verification operation.
PKA ECC configuration functions
-
Call the function HAL_PKA_ECC_SetConfigPointCheck() to configure the Point on elliptic curve check operation.
-
Call the function HAL_PKA_ECC_SetConfigMul() to configure the ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_SetConfigDoubleBaseLadder() to configure the ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_SetConfigProjectiveToAffine() to configure the ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_SetConfigCompleteAdd() to configure the ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_SetConfigModExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_config_t
*
p_config
)
¶
-
Set the Modular exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpFast
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_fast_config_t
*
p_config
)
¶
-
Set the Modular exponentiation (fast) Mode configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_fast_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (fast) is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpProtect
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_protect_config_t
*
p_config
)
¶
-
Set the Modular exponentiation (protected) configuration. Useful when a secret information is involved (RSA decryption).
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_protect_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (protected) is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_signature_config_t
*
p_config
)
¶
-
Set the message signature configuration using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Signature of a message is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_verif_config_t
*
p_config
)
¶
-
Set the configuration for verifying the validity of a signature using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigCRTExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_crt_exp_config_t
*
p_config
)
¶
-
Set the RSA CRT exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_crt_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_signature_config_t
*
p_config
)
¶
-
Set the message signature configuration using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_verif_config_t
*
p_config
)
¶
-
Set the configuration for verifying the validity of a signature using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_add_config_t
*
p_config
)
¶
-
Set Arithmetic Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_sub_config_t
*
p_config
)
¶
-
Set Arithmetic subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigCmp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_cmp_config_t
*
p_config
)
¶
-
Set comparison Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_cmp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Comparison is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mul_config_t
*
p_config
)
¶
-
Set Arithmetic multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_add_config_t
*
p_config
)
¶
-
Set Modular Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_sub_config_t
*
p_config
)
¶
-
Set Modular subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModInv
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_inv_config_t
*
p_config
)
¶
-
Set Modular Inversion Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_inv_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Inversion is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModRed
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_red_config_t
*
p_config
)
¶
-
Set the Modular Reduction configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_red_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular reduction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_mul_config_t
*
p_config
)
¶
-
Set Montgomery multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomery
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_config_t
*
p_config
)
¶
-
Set Montgomery parameter Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery parameter is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigPointCheck
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_point_check_config_t
*
p_config
)
¶
-
Set Point on elliptic curve check configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_point_check_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Point on elliptic curve check is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_mul_config_t
*
p_config
)
¶
-
Set the ECC scalar multiplication configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC scalar multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_double_base_ladder_config_t
*
p_config
)
¶
-
Set ECC double base ladder Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_double_base_ladder_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC double base ladder is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_projective_to_affine_config_t
*
p_config
)
¶
-
Set ECC projective to affine Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_projective_to_affine_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC projective to affine is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigCompleteAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_complete_add_config_t
*
p_config
)
¶
-
Set ECC complete addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle..
-
p_config – Pointer to hal_pka_ecc_complete_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC complete addition is successfully configured.
-
-
- group PKA_Exported_Functions_Group2
-
This sub-section provides a set of functions allowing to configure the PKA operations.
PKA Modular exponentiation configuration functions
-
Call the function HAL_PKA_SetConfigModExp() to configure the Modular exponentiation operation.
-
Call the function HAL_PKA_SetConfigModExpFast() to configure the Modular exponentiation (fast) operation.
-
Call the function HAL_PKA_SetConfigModExpProtect() to configure the Modular exponentiation (protected) operation.
PKA arithmetic configuration functions
-
Call the function HAL_PKA_SetConfigAdd() to configure the Arithmetic addition operation.
-
Call the function HAL_PKA_SetConfigSub() to configure the Arithmetic subtraction operation.
-
Call the function HAL_PKA_SetConfigCmp() to configure the Arithmetic comparison operation.
-
Call the function HAL_PKA_SetConfigMul() to configure the Arithmetic multiplication operation.
-
Call the function HAL_PKA_SetConfigModAdd() to configure the Modular addition operation.
-
Call the function HAL_PKA_SetConfigModSub() to configure the Modular subtraction operation.
-
Call the function HAL_PKA_SetConfigModInv() to configure the Modular inversion operation.
-
Call the function HAL_PKA_SetConfigModRed() to configure the Modular reduction operation.
-
Call the function HAL_PKA_SetConfigMontgomeryMul() to configure the Montgomery multiplication operation.
-
Call the function HAL_PKA_SetConfigMontgomery() to configure the Montgomery parameter operation.
PKA RSA configuration functions
-
Call the function HAL_PKA_RSA_SetConfigCRTExp() to configure the RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_SetConfigSignature() to configure the RSA signature operation.
-
Call the function HAL_PKA_RSA_SetConfigVerifSignature() to configure the RSA verification operation.
PKA ECDSA configuration functions
-
Call the function HAL_PKA_ECDSA_SetConfigSignature() to configure the elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_SetConfigVerifSignature() to configure the elliptic curves over prime fields verification operation.
PKA ECC configuration functions
-
Call the function HAL_PKA_ECC_SetConfigPointCheck() to configure the Point on elliptic curve check operation.
-
Call the function HAL_PKA_ECC_SetConfigMul() to configure the ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_SetConfigDoubleBaseLadder() to configure the ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_SetConfigProjectiveToAffine() to configure the ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_SetConfigCompleteAdd() to configure the ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_SetConfigModExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_config_t
*
p_config
)
-
Set the Modular exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpFast
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_fast_config_t
*
p_config
)
-
Set the Modular exponentiation (fast) Mode configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_fast_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (fast) is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpProtect
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_protect_config_t
*
p_config
)
-
Set the Modular exponentiation (protected) configuration. Useful when a secret information is involved (RSA decryption).
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_protect_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (protected) is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_signature_config_t
*
p_config
)
-
Set the message signature configuration using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Signature of a message is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_verif_config_t
*
p_config
)
-
Set the configuration for verifying the validity of a signature using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigCRTExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_crt_exp_config_t
*
p_config
)
-
Set the RSA CRT exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_crt_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_signature_config_t
*
p_config
)
-
Set the message signature configuration using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_verif_config_t
*
p_config
)
-
Set the configuration for verifying the validity of a signature using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_add_config_t
*
p_config
)
-
Set Arithmetic Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_sub_config_t
*
p_config
)
-
Set Arithmetic subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigCmp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_cmp_config_t
*
p_config
)
-
Set comparison Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_cmp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Comparison is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mul_config_t
*
p_config
)
-
Set Arithmetic multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_add_config_t
*
p_config
)
-
Set Modular Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_sub_config_t
*
p_config
)
-
Set Modular subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModInv
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_inv_config_t
*
p_config
)
-
Set Modular Inversion Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_inv_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Inversion is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModRed
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_red_config_t
*
p_config
)
-
Set the Modular Reduction configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_red_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular reduction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_mul_config_t
*
p_config
)
-
Set Montgomery multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomery
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_config_t
*
p_config
)
-
Set Montgomery parameter Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery parameter is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigPointCheck
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_point_check_config_t
*
p_config
)
-
Set Point on elliptic curve check configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_point_check_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Point on elliptic curve check is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_mul_config_t
*
p_config
)
-
Set the ECC scalar multiplication configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC scalar multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_double_base_ladder_config_t
*
p_config
)
-
Set ECC double base ladder Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_double_base_ladder_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC double base ladder is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_projective_to_affine_config_t
*
p_config
)
-
Set ECC projective to affine Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_projective_to_affine_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC projective to affine is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigCompleteAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_complete_add_config_t
*
p_config
)
-
Set ECC complete addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle..
-
p_config – Pointer to hal_pka_ecc_complete_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC complete addition is successfully configured.
-
-
- group PKA_Exported_Functions_Group2
-
This sub-section provides a set of functions allowing to configure the PKA operations.
PKA Modular exponentiation configuration functions
-
Call the function HAL_PKA_SetConfigModExp() to configure the Modular exponentiation operation.
-
Call the function HAL_PKA_SetConfigModExpFast() to configure the Modular exponentiation (fast) operation.
-
Call the function HAL_PKA_SetConfigModExpProtect() to configure the Modular exponentiation (protected) operation.
PKA arithmetic configuration functions
-
Call the function HAL_PKA_SetConfigAdd() to configure the Arithmetic addition operation.
-
Call the function HAL_PKA_SetConfigSub() to configure the Arithmetic subtraction operation.
-
Call the function HAL_PKA_SetConfigCmp() to configure the Arithmetic comparison operation.
-
Call the function HAL_PKA_SetConfigMul() to configure the Arithmetic multiplication operation.
-
Call the function HAL_PKA_SetConfigModAdd() to configure the Modular addition operation.
-
Call the function HAL_PKA_SetConfigModSub() to configure the Modular subtraction operation.
-
Call the function HAL_PKA_SetConfigModInv() to configure the Modular inversion operation.
-
Call the function HAL_PKA_SetConfigModRed() to configure the Modular reduction operation.
-
Call the function HAL_PKA_SetConfigMontgomeryMul() to configure the Montgomery multiplication operation.
-
Call the function HAL_PKA_SetConfigMontgomery() to configure the Montgomery parameter operation.
PKA RSA configuration functions
-
Call the function HAL_PKA_RSA_SetConfigCRTExp() to configure the RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_SetConfigSignature() to configure the RSA signature operation.
-
Call the function HAL_PKA_RSA_SetConfigVerifSignature() to configure the RSA verification operation.
PKA ECDSA configuration functions
-
Call the function HAL_PKA_ECDSA_SetConfigSignature() to configure the elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_SetConfigVerifSignature() to configure the elliptic curves over prime fields verification operation.
PKA ECC configuration functions
-
Call the function HAL_PKA_ECC_SetConfigPointCheck() to configure the Point on elliptic curve check operation.
-
Call the function HAL_PKA_ECC_SetConfigMul() to configure the ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_SetConfigDoubleBaseLadder() to configure the ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_SetConfigProjectiveToAffine() to configure the ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_SetConfigCompleteAdd() to configure the ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_SetConfigModExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_config_t
*
p_config
)
-
Set the Modular exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpFast
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_fast_config_t
*
p_config
)
-
Set the Modular exponentiation (fast) Mode configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_fast_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (fast) is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModExpProtect
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_exp_protect_config_t
*
p_config
)
-
Set the Modular exponentiation (protected) configuration. Useful when a secret information is involved (RSA decryption).
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_exp_protect_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular exponentiation (protected) is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_signature_config_t
*
p_config
)
-
Set the message signature configuration using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Signature of a message is successfully configured.
-
-
hal_status_t
HAL_PKA_ECDSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecdsa_verif_config_t
*
p_config
)
-
Set the configuration for verifying the validity of a signature using elliptic curves over prime fields.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecdsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigCRTExp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_crt_exp_config_t
*
p_config
)
-
Set the RSA CRT exponentiation configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_crt_exp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_signature_config_t
*
p_config
)
-
Set the message signature configuration using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_signature_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – RSA CRT exponentiation is successfully configured.
-
-
hal_status_t
HAL_PKA_RSA_SetConfigVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_rsa_verif_config_t
*
p_config
)
-
Set the configuration for verifying the validity of a signature using RSA CRT exponentiation.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_rsa_verif_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – The verification of signature validity is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_add_config_t
*
p_config
)
-
Set Arithmetic Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_sub_config_t
*
p_config
)
-
Set Arithmetic subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigCmp
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_cmp_config_t
*
p_config
)
-
Set comparison Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_cmp_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Comparison is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mul_config_t
*
p_config
)
-
Set Arithmetic multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Arithmetic multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_add_config_t
*
p_config
)
-
Set Modular Addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Addition is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModSub
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_sub_config_t
*
p_config
)
-
Set Modular subtraction Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_sub_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular subtraction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModInv
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_inv_config_t
*
p_config
)
-
Set Modular Inversion Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_inv_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular Inversion is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigModRed
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_mod_red_config_t
*
p_config
)
-
Set the Modular Reduction configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_mod_red_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Modular reduction is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_mul_config_t
*
p_config
)
-
Set Montgomery multiplication Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_SetConfigMontgomery
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_montgomery_config_t
*
p_config
)
-
Set Montgomery parameter Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_montgomery_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Montgomery parameter is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigPointCheck
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_point_check_config_t
*
p_config
)
-
Set Point on elliptic curve check configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_point_check_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – Point on elliptic curve check is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigMul
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_mul_config_t
*
p_config
)
-
Set the ECC scalar multiplication configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_mul_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC scalar multiplication is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_double_base_ladder_config_t
*
p_config
)
-
Set ECC double base ladder Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_double_base_ladder_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC double base ladder is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_projective_to_affine_config_t
*
p_config
)
-
Set ECC projective to affine Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_config – Pointer to hal_pka_ecc_projective_to_affine_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC projective to affine is successfully configured.
-
-
hal_status_t
HAL_PKA_ECC_SetConfigCompleteAdd
(
hal_pka_handle_t
*
hpka
,
const
hal_pka_ecc_complete_add_config_t
*
p_config
)
-
Set ECC complete addition Configuration.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle..
-
p_config – Pointer to hal_pka_ecc_complete_add_config_t configuration structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when p_config pointer is NULL.
-
HAL_ERROR – PKA is not correctly initialized.
-
HAL_OK – ECC complete addition is successfully configured.
-
-
Process management functions ¶
- group PKA_Exported_Functions_Group3
-
This sub-section provides a set of functions allowing to manage the calculation data for an operation.
PKA calculating process functions
-
Call the function HAL_PKA_Compute() to start the computation in blocking mode.
-
Call the function HAL_PKA_Compute_IT() to start the computation in interrupt mode.
-
Call the function HAL_PKA_IRQHandler() to handle PKA event interrupt request.
-
Call the function HAL_PKA_Abort() to abort any ongoing operation.
PKA Modular exponentiation result functions
-
Call the function HAL_PKA_GetResultModExp() to retrieve the result of the Modular exponentiation operation.
-
Call the function HAL_PKA_GetResultModExpFast() to retrieve the result of the Modular exponentiation (Fast) operation.
-
Call the function HAL_PKA_GetResultModExpProtected() to retrieve the result of the Modular exponentiation (Protected) operation.
PKA arithmetic result functions
-
Call the function HAL_PKA_GetResultAdd() to retrieve the result of the Addition operation.
-
Call the function HAL_PKA_GetResultSub() to retrieve the result of the subtraction operation.
-
Call the function HAL_PKA_GetResultMul() to retrieve the result of the multiplication operation.
-
Call the function HAL_PKA_GetResultCmp() to retrieve the result of the comparison operation.
-
Call the function HAL_PKA_GetResultModAdd() to retrieve the result of the Modular Addition operation.
-
Call the function HAL_PKA_GetResultModSub() to retrieve the result of the Modular subtraction operation.
-
Call the function HAL_PKA_GetResultModInv() to retrieve the result of the Modular Inversion operation.
-
Call the function HAL_PKA_GetResultModRed() to retrieve the result of the Modular Reduction operation.
-
Call the function HAL_PKA_GetResultMontgomeryMul() to retrieve the result of the Montgomery parameter operation.
-
Call the function HAL_PKA_GetResultMontgomery() to retrieve the result of Montgomery parameter operation.
PKA RSA result functions
-
Call the function HAL_PKA_RSA_GetResultCRTExp() to retrieve the result of RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_GetResultSignature() to retrieve the result of the RSA signature operation.
-
Call the function HAL_PKA_RSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECDSA result functions
-
Call the function HAL_PKA_ECDSA_GetResultSignature() to retrieve the result of elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECC result functions
-
Call the function HAL_PKA_ECC_IsPointCheckOnCurve() to check if the point is on curve or not.
-
Call the function HAL_PKA_ECC_GetResultMul() to retrieve the result of ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_GetResultDoubleBaseLadder() to retrieve the result of ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_GetResultProjectiveToAffine() to retrieve the result of ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_GetResultCompleteAdd() to retrieve the result of ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_Compute
(
hal_pka_handle_t
*
hpka
,
uint32_t
timeout_ms
)
¶
-
Generic function to start a PKA operation in blocking mode.
- Parameters :
-
-
hpka – PKA handle.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer or timeout_ms are NULL.
-
HAL_TIMEOUT – In case of user timeout.
-
HAL_ERROR – PKA error is occurred.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
hal_status_t
HAL_PKA_Compute_IT
(
hal_pka_handle_t
*
hpka
)
¶
-
Generic function to start a PKA operation in non-blocking mode with interrupt.
- Parameters :
-
hpka – PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
void
HAL_PKA_IRQHandler
(
hal_pka_handle_t
*
hpka
)
¶
-
This function handles PKA event interrupt request.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_Abort
(
hal_pka_handle_t
*
hpka
)
¶
-
Abort any ongoing operation.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_OK – Operation is successfully aborted.
-
-
uint32_t
HAL_PKA_GetResultModExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpFast
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular exponentiation (Fast) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpProtected
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular exponentiation (Protected) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECDSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecdsa_signature_result_t
*
p_result
,
hal_pka_ecdsa_signature_result_ext_config_t
*
p_result_ext
)
¶
-
Retrieve ECDSA signaure operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecdsa_signature_result_t result structure.
-
p_result_ext – Pointer to hal_pka_ecdsa_signature_result_ext_config_t structure (optional).
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
hal_pka_ecdsa_signature_status_t
HAL_PKA_ECDSA_IsValidVerifSignature
(
const
hal_pka_handle_t
*
hpka
)
¶
-
Retrieve ECDSA verification signature result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECDSA_SIGNATURE_VALID – Signature validated.
-
PKA_ECDSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultCRTExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve RSA CRT exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve RSA signature operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_rsa_signature_status_t
HAL_PKA_RSA_IsValidVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
uint8_t
*
p_hash
)
¶
-
Retrieve RSA verification signature result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_hash – Pointer to hashed message provided by the user.
-
- Return values :
-
-
PKA_RSA_SIGNATURE_VALID – Signature validated.
-
PKA_RSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultCmp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve comparison operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
PKA_CMP_RESULT_SIZE – Size of the comparison result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModRed
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular Reduction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModInv
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Modular Inversion operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Montgomery multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomery
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
¶
-
Retrieve Montgomery parameter operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_ecc_point_status_t
HAL_PKA_ECC_IsPointCheckOnCurve
(
const
hal_pka_handle_t
*
hpka
)
¶
-
Retrieve Point on elliptic curve check operation result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECC_POINT_ON_CURVE – ECC point is on curve.
-
PKA_ECC_POINT_NOT_ON_CURVE – In case of ECC point is not on curve or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultMul
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_mul_result_t
*
p_result
)
¶
-
Retrieve ECC scalar multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_mul_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_double_base_ladder_result_t
*
p_result
)
¶
-
Retrieve ECC double base ladder operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_double_base_ladder_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_projective_to_affine_result_t
*
p_result
)
¶
-
Retrieve ECC projective to affine operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_projective_to_affine_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultCompleteAdd
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_complete_add_result_t
*
p_result
)
¶
-
Retrieve ECC complete addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_complete_add_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
- group PKA_Exported_Functions_Group3
-
This sub-section provides a set of functions allowing to manage the calculation data for an operation.
PKA calculating process functions
-
Call the function HAL_PKA_Compute() to start the computation in blocking mode.
-
Call the function HAL_PKA_Compute_IT() to start the computation in interrupt mode.
-
Call the function HAL_PKA_IRQHandler() to handle PKA event interrupt request.
-
Call the function HAL_PKA_Abort() to abort any ongoing operation.
PKA Modular exponentiation result functions
-
Call the function HAL_PKA_GetResultModExp() to retrieve the result of the Modular exponentiation operation.
-
Call the function HAL_PKA_GetResultModExpFast() to retrieve the result of the Modular exponentiation (Fast) operation.
-
Call the function HAL_PKA_GetResultModExpProtected() to retrieve the result of the Modular exponentiation (Protected) operation.
PKA arithmetic result functions
-
Call the function HAL_PKA_GetResultAdd() to retrieve the result of the Addition operation.
-
Call the function HAL_PKA_GetResultSub() to retrieve the result of the subtraction operation.
-
Call the function HAL_PKA_GetResultMul() to retrieve the result of the multiplication operation.
-
Call the function HAL_PKA_GetResultCmp() to retrieve the result of the comparison operation.
-
Call the function HAL_PKA_GetResultModAdd() to retrieve the result of the Modular Addition operation.
-
Call the function HAL_PKA_GetResultModSub() to retrieve the result of the Modular subtraction operation.
-
Call the function HAL_PKA_GetResultModInv() to retrieve the result of the Modular Inversion operation.
-
Call the function HAL_PKA_GetResultModRed() to retrieve the result of the Modular Reduction operation.
-
Call the function HAL_PKA_GetResultMontgomeryMul() to retrieve the result of the Montgomery parameter operation.
-
Call the function HAL_PKA_GetResultMontgomery() to retrieve the result of Montgomery parameter operation.
PKA RSA result functions
-
Call the function HAL_PKA_RSA_GetResultCRTExp() to retrieve the result of RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_GetResultSignature() to retrieve the result of the RSA signature operation.
-
Call the function HAL_PKA_RSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECDSA result functions
-
Call the function HAL_PKA_ECDSA_GetResultSignature() to retrieve the result of elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECC result functions
-
Call the function HAL_PKA_ECC_IsPointCheckOnCurve() to check if the point is on curve or not.
-
Call the function HAL_PKA_ECC_GetResultMul() to retrieve the result of ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_GetResultDoubleBaseLadder() to retrieve the result of ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_GetResultProjectiveToAffine() to retrieve the result of ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_GetResultCompleteAdd() to retrieve the result of ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_Compute
(
hal_pka_handle_t
*
hpka
,
uint32_t
timeout_ms
)
-
Generic function to start a PKA operation in blocking mode.
- Parameters :
-
-
hpka – PKA handle.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer or timeout_ms are NULL.
-
HAL_TIMEOUT – In case of user timeout.
-
HAL_ERROR – PKA error is occurred.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
hal_status_t
HAL_PKA_Compute_IT
(
hal_pka_handle_t
*
hpka
)
-
Generic function to start a PKA operation in non-blocking mode with interrupt.
- Parameters :
-
hpka – PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
void
HAL_PKA_IRQHandler
(
hal_pka_handle_t
*
hpka
)
-
This function handles PKA event interrupt request.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_Abort
(
hal_pka_handle_t
*
hpka
)
-
Abort any ongoing operation.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_OK – Operation is successfully aborted.
-
-
uint32_t
HAL_PKA_GetResultModExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpFast
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation (Fast) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpProtected
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation (Protected) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECDSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecdsa_signature_result_t
*
p_result
,
hal_pka_ecdsa_signature_result_ext_config_t
*
p_result_ext
)
-
Retrieve ECDSA signaure operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecdsa_signature_result_t result structure.
-
p_result_ext – Pointer to hal_pka_ecdsa_signature_result_ext_config_t structure (optional).
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
hal_pka_ecdsa_signature_status_t
HAL_PKA_ECDSA_IsValidVerifSignature
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve ECDSA verification signature result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECDSA_SIGNATURE_VALID – Signature validated.
-
PKA_ECDSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultCRTExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve RSA CRT exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve RSA signature operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_rsa_signature_status_t
HAL_PKA_RSA_IsValidVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
uint8_t
*
p_hash
)
-
Retrieve RSA verification signature result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_hash – Pointer to hashed message provided by the user.
-
- Return values :
-
-
PKA_RSA_SIGNATURE_VALID – Signature validated.
-
PKA_RSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultCmp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve comparison operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
PKA_CMP_RESULT_SIZE – Size of the comparison result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModRed
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Reduction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModInv
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Inversion operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Montgomery multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomery
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Montgomery parameter operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_ecc_point_status_t
HAL_PKA_ECC_IsPointCheckOnCurve
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve Point on elliptic curve check operation result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECC_POINT_ON_CURVE – ECC point is on curve.
-
PKA_ECC_POINT_NOT_ON_CURVE – In case of ECC point is not on curve or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultMul
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_mul_result_t
*
p_result
)
-
Retrieve ECC scalar multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_mul_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_double_base_ladder_result_t
*
p_result
)
-
Retrieve ECC double base ladder operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_double_base_ladder_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_projective_to_affine_result_t
*
p_result
)
-
Retrieve ECC projective to affine operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_projective_to_affine_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultCompleteAdd
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_complete_add_result_t
*
p_result
)
-
Retrieve ECC complete addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_complete_add_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
- group PKA_Exported_Functions_Group3
-
This sub-section provides a set of functions allowing to manage the calculation data for an operation.
PKA calculating process functions
-
Call the function HAL_PKA_Compute() to start the computation in blocking mode.
-
Call the function HAL_PKA_Compute_IT() to start the computation in interrupt mode.
-
Call the function HAL_PKA_IRQHandler() to handle PKA event interrupt request.
-
Call the function HAL_PKA_Abort() to abort any ongoing operation.
PKA Modular exponentiation result functions
-
Call the function HAL_PKA_GetResultModExp() to retrieve the result of the Modular exponentiation operation.
-
Call the function HAL_PKA_GetResultModExpFast() to retrieve the result of the Modular exponentiation (Fast) operation.
-
Call the function HAL_PKA_GetResultModExpProtected() to retrieve the result of the Modular exponentiation (Protected) operation.
PKA arithmetic result functions
-
Call the function HAL_PKA_GetResultAdd() to retrieve the result of the Addition operation.
-
Call the function HAL_PKA_GetResultSub() to retrieve the result of the subtraction operation.
-
Call the function HAL_PKA_GetResultMul() to retrieve the result of the multiplication operation.
-
Call the function HAL_PKA_GetResultCmp() to retrieve the result of the comparison operation.
-
Call the function HAL_PKA_GetResultModAdd() to retrieve the result of the Modular Addition operation.
-
Call the function HAL_PKA_GetResultModSub() to retrieve the result of the Modular subtraction operation.
-
Call the function HAL_PKA_GetResultModInv() to retrieve the result of the Modular Inversion operation.
-
Call the function HAL_PKA_GetResultModRed() to retrieve the result of the Modular Reduction operation.
-
Call the function HAL_PKA_GetResultMontgomeryMul() to retrieve the result of the Montgomery parameter operation.
-
Call the function HAL_PKA_GetResultMontgomery() to retrieve the result of Montgomery parameter operation.
PKA RSA result functions
-
Call the function HAL_PKA_RSA_GetResultCRTExp() to retrieve the result of RSA CRT exponentiation operation.
-
Call the function HAL_PKA_RSA_GetResultSignature() to retrieve the result of the RSA signature operation.
-
Call the function HAL_PKA_RSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECDSA result functions
-
Call the function HAL_PKA_ECDSA_GetResultSignature() to retrieve the result of elliptic curves over prime fields signature operation.
-
Call the function HAL_PKA_ECDSA_IsValidVerifSignature() to check if the signature is verified or not.
PKA ECC result functions
-
Call the function HAL_PKA_ECC_IsPointCheckOnCurve() to check if the point is on curve or not.
-
Call the function HAL_PKA_ECC_GetResultMul() to retrieve the result of ECC scalar multiplication operation.
-
Call the function HAL_PKA_ECC_GetResultDoubleBaseLadder() to retrieve the result of ECC double base ladder operation.
-
Call the function HAL_PKA_ECC_GetResultProjectiveToAffine() to retrieve the result of ECC projective to affine operation.
-
Call the function HAL_PKA_ECC_GetResultCompleteAdd() to retrieve the result of ECC complete addition operation.
Functions
-
hal_status_t
HAL_PKA_Compute
(
hal_pka_handle_t
*
hpka
,
uint32_t
timeout_ms
)
-
Generic function to start a PKA operation in blocking mode.
- Parameters :
-
-
hpka – PKA handle.
-
timeout_ms – Timeout duration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer or timeout_ms are NULL.
-
HAL_TIMEOUT – In case of user timeout.
-
HAL_ERROR – PKA error is occurred.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
hal_status_t
HAL_PKA_Compute_IT
(
hal_pka_handle_t
*
hpka
)
-
Generic function to start a PKA operation in non-blocking mode with interrupt.
- Parameters :
-
hpka – PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_BUSY – PKA state is active when calling this API.
-
HAL_OK – Operation is successfully computed.
-
-
void
HAL_PKA_IRQHandler
(
hal_pka_handle_t
*
hpka
)
-
This function handles PKA event interrupt request.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_Abort
(
hal_pka_handle_t
*
hpka
)
-
Abort any ongoing operation.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when hpka pointer is NULL.
-
HAL_OK – Operation is successfully aborted.
-
-
uint32_t
HAL_PKA_GetResultModExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpFast
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation (Fast) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModExpProtected
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular exponentiation (Protected) operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECDSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecdsa_signature_result_t
*
p_result
,
hal_pka_ecdsa_signature_result_ext_config_t
*
p_result_ext
)
-
Retrieve ECDSA signaure operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecdsa_signature_result_t result structure.
-
p_result_ext – Pointer to hal_pka_ecdsa_signature_result_ext_config_t structure (optional).
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
hal_pka_ecdsa_signature_status_t
HAL_PKA_ECDSA_IsValidVerifSignature
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve ECDSA verification signature result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECDSA_SIGNATURE_VALID – Signature validated.
-
PKA_ECDSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultCRTExp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve RSA CRT exponentiation operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_RSA_GetResultSignature
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve RSA signature operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_rsa_signature_status_t
HAL_PKA_RSA_IsValidVerifSignature
(
hal_pka_handle_t
*
hpka
,
const
uint8_t
*
p_hash
)
-
Retrieve RSA verification signature result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_hash – Pointer to hashed message provided by the user.
-
- Return values :
-
-
PKA_RSA_SIGNATURE_VALID – Signature validated.
-
PKA_RSA_SIGNATURE_NOT_VALID – In case of signature not validated or invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultCmp
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve comparison operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
PKA_CMP_RESULT_SIZE – Size of the comparison result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModAdd
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModSub
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular subtraction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModRed
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Reduction operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultModInv
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Modular Inversion operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomeryMul
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Montgomery multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
uint32_t
HAL_PKA_GetResultMontgomery
(
hal_pka_handle_t
*
hpka
,
uint8_t
*
p_result
)
-
Retrieve Montgomery parameter operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to operation result.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
hal_pka_ecc_point_status_t
HAL_PKA_ECC_IsPointCheckOnCurve
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve Point on elliptic curve check operation result.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
PKA_ECC_POINT_ON_CURVE – ECC point is on curve.
-
PKA_ECC_POINT_NOT_ON_CURVE – In case of ECC point is not on curve or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultMul
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_mul_result_t
*
p_result
)
-
Retrieve ECC scalar multiplication operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_mul_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultDoubleBaseLadder
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_double_base_ladder_result_t
*
p_result
)
-
Retrieve ECC double base ladder operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_double_base_ladder_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultProjectiveToAffine
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_projective_to_affine_result_t
*
p_result
)
-
Retrieve ECC projective to affine operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_projective_to_affine_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of result error or invalid parameter.
-
-
uint32_t
HAL_PKA_ECC_GetResultCompleteAdd
(
hal_pka_handle_t
*
hpka
,
hal_pka_ecc_complete_add_result_t
*
p_result
)
-
Retrieve ECC complete addition operation result.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_result – Pointer to hal_pka_ecc_complete_add_result_t result structure.
-
- Return values :
-
-
size_byte – Size of result in byte.
-
0 – In case of invalid parameter.
-
-
Callback functions ¶
- group PKA_Exported_Functions_Group4
-
This sub-section provides a set of callback functions allowing to register the PKA operation and error callbacks:
-
The HAL_PKA_OperationCpltCallback() function is called when the process is complete
-
The HAL_PKA_ErrorCallback() function is called in case of an error
-
Call the function HAL_PKA_RegisterOperationCpltCallback() to register the PKA operation complete callback.
-
Call the function HAL_PKA_RegisterErrorCallback() to register the PKA error callback.
Functions
-
void
HAL_PKA_OperationCpltCallback
(
hal_pka_handle_t
*
hpka
)
¶
-
Process completed callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
void
HAL_PKA_ErrorCallback
(
hal_pka_handle_t
*
hpka
)
¶
-
Error callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_RegisterOperationCpltCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
¶
-
Register the PKA command complete Callback TO be used instead of the weak HAL_PKA_OperCpltCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
hal_status_t
HAL_PKA_RegisterErrorCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
¶
-
Register the PKA Error Callback to be used instead of the weak HAL_PKA_ErrorCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
- group PKA_Exported_Functions_Group4
-
This sub-section provides a set of callback functions allowing to register the PKA operation and error callbacks:
-
The HAL_PKA_OperationCpltCallback() function is called when the process is complete
-
The HAL_PKA_ErrorCallback() function is called in case of an error
-
Call the function HAL_PKA_RegisterOperationCpltCallback() to register the PKA operation complete callback.
-
Call the function HAL_PKA_RegisterErrorCallback() to register the PKA error callback.
Functions
-
void
HAL_PKA_OperationCpltCallback
(
hal_pka_handle_t
*
hpka
)
-
Process completed callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
void
HAL_PKA_ErrorCallback
(
hal_pka_handle_t
*
hpka
)
-
Error callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_RegisterOperationCpltCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
-
Register the PKA command complete Callback TO be used instead of the weak HAL_PKA_OperCpltCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
hal_status_t
HAL_PKA_RegisterErrorCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
-
Register the PKA Error Callback to be used instead of the weak HAL_PKA_ErrorCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
- group PKA_Exported_Functions_Group4
-
This sub-section provides a set of callback functions allowing to register the PKA operation and error callbacks:
-
The HAL_PKA_OperationCpltCallback() function is called when the process is complete
-
The HAL_PKA_ErrorCallback() function is called in case of an error
-
Call the function HAL_PKA_RegisterOperationCpltCallback() to register the PKA operation complete callback.
-
Call the function HAL_PKA_RegisterErrorCallback() to register the PKA error callback.
Functions
-
void
HAL_PKA_OperationCpltCallback
(
hal_pka_handle_t
*
hpka
)
-
Process completed callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
void
HAL_PKA_ErrorCallback
(
hal_pka_handle_t
*
hpka
)
-
Error callback.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
hal_status_t
HAL_PKA_RegisterOperationCpltCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
-
Register the PKA command complete Callback TO be used instead of the weak HAL_PKA_OperCpltCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
hal_status_t
HAL_PKA_RegisterErrorCallback
(
hal_pka_handle_t
*
hpka
,
hal_pka_cb_t
p_callback
)
-
Register the PKA Error Callback to be used instead of the weak HAL_PKA_ErrorCallback() predefined callback.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_callback – Pointer to hal_pka_cb_t Callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – Register completed successfully.
-
-
State and Error functions ¶
- group PKA_Exported_Functions_Group5
-
This sub-section provides a set of functions allowing to get the PKA state, error code, and data information :
-
Call the function HAL_PKA_GetState() to get the PKA current state
-
Call the function HAL_PKA_GetLastErrorCodes() to get the PKA last hardware or software error codes
-
Call the function HAL_PKA_SetUserData() to set the PKA user data
-
Call the function HAL_PKA_GetUserData() to get the PKA user data
Functions
-
hal_pka_state_t
HAL_PKA_GetState
(
const
hal_pka_handle_t
*
hpka
)
¶
-
Retrieve the PKA global state.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
hal_pka_state_t – PKA state
-
uint32_t
HAL_PKA_GetLastErrorCodes
(
const
hal_pka_handle_t
*
hpka
)
¶
-
Retrieve the PKA error code.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
PKA – error code.
-
void
HAL_PKA_SetUserData
(
hal_pka_handle_t
*
hpka
,
const
void
*
p_user_data
)
¶
-
Store the user data into the pka handle.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_PKA_GetUserData
(
const
hal_pka_handle_t
*
hpka
)
¶
-
Retrieve the user data from the pka handle.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
Pointer – to the user data.
-
- group PKA_Exported_Functions_Group5
-
This sub-section provides a set of functions allowing to get the PKA state, error code, and data information :
-
Call the function HAL_PKA_GetState() to get the PKA current state
-
Call the function HAL_PKA_GetLastErrorCodes() to get the PKA last hardware or software error codes
-
Call the function HAL_PKA_SetUserData() to set the PKA user data
-
Call the function HAL_PKA_GetUserData() to get the PKA user data
Functions
-
hal_pka_state_t
HAL_PKA_GetState
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the PKA global state.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
hal_pka_state_t – PKA state
-
uint32_t
HAL_PKA_GetLastErrorCodes
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the PKA error code.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
PKA – error code.
-
void
HAL_PKA_SetUserData
(
hal_pka_handle_t
*
hpka
,
const
void
*
p_user_data
)
-
Store the user data into the pka handle.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_PKA_GetUserData
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the user data from the pka handle.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
Pointer – to the user data.
-
- group PKA_Exported_Functions_Group5
-
This sub-section provides a set of functions allowing to get the PKA state, error code, and data information :
-
Call the function HAL_PKA_GetState() to get the PKA current state
-
Call the function HAL_PKA_GetLastErrorCodes() to get the PKA last hardware or software error codes
-
Call the function HAL_PKA_SetUserData() to set the PKA user data
-
Call the function HAL_PKA_GetUserData() to get the PKA user data
Functions
-
hal_pka_state_t
HAL_PKA_GetState
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the PKA global state.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
hal_pka_state_t – PKA state
-
uint32_t
HAL_PKA_GetLastErrorCodes
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the PKA error code.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
PKA – error code.
-
void
HAL_PKA_SetUserData
(
hal_pka_handle_t
*
hpka
,
const
void
*
p_user_data
)
-
Store the user data into the pka handle.
- Parameters :
-
-
hpka – Pointer to hal_pka_handle_t PKA handle.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_PKA_GetUserData
(
const
hal_pka_handle_t
*
hpka
)
-
Retrieve the user data from the pka handle.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
Pointer – to the user data.
-
PKA RAM Mass Erase function ¶
- group PKA_Exported_Functions_Group6
-
This sub-section provides a function called HAL_PKA_RAMMassErase() allowing to erase the content of the PKA RAM.
Functions
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)
¶
-
Erase the content of PKA RAM.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – The content of PKA RAM is fully and successfully erased.
-
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)
¶
- group PKA_Exported_Functions_Group6
-
This sub-section provides a function called HAL_PKA_RAMMassErase() allowing to erase the content of the PKA RAM.
Functions
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)
-
Erase the content of PKA RAM.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – The content of PKA RAM is fully and successfully erased.
-
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)
- group PKA_Exported_Functions_Group6
-
This sub-section provides a function called HAL_PKA_RAMMassErase() allowing to erase the content of the PKA RAM.
Functions
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)
-
Erase the content of PKA RAM.
- Parameters :
-
hpka – Pointer to hal_pka_handle_t PKA handle.
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_OK – The content of PKA RAM is fully and successfully erased.
-
-
hal_status_t
HAL_PKA_RAMMassErase
(
hal_pka_handle_t
*
hpka
)