Electroneum
Loading...
Searching...
No Matches
chacha.cpp File Reference
#include <string>
#include "gtest/gtest.h"
#include "crypto/chacha.h"
Include dependency graph for chacha.cpp:

Go to the source code of this file.

Macros

#define ARR(...)
#define MAKE_TEST_DATA(index, key, iv, plain_text, cipher_text)
#define TEST_CHACHA8(test_no)

Macro Definition Documentation

◆ ARR

#define ARR ( ...)
Value:
__VA_ARGS__

Definition at line 48 of file chacha.cpp.

◆ MAKE_TEST_DATA

#define MAKE_TEST_DATA ( index,
key,
iv,
plain_text,
cipher_text )
Value:
static const uint8_t test_key_##index[] = key; \
static const uint8_t test_iv_##index[] = iv; \
static const uint8_t test_plain_text_##index[] = plain_text; \
static const uint8_t test_cipher_text_##index[] = cipher_text; \
static const test_data test_##index = {test_key_##index, test_iv_##index, sizeof(test_plain_text_##index), test_plain_text_##index, test_cipher_text_##index};
const char * key
unsigned char uint8_t
Definition stdint.h:124

Definition at line 50 of file chacha.cpp.

50 #define MAKE_TEST_DATA(index, key, iv, plain_text, cipher_text) \
51 static const uint8_t test_key_##index[] = key; \
52 static const uint8_t test_iv_##index[] = iv; \
53 static const uint8_t test_plain_text_##index[] = plain_text; \
54 static const uint8_t test_cipher_text_##index[] = cipher_text; \
55 static const test_data test_##index = {test_key_##index, test_iv_##index, sizeof(test_plain_text_##index), test_plain_text_##index, test_cipher_text_##index};

◆ TEST_CHACHA8

#define TEST_CHACHA8 ( test_no)
Value:
TEST(chacha8, is_correct_##test_no) \
{ \
run_test(&test_##test_no); \
}
void chacha8(const void *data, size_t length, const uint8_t *key, const uint8_t *iv, char *cipher)
#define TEST(test_case_name, test_name)
Definition gtest.h:2187

Definition at line 102 of file chacha.cpp.

102#define TEST_CHACHA8(test_no) \
103 TEST(chacha8, is_correct_##test_no) \
104 { \
105 run_test(&test_##test_no); \
106 }