27#include "crys_ecpki_build.h"
28#include "crys_ecpki_ecdsa.h"
29#include "crys_ecpki_kg.h"
30#include "crys_ecpki_domain.h"
37#define MAP_PSA_HASH_TO_CRYS_HASH_AFTER(hash) \
38 ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_AFTER_HASH_SHA1_mode : \
39 (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_AFTER_HASH_SHA224_mode : \
40 (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_AFTER_HASH_SHA256_mode : \
41 (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_AFTER_HASH_SHA384_mode : \
42 (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_AFTER_HASH_SHA512_mode : \
50#define MAP_PSA_HASH_TO_CRYS_HASH_BEFORE(hash) \
51 ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_HASH_SHA1_mode : \
52 (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_HASH_SHA224_mode : \
53 (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_HASH_SHA256_mode : \
54 (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_HASH_SHA384_mode : \
55 (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_HASH_SHA512_mode : \
69 uint8_t *pub_key_buffer,
70 uint32_t *priv_key_buffer_length,
71 uint32_t *pub_key_buffer_length,
72 CRYS_ECPKI_DomainID_t domain);
85 uint8_t *pub_key_buffer,
86 uint32_t priv_key_buffer_length,
87 uint32_t *pub_key_buffer_length,
88 CRYS_ECPKI_DomainID_t domain);
104 uint32_t priv_key_size,
105 const uint8_t *input,
108 size_t *signature_length,
109 CRYS_ECPKI_HASH_OpMode_t hash_mode,
110 CRYS_ECPKI_DomainID_t domain);
128 const uint8_t *input,
130 const uint8_t *signature,
131 size_t signature_length,
132 CRYS_ECPKI_HASH_OpMode_t hash_mode,
133 CRYS_ECPKI_DomainID_t domain);
Function declarations for PSA Crypto.
int32_t psa_status_t
Status code type used for all PSA Certified APIs.
psa_status_t cryptocell_310_common_ecc_generate_key_pair(uint8_t *priv_key_buffer, uint8_t *pub_key_buffer, uint32_t *priv_key_buffer_length, uint32_t *pub_key_buffer_length, CRYS_ECPKI_DomainID_t domain)
Common ECC key generation function.
psa_status_t cryptocell_310_common_ecc_sign(const uint8_t *priv_key, uint32_t priv_key_size, const uint8_t *input, size_t input_length, uint8_t *signature, size_t *signature_length, CRYS_ECPKI_HASH_OpMode_t hash_mode, CRYS_ECPKI_DomainID_t domain)
Common ECC signature function.
psa_status_t cryptocell_310_common_ecc_derive_pub_key(const uint8_t *priv_key_buffer, uint8_t *pub_key_buffer, uint32_t priv_key_buffer_length, uint32_t *pub_key_buffer_length, CRYS_ECPKI_DomainID_t domain)
Common ECC public key derivation function (not supported)
psa_status_t cryptocell_310_common_ecc_verify(const uint8_t *pub_key, size_t pub_key_size, const uint8_t *input, size_t input_length, const uint8_t *signature, size_t signature_length, CRYS_ECPKI_HASH_OpMode_t hash_mode, CRYS_ECPKI_DomainID_t domain)
Common ECC verification function.