123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef ECC_H__
- #define ECC_H__
- #include <stdint.h>
- #include <stdbool.h>
- #include "nordic_common.h"
- #include "nrf_error.h"
- #include "sdk_errors.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define ECC_P256_SK_LEN 32
- #define ECC_P256_PK_LEN 64
- void ecc_init(bool rng);
- ret_code_t ecc_p256_keypair_gen(uint8_t *p_le_sk, uint8_t* p_le_pk);
- ret_code_t ecc_p256_public_key_compute(uint8_t const *p_le_sk, uint8_t* p_le_pk);
- ret_code_t ecc_p256_shared_secret_compute(uint8_t const *p_le_sk, uint8_t const * p_le_pk, uint8_t *p_le_ss);
- ret_code_t ecc_p256_sign(uint8_t const *p_le_sk, uint8_t const * p_le_hash, uint32_t hlen, uint8_t *p_le_sig);
- ret_code_t ecc_p256_verify(uint8_t const *p_le_pk, uint8_t const * p_le_hash, uint32_t hlen, uint8_t const *p_le_sig);
- #ifdef __cplusplus
- }
- #endif
- #endif
|