Common ECC functions used by all PSA Crypto wrappers for the CryptoCell 310 ECC APIs. More...
Common ECC functions used by all PSA Crypto wrappers for the CryptoCell 310 ECC APIs.
Definition in file psa_cryptocell_310_ecc_common.h.
#include "psa/crypto.h"
#include "sns_silib.h"
#include "crys_ecpki_build.h"
#include "crys_ecpki_ecdsa.h"
#include "crys_ecpki_kg.h"
#include "crys_ecpki_domain.h"
Go to the source code of this file.
#define | MAP_PSA_HASH_TO_CRYS_HASH_AFTER(hash) |
Map PSA hash encodings to CryptoCell specific hash encodings. | |
#define | MAP_PSA_HASH_TO_CRYS_HASH_BEFORE(hash) |
Map PSA hash encodings to CryptoCell specific hash encodings. | |
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. | |
#define MAP_PSA_HASH_TO_CRYS_HASH_AFTER | ( | hash | ) |
Map PSA hash encodings to CryptoCell specific hash encodings.
hash | psa_algorithm_t |
Definition at line 41 of file psa_cryptocell_310_ecc_common.h.
#define MAP_PSA_HASH_TO_CRYS_HASH_BEFORE | ( | hash | ) |
Map PSA hash encodings to CryptoCell specific hash encodings.
hash | psa_algorithm_t |
Definition at line 54 of file psa_cryptocell_310_ecc_common.h.
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.
priv_key_buffer | Output buffer to write ECC private key |
pub_key_buffer | Output buffer to write ECC public key |
priv_key_buffer_length | Output pointer to write private key length |
pub_key_buffer_length | Output pointer to write public key length |
domain | ECC domain of type CRYS_ECPKI_DomainID_t |
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.
priv_key | Pointer to ECC private key |
priv_key_size | Size of private key |
input | Input to sign (hash or original message depending on hash_mode ) |
input_length | Length of the input |
signature | Output buffer to write the generated signature |
signature_length | Pointer to store the actual length of the signature |
hash_mode | Mode used to hash the message of type CRYS_ECPKI_HASH_OpMode_t |
domain | ECC domain of type CRYS_ECPKI_DomainID_t |
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.
pub_key | Pointer to ECC public key |
pub_key_size | Size of public key |
input | Input to verify (hash or original message depending on hash_mode ) |
input_length | Length of the input |
signature | Buffer containing the signature to be verified |
signature_length | Actual length of the signature |
hash_mode | Mode used to hash the message of type CRYS_ECPKI_HASH_OpMode_t |
domain | ECC domain of type CRYS_ECPKI_DomainID_t |