30#include "crys_ecpki_build.h" 
   31#include "crys_ecpki_ecdsa.h" 
   32#include "crys_ecpki_kg.h" 
   33#include "crys_ecpki_domain.h" 
   40#define MAP_PSA_HASH_TO_CRYS_HASH_AFTER(hash) \ 
   41    ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_AFTER_HASH_SHA1_mode : \ 
   42     (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_AFTER_HASH_SHA224_mode : \ 
   43     (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_AFTER_HASH_SHA256_mode : \ 
   44     (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_AFTER_HASH_SHA384_mode : \ 
   45     (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_AFTER_HASH_SHA512_mode : \ 
 
   53#define MAP_PSA_HASH_TO_CRYS_HASH_BEFORE(hash) \ 
   54    ((hash == PSA_ALG_SHA_1) ? CRYS_ECPKI_HASH_SHA1_mode : \ 
   55     (hash == PSA_ALG_SHA_224) ? CRYS_ECPKI_HASH_SHA224_mode : \ 
   56     (hash == PSA_ALG_SHA_256) ? CRYS_ECPKI_HASH_SHA256_mode : \ 
   57     (hash == PSA_ALG_SHA_384) ? CRYS_ECPKI_HASH_SHA384_mode : \ 
   58     (hash == PSA_ALG_SHA_512) ? CRYS_ECPKI_HASH_SHA512_mode : \ 
 
   72                                                 uint8_t *pub_key_buffer,
 
   73                                                 uint32_t *priv_key_buffer_length,
 
   74                                                 uint32_t *pub_key_buffer_length,
 
   75                                                 CRYS_ECPKI_DomainID_t domain);
 
   88                                                 uint8_t *pub_key_buffer,
 
   89                                                 uint32_t priv_key_buffer_length,
 
   90                                                 uint32_t *pub_key_buffer_length,
 
   91                                                 CRYS_ECPKI_DomainID_t domain);
 
  107                                         uint32_t priv_key_size,
 
  108                                         const uint8_t *input,
 
  111                                         size_t *signature_length,
 
  112                                         CRYS_ECPKI_HASH_OpMode_t hash_mode,
 
  113                                         CRYS_ECPKI_DomainID_t domain);
 
  131                                           const uint8_t *input,
 
  133                                           const uint8_t *signature,
 
  134                                           size_t signature_length,
 
  135                                           CRYS_ECPKI_HASH_OpMode_t hash_mode,
 
  136                                           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.