|
cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
|
Implementation of ESP32CryptoProvider — mbedTLS + hardware TRNG backend. More...
#include "esp32_crypto_provider.h"#include "CW_Utils.h"#include "uECC.h"#include "mbedtls/sha256.h"#include "mbedtls/sha512.h"#include "mbedtls/aes.h"Go to the source code of this file.
Macros | |
| #define | AES_BLOCK_SIZE_BYTES (16U) /* bytes in one AES block */ |
| #define | AES_KEY_BITS_PER_BYTE (8U) /* multiplier: key bytes → key bits */ |
| #define | AES_PAD_BUF_MAX_INPUT (256U) |
| #define | AES_PAD_BUF_SIZE (AES_PAD_BUF_MAX_INPUT + AES_BLOCK_SIZE_BYTES) |
| #define | BIT_PADDING_MARKER (0x80U) /* mandatory leading 1-bit as a full byte */ |
| #define | PADDING_ZERO_FILL (0x00U) /* fill value for padding bytes after marker */ |
| #define | MBEDTLS_SHA256_MODE (0) /* 0 = SHA-256, 1 = SHA-224 */ |
| #define | MBEDTLS_SHA512_MODE (0) /* 0 = SHA-512, 1 = SHA-384 */ |
| #define | MBEDTLS_OK (0) |
| #define | UECC_SUCCESS (1) |
Functions | |
| static const uECC_Curve_t * | toCurve (CW_Curve curve) |
Implementation of ESP32CryptoProvider — mbedTLS + hardware TRNG backend.
Stitches together the ESP-IDF cryptographic stack behind the single platform-independent CW_CryptoProvider interface. Full API documentation lives on the declarations in esp32_crypto_provider.h.
Definition in file esp32_crypto_provider.cpp.
| #define AES_BLOCK_SIZE_BYTES (16U) /* bytes in one AES block */ |
Definition at line 47 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcDecrypt(), and ESP32CryptoProvider::aesCbcEncrypt().
| #define AES_KEY_BITS_PER_BYTE (8U) /* multiplier: key bytes → key bits */ |
Definition at line 48 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcDecrypt(), and ESP32CryptoProvider::aesCbcEncrypt().
| #define AES_PAD_BUF_MAX_INPUT (256U) |
Definition at line 50 of file esp32_crypto_provider.cpp.
| #define AES_PAD_BUF_SIZE (AES_PAD_BUF_MAX_INPUT + AES_BLOCK_SIZE_BYTES) |
Definition at line 52 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcEncrypt().
| #define BIT_PADDING_MARKER (0x80U) /* mandatory leading 1-bit as a full byte */ |
Definition at line 55 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcDecrypt(), and ESP32CryptoProvider::aesCbcEncrypt().
| #define MBEDTLS_OK (0) |
Definition at line 63 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcDecrypt(), ESP32CryptoProvider::aesCbcEncrypt(), esp32_mbedtls_rng(), ESP32CryptoProvider::sha256(), ESP32CryptoProvider::sha512(), uECC_make_key(), uECC_shared_secret(), and uECC_verify().
| #define MBEDTLS_SHA256_MODE (0) /* 0 = SHA-256, 1 = SHA-224 */ |
Definition at line 59 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::sha256().
| #define MBEDTLS_SHA512_MODE (0) /* 0 = SHA-512, 1 = SHA-384 */ |
Definition at line 60 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::sha512().
| #define PADDING_ZERO_FILL (0x00U) /* fill value for padding bytes after marker */ |
Definition at line 56 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::aesCbcDecrypt(), and ESP32CryptoProvider::aesCbcEncrypt().
| #define UECC_SUCCESS (1) |
Definition at line 66 of file esp32_crypto_provider.cpp.
Referenced by ESP32CryptoProvider::ecdh(), ESP32CryptoProvider::ecdsaVerify(), ESP32CryptoProvider::makeKey(), uECC_make_key(), uECC_shared_secret(), and uECC_verify().
|
static |
Definition at line 26 of file esp32_crypto_provider.cpp.
References uECC_secp256k1(), and uECC_secp256r1().
Referenced by ESP32CryptoProvider::ecdh(), ESP32CryptoProvider::ecdsaVerify(), and ESP32CryptoProvider::makeKey().