SmartSnippets DA1459x SDK
crypto_ecc_provider_functions.h
Go to the documentation of this file.
1 
47 #ifndef SDK_CRYPTO_INCLUDE_CRYPTO_ECC_PROVIDER_FUNCTIONS_H_
48 #define SDK_CRYPTO_INCLUDE_CRYPTO_ECC_PROVIDER_FUNCTIONS_H_
49 
50 #include <sys_trng.h>
51 #include <ad_crypto.h>
52 #include <hw_ecc.h>
53 #include "sodium.h"
54 #include "uECC.h"
56 #include <crypto_ec.h>
57 
58 /* Compute private key external functions.*/
59 CRYPTO_ECC_PROVIDER_RET compute_private_key_uecc(crypto_ec_params_t *curve, uint8_t *d);
60 CRYPTO_ECC_PROVIDER_RET compute_private_key_25519(crypto_ec_params_t *curve, uint8_t *d);
61 CRYPTO_ECC_PROVIDER_RET compute_private_key_hw(crypto_ec_params_t *curve, uint8_t *d);
62 
63 /* Compute public key external functions.*/
64 CRYPTO_ECC_PROVIDER_RET compute_public_key_25519_hw(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Q);
65 CRYPTO_ECC_PROVIDER_RET compute_public_key_25519_sodium(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Q);
66 CRYPTO_ECC_PROVIDER_RET compute_public_key_hw(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Q);
67 CRYPTO_ECC_PROVIDER_RET compute_public_key_uecc(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Q);
68 
69 /* Compute shared key external functions.*/
70 CRYPTO_ECC_PROVIDER_RET compute_shared_secret_hw(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Qp, uint8_t *s);
71 CRYPTO_ECC_PROVIDER_RET compute_shared_secret_uecc(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Qp, uint8_t *s);
72 CRYPTO_ECC_PROVIDER_RET compute_shared_secret_25519_sodium(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Qp, uint8_t *s);
73 CRYPTO_ECC_PROVIDER_RET compute_shared_secret_25519_hw(crypto_ec_params_t *curve, uint8_t *d, uint8_t *Qp, uint8_t *s);
74 
75 /* Curve init functions .*/
76 CRYPTO_ECC_PROVIDER_RET curve_init_secp160r1(crypto_ec_params_t *curve);
77 CRYPTO_ECC_PROVIDER_RET curve_init_secp192r1(crypto_ec_params_t *curve);
78 CRYPTO_ECC_PROVIDER_RET curve_init_secp224r1(crypto_ec_params_t *curve);
79 CRYPTO_ECC_PROVIDER_RET curve_init_secp256r1(crypto_ec_params_t *curve);
80 CRYPTO_ECC_PROVIDER_RET curve_init_secp256k1(crypto_ec_params_t *curve);
81 CRYPTO_ECC_PROVIDER_RET curve_init_25519(crypto_ec_params_t *curve);
82 
83 /* This is the error handling function of ecc library providing mechanism.
84  * In case a call to a curve or a library that is not provided depending
85  * on settings in crypto_ecc_provider_params.h this function will be called.
86  */
87 CRYPTO_ECC_PROVIDER_RET ecc_lib_provider_error_handler();
88 
89 #endif /* SDK_CRYPTO_INCLUDE_CRYPTO_ECC_PROVIDER_FUNCTIONS_H_ */
90 
CRYPTO_ECC_PROVIDER_RET
CRYPTO_ECC_PROVIDER_RET
ECC Provider API return codes.
Definition: crypto_ecc_provider_params.h:77
crypto_ecc_provider_functions.h
Elliptic curves primitives and basic datatypes. Depending on ecc library and curve settings,...
ad_crypto.h
AES/HASH device access API.
sys_trng.h
sys_trng header file.
crypto_ec.h
Elliptic curves data.
crypto_ec_params_t
Elliptic curve parameters.
Definition: crypto_ec.h:59