21#ifndef PSA_CRYPTOCELL_310_ECC_COMMON_H
22#define PSA_CRYPTOCELL_310_ECC_COMMON_H
31#include "crys_ecpki_build.h"
32#include "crys_ecpki_ecdsa.h"
33#include "crys_ecpki_kg.h"
34#include "crys_ecpki_domain.h"
41#define MAP_PSA_HASH_TO_CRYS_HASH_AFTER(hash) \
42 ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_AFTER_HASH_SHA1_mode : \
43 (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_AFTER_HASH_SHA224_mode : \
44 (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_AFTER_HASH_SHA256_mode : \
45 (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_AFTER_HASH_SHA384_mode : \
46 (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_AFTER_HASH_SHA512_mode : \
54#define MAP_PSA_HASH_TO_CRYS_HASH_BEFORE(hash) \
55 ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_HASH_SHA1_mode : \
56 (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_HASH_SHA224_mode : \
57 (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_HASH_SHA256_mode : \
58 (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_HASH_SHA384_mode : \
59 (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_HASH_SHA512_mode : \
73 uint8_t *pub_key_buffer,
74 uint32_t *priv_key_buffer_length,
75 uint32_t *pub_key_buffer_length,
76 CRYS_ECPKI_DomainID_t domain);
92 uint32_t priv_key_size,
96 size_t *signature_length,
97 CRYS_ECPKI_HASH_OpMode_t hash_mode,
98 CRYS_ECPKI_DomainID_t domain);
116 const uint8_t *input,
118 const uint8_t *signature,
119 size_t signature_length,
120 CRYS_ECPKI_HASH_OpMode_t hash_mode,
121 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_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.