cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
esp32_crypto_provider.cpp File Reference

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"
Include dependency graph for esp32_crypto_provider.cpp:

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_ttoCurve (CW_Curve curve)

Detailed Description

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.

Macro Definition Documentation

◆ AES_BLOCK_SIZE_BYTES

#define AES_BLOCK_SIZE_BYTES   (16U) /* bytes in one AES block */

◆ AES_KEY_BITS_PER_BYTE

#define AES_KEY_BITS_PER_BYTE   (8U) /* multiplier: key bytes → key bits */

◆ AES_PAD_BUF_MAX_INPUT

#define AES_PAD_BUF_MAX_INPUT   (256U)

Definition at line 50 of file esp32_crypto_provider.cpp.

◆ AES_PAD_BUF_SIZE

#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().

◆ BIT_PADDING_MARKER

#define BIT_PADDING_MARKER   (0x80U) /* mandatory leading 1-bit as a full byte */

◆ MBEDTLS_OK

◆ MBEDTLS_SHA256_MODE

#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().

◆ MBEDTLS_SHA512_MODE

#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().

◆ PADDING_ZERO_FILL

#define PADDING_ZERO_FILL   (0x00U) /* fill value for padding bytes after marker */

◆ UECC_SUCCESS

Function Documentation

◆ toCurve()

const uECC_Curve_t * toCurve ( CW_Curve curve)
static