cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
test_esp32_crypto_provider.cpp File Reference
#include "unity.h"
#include "esp32_crypto_provider.h"
#include "CW_Defs.h"
#include "CW_Utils.h"
#include <string.h>
#include <stdio.h>
Include dependency graph for test_esp32_crypto_provider.cpp:

Go to the source code of this file.

Macros

#define TV_SHA256_OUT_BYTES   (32U)
#define TV_SHA512_OUT_BYTES   (64U)
#define TV_AES_KEY_BYTES   (16U)
#define TV_AES_IV_BYTES   (16U)
#define TV_AES_BLOCK_BYTES   (16U)
#define TV_EC_COORD_BYTES   (32U)
#define TV_EC_PUBKEY_BYTES   (64U)
#define TV_RANDOM_BYTES   (32U)
#define TV_BIT_PAD_INPUT_BYTES   (3U) /* plaintext shorter than one AES block */

Functions

 TEST_CASE ("sha256 NIST abc vector", "[crypto_provider]")
 TEST_CASE ("sha512 NIST abc vector", "[crypto_provider]")
 TEST_CASE ("aesCbcEncrypt NIST SP800-38A F.2.1 one block", "[crypto_provider]")
 TEST_CASE ("aesCbcDecrypt NIST SP800-38A F.2.2 one block", "[crypto_provider]")
 TEST_CASE ("aesCbc bit-padding round-trip", "[crypto_provider]")
 TEST_CASE ("ecdh shared secret symmetry secp256r1", "[crypto_provider]")
 TEST_CASE ("random returns true and produces distinct draws", "[crypto_provider]")

Variables

static ESP32CryptoProvider s_provider

Macro Definition Documentation

◆ TV_AES_BLOCK_BYTES

#define TV_AES_BLOCK_BYTES   (16U)

Definition at line 21 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ TV_AES_IV_BYTES

#define TV_AES_IV_BYTES   (16U)

Definition at line 20 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ TV_AES_KEY_BYTES

#define TV_AES_KEY_BYTES   (16U)

Definition at line 19 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().

◆ TV_BIT_PAD_INPUT_BYTES

#define TV_BIT_PAD_INPUT_BYTES   (3U) /* plaintext shorter than one AES block */

Definition at line 25 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

◆ TV_EC_COORD_BYTES

#define TV_EC_COORD_BYTES   (32U)

Definition at line 22 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

◆ TV_EC_PUBKEY_BYTES

#define TV_EC_PUBKEY_BYTES   (64U)

Definition at line 23 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

◆ TV_RANDOM_BYTES

#define TV_RANDOM_BYTES   (32U)

Definition at line 24 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

◆ TV_SHA256_OUT_BYTES

#define TV_SHA256_OUT_BYTES   (32U)

Definition at line 17 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

◆ TV_SHA512_OUT_BYTES

#define TV_SHA512_OUT_BYTES   (64U)

Definition at line 18 of file test_esp32_crypto_provider.cpp.

Referenced by TEST_CASE().

Function Documentation

◆ TEST_CASE() [1/7]

TEST_CASE ( "aesCbc bit-padding round-trip" ,
"" [crypto_provider] )

◆ TEST_CASE() [2/7]

TEST_CASE ( "aesCbcDecrypt NIST SP800-38A F.2.2 one block" ,
"" [crypto_provider] )

◆ TEST_CASE() [3/7]

TEST_CASE ( "aesCbcEncrypt NIST SP800-38A F.2.1 one block" ,
"" [crypto_provider] )

◆ TEST_CASE() [4/7]

TEST_CASE ( "ecdh shared secret symmetry secp256r1" ,
"" [crypto_provider] )

Definition at line 215 of file test_esp32_crypto_provider.cpp.

References s_provider, TV_EC_COORD_BYTES, and TV_EC_PUBKEY_BYTES.

◆ TEST_CASE() [5/7]

TEST_CASE ( "random returns true and produces distinct draws" ,
"" [crypto_provider] )

Definition at line 244 of file test_esp32_crypto_provider.cpp.

References s_provider, and TV_RANDOM_BYTES.

◆ TEST_CASE() [6/7]

TEST_CASE ( "sha256 NIST abc vector" ,
"" [crypto_provider] )

Definition at line 37 of file test_esp32_crypto_provider.cpp.

References s_provider, and TV_SHA256_OUT_BYTES.

◆ TEST_CASE() [7/7]

TEST_CASE ( "sha512 NIST abc vector" ,
"" [crypto_provider] )

Definition at line 65 of file test_esp32_crypto_provider.cpp.

References s_provider, and TV_SHA512_OUT_BYTES.

Variable Documentation

◆ s_provider