123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef MICRO_ECC_BACKEND_ECDH_H__
- #define MICRO_ECC_BACKEND_ECDH_H__
- #include "sdk_config.h"
- #include "nordic_common.h"
- #if NRF_MODULE_ENABLED(NRF_CRYPTO) && NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_MICRO_ECC)
- #include "nrf_crypto_ecc.h"
- #include "nrf_crypto_ecdh_shared.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- ret_code_t nrf_crypto_backend_micro_ecc_ecdh_compute(
- void * p_context,
- void const * p_private_key,
- void const * p_public_key,
- uint8_t * p_shared_secret);
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1)
- #define nrf_crypto_backend_secp192r1_ecdh_compute nrf_crypto_backend_micro_ecc_ecdh_compute
- typedef uint32_t nrf_crypto_backend_secp192r1_ecdh_context_t;
- #define NRF_CRYPTO_BACKEND_SECP192R1_ECDH_CONTEXT_SIZE 0
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1)
- #define nrf_crypto_backend_secp224r1_ecdh_compute nrf_crypto_backend_micro_ecc_ecdh_compute
- typedef uint32_t nrf_crypto_backend_secp224r1_ecdh_context_t;
- #define NRF_CRYPTO_BACKEND_SECP224R1_ECDH_CONTEXT_SIZE 0
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1)
- #define nrf_crypto_backend_secp256r1_ecdh_compute nrf_crypto_backend_micro_ecc_ecdh_compute
- typedef uint32_t nrf_crypto_backend_secp256r1_ecdh_context_t;
- #define NRF_CRYPTO_BACKEND_SECP256R1_ECDH_CONTEXT_SIZE 0
- #endif
- #if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1)
- #define nrf_crypto_backend_secp256k1_ecdh_compute nrf_crypto_backend_micro_ecc_ecdh_compute
- typedef uint32_t nrf_crypto_backend_secp256k1_ecdh_context_t;
- #define NRF_CRYPTO_BACKEND_SECP256K1_ECDH_CONTEXT_SIZE 0
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
- #endif
|