cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
uECC.h File Reference
#include <stdint.h>
Include dependency graph for uECC.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct uECC_Curve_t uECC_Curve_t
typedef int(* uECC_RNG_Function) (uint8_t *dest, unsigned size)

Functions

const uECC_Curve_tuECC_secp256r1 (void)
 Return the static secp256r1 curve descriptor.
const uECC_Curve_tuECC_secp256k1 (void)
 Return the static secp256k1 curve descriptor.
void uECC_set_rng (uECC_RNG_Function rng_function)
 No-op: ESP32 hardware RNG is used internally; no external callback needed.
int uECC_make_key (uint8_t *public_key, uint8_t *private_key, const uECC_Curve_t *curve)
 Generate an ECC key pair using mbedTLS and the ESP32 hardware RNG.
int uECC_shared_secret (const uint8_t *public_key, const uint8_t *private_key, uint8_t *secret, const uECC_Curve_t *curve)
 Compute ECDH shared secret (X-coordinate of privKey * pubKey).
int uECC_verify (const uint8_t *public_key, const uint8_t *hash, unsigned hash_size, const uint8_t *signature, const uECC_Curve_t *curve)
 Verify an ECDSA signature (raw 64-byte r||s) against a hash.

Typedef Documentation

◆ uECC_Curve_t

typedef struct uECC_Curve_t uECC_Curve_t

Definition at line 22 of file uECC.h.

◆ uECC_RNG_Function

typedef int(* uECC_RNG_Function) (uint8_t *dest, unsigned size)

Definition at line 32 of file uECC.h.

Function Documentation

◆ uECC_make_key()

int uECC_make_key ( uint8_t * public_key,
uint8_t * private_key,
const uECC_Curve_t * curve )

Generate an ECC key pair using mbedTLS and the ESP32 hardware RNG.

Definition at line 92 of file uECC_esp32.cpp.

References COORD_SIZE_BYTES, COORD_X_OFFSET, ECC_XY_KEY_SIZE, esp32_mbedtls_rng(), uECC_Curve_t::grp_id, MBEDTLS_OK, UECC_FAILURE, UECC_SUCCESS, and UNCOMPRESSED_PUB_SIZE.

Referenced by ESP32CryptoProvider::makeKey().

◆ uECC_secp256k1()

const uECC_Curve_t * uECC_secp256k1 ( void )

Return the static secp256k1 curve descriptor.

Definition at line 75 of file uECC_esp32.cpp.

References s_secp256k1.

Referenced by toCurve().

◆ uECC_secp256r1()

const uECC_Curve_t * uECC_secp256r1 ( void )

Return the static secp256r1 curve descriptor.

Definition at line 70 of file uECC_esp32.cpp.

References s_secp256r1.

Referenced by toCurve().

◆ uECC_set_rng()

void uECC_set_rng ( uECC_RNG_Function rng_function)

No-op: ESP32 hardware RNG is used internally; no external callback needed.

Definition at line 80 of file uECC_esp32.cpp.

References UECC_LOG_TAG.

◆ uECC_shared_secret()

int uECC_shared_secret ( const uint8_t * public_key,
const uint8_t * private_key,
uint8_t * secret,
const uECC_Curve_t * curve )

◆ uECC_verify()

int uECC_verify ( const uint8_t * public_key,
const uint8_t * hash,
unsigned hash_size,
const uint8_t * signature,
const uECC_Curve_t * curve )