123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- #ifndef CC310_BL_BACKEND_ECC_H__
- #define CC310_BL_BACKEND_ECC_H__
- #include "sdk_config.h"
- #include "nordic_common.h"
- #if NRF_MODULE_ENABLED(NRF_CRYPTO) && NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310_BL)
- #include "nrf_crypto_ecc_shared.h"
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1)
- #include "nrf_cc310_bl_ecdsa_verify_secp224r1.h"
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1)
- #include "nrf_cc310_bl_ecdsa_verify_secp256r1.h"
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1)
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_ECC_SECP224R1)
- #error "More than one backend enabled for secp224r1 (NIST 224-bit).");
- #endif
- #define NRF_CRYPTO_ECC_SECP224R1_ENABLED 1
- typedef struct
- {
- nrf_crypto_internal_ecc_key_header_t header;
- nrf_cc310_bl_ecc_public_key_secp224r1_t public_key;
- } nrf_crypto_backend_secp224r1_public_key_t;
- ret_code_t nrf_crypto_backend_secp224r1_public_key_from_raw(
- void * p_public_key,
- uint8_t const * p_raw_data);
- ret_code_t nrf_crypto_backend_secp224r1_public_key_to_raw(
- void const * p_public_key,
- uint8_t * p_raw_data);
- #define nrf_crypto_backend_secp224r1_key_pair_generate NULL
- #define nrf_crypto_backend_secp224r1_public_key_calculate NULL
- #define nrf_crypto_backend_secp224r1_private_key_from_raw NULL
- #define nrf_crypto_backend_secp224r1_private_key_to_raw NULL
- #define nrf_crypto_backend_secp224r1_private_key_free NULL
- #define nrf_crypto_backend_secp224r1_public_key_free NULL
- #define NRF_CRYPTO_BACKEND_SECP224R1_KEY_PAIR_GENERATE_CONTEXT_SIZE 0
- #define NRF_CRYPTO_BACKEND_SECP224R1_PUBLIC_KEY_CALCULATE_CONTEXT_SIZE 0
- typedef uint32_t nrf_crypto_backend_secp224r1_private_key_t;
- typedef uint32_t nrf_crypto_backend_secp224r1_key_pair_generate_context_t;
- typedef uint32_t nrf_crypto_backend_secp224r1_public_key_calculate_context_t;
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1)
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_ECC_SECP256R1)
- #error "More than one backend enabled for secp256r1 (NIST 256-bit).");
- #endif
- #define NRF_CRYPTO_ECC_SECP256R1_ENABLED 1
- typedef struct
- {
- nrf_crypto_internal_ecc_key_header_t header;
- nrf_cc310_bl_ecc_public_key_secp256r1_t public_key;
- } nrf_crypto_backend_secp256r1_public_key_t;
- ret_code_t nrf_crypto_backend_secp256r1_public_key_from_raw(
- void * p_public_key,
- uint8_t const * p_raw_data);
- ret_code_t nrf_crypto_backend_secp256r1_public_key_to_raw(
- void const * p_public_key,
- uint8_t * p_raw_data);
- #define nrf_crypto_backend_secp256r1_key_pair_generate NULL
- #define nrf_crypto_backend_secp256r1_public_key_calculate NULL
- #define nrf_crypto_backend_secp256r1_private_key_from_raw NULL
- #define nrf_crypto_backend_secp256r1_private_key_to_raw NULL
- #define nrf_crypto_backend_secp256r1_private_key_free NULL
- #define nrf_crypto_backend_secp256r1_public_key_free NULL
- #define NRF_CRYPTO_BACKEND_SECP256R1_KEY_PAIR_GENERATE_CONTEXT_SIZE 0
- #define NRF_CRYPTO_BACKEND_SECP256R1_PUBLIC_KEY_CALCULATE_CONTEXT_SIZE 0
- typedef uint32_t nrf_crypto_backend_secp256r1_private_key_t;
- typedef uint32_t nrf_crypto_backend_secp256r1_key_pair_generate_context_t;
- typedef uint32_t nrf_crypto_backend_secp256r1_public_key_calculate_context_t;
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
- #endif
|