|
cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
|
#include <stdint.h>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_t * | uECC_secp256r1 (void) |
| Return the static secp256r1 curve descriptor. | |
| const uECC_Curve_t * | uECC_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 int(* uECC_RNG_Function) (uint8_t *dest, unsigned size) |
| 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().
| 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().
| 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().
| 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.
| 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).
Definition at line 144 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, POINT_PREFIX_OFFSET, UECC_FAILURE, UECC_SUCCESS, UNCOMPRESSED_PREFIX, and UNCOMPRESSED_PUB_SIZE.
Referenced by ESP32CryptoProvider::ecdh().
| 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.
Definition at line 210 of file uECC_esp32.cpp.
References COORD_SIZE_BYTES, COORD_X_OFFSET, ECC_XY_KEY_SIZE, uECC_Curve_t::grp_id, MBEDTLS_OK, POINT_PREFIX_OFFSET, RAW_SIG_R_OFFSET, RAW_SIG_S_OFFSET, UECC_FAILURE, UECC_SUCCESS, UNCOMPRESSED_PREFIX, and UNCOMPRESSED_PUB_SIZE.
Referenced by ESP32CryptoProvider::ecdsaVerify().