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.
- Author
- Lena Boeckmann lena..nosp@m.boec.nosp@m.kmann.nosp@m.@haw.nosp@m.-hamb.nosp@m.urg..nosp@m.de
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. More...
|
|
#define | MAP_PSA_HASH_TO_CRYS_HASH_BEFORE(hash) |
| Map PSA hash encodings to CryptoCell specific hash encodings. More...
|
|
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. More...
|
|
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) More...
|
|
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. More...
|
|
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. More...
|
|
◆ MAP_PSA_HASH_TO_CRYS_HASH_AFTER
#define MAP_PSA_HASH_TO_CRYS_HASH_AFTER |
( |
|
hash | ) |
|
Value:
0)
#define PSA_ALG_SHA_224
The SHA-224 message-digest algorithm.
#define PSA_ALG_SHA_1
The SHA-1 message-digest algorithm.
#define PSA_ALG_SHA_384
The SHA-384 message-digest algorithm.
#define PSA_ALG_SHA_256
The SHA-256 message-digest algorithm.
#define PSA_ALG_SHA_512
The SHA-512 message-digest algorithm.
Map PSA hash encodings to CryptoCell specific hash encodings.
- Parameters
-
Definition at line 41 of file psa_cryptocell_310_ecc_common.h.
◆ MAP_PSA_HASH_TO_CRYS_HASH_BEFORE
#define MAP_PSA_HASH_TO_CRYS_HASH_BEFORE |
( |
|
hash | ) |
|
◆ cryptocell_310_common_ecc_derive_pub_key()
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)
- Parameters
-
priv_key_buffer | Input buffer to read ECC private key |
pub_key_buffer | Output buffer to write ECC public key |
priv_key_buffer_length | Length of private key |
pub_key_buffer_length | Output pointer to write public key length |
domain | ECC domain of type CRYS_ECPKI_DomainID_t |
- Returns
- psa_status_t
◆ cryptocell_310_common_ecc_generate_key_pair()
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.
- Parameters
-
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 |
- Returns
- psa_status_t
◆ cryptocell_310_common_ecc_sign()
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.
- Parameters
-
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 |
- Returns
- psa_status_t
◆ cryptocell_310_common_ecc_verify()
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.
- Parameters
-
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 |
- Returns
- psa_status_t