Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CC32xxAesTest.hxx File Reference
#include "freertos_drivers/ti/CC32xxAes.hxx"
#include "freertos_drivers/ti/CC32xxHelper.hxx"
#include "freertos_drivers/ti/CC32xxSha.hxx"
#include "fs.h"
#include "utils/AesCcmTestVectors.hxx"
#include "utils/AesCcmTestVectorsEx.hxx"
#include "utils/ShaTestVectors.hxx"

Go to the source code of this file.

Macros

#define LOGLEVEL   INFO
 

Functions

int aes_test::nibble_to_int (char n)
 
std::string aes_test::hex2str (const char *hex)
 
std::string aes_test::str2hex (const string &s)
 
void aes_test::get_example (int index, string &Key, string &Nonce, string &Adata, string &Payload, string &CT)
 
void aes_test::get_sha_example (int index, string &Key, string &Hash, string &Payload)
 
void aes_test::printcomp (const string &exp, const string &act, const char *name)
 
bool aes_test::run_all_tests ()
 

Variables

const char aes_test::HEXCHR [17] = "0123456789abcdef"
 
bool aes_test::have_failure = false
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Test runner for the CC32xx AES-CCM and SHA tests.

Author
Balazs Racz
Date
29 July 2019

Definition in file CC32xxAesTest.hxx.

Macro Definition Documentation

◆ LOGLEVEL

#define LOGLEVEL   INFO

Definition at line 38 of file CC32xxAesTest.hxx.

Function Documentation

◆ get_example()

void aes_test::get_example ( int  index,
string &  Key,
string &  Nonce,
string &  Adata,
string &  Payload,
string &  CT 
)

Definition at line 90 of file CC32xxAesTest.hxx.

◆ get_sha_example()

void aes_test::get_sha_example ( int  index,
string &  Key,
string &  Hash,
string &  Payload 
)

Definition at line 97 of file CC32xxAesTest.hxx.

◆ hex2str()

std::string aes_test::hex2str ( const char *  hex)

Definition at line 64 of file CC32xxAesTest.hxx.

◆ nibble_to_int()

int aes_test::nibble_to_int ( char  n)

Definition at line 47 of file CC32xxAesTest.hxx.

◆ printcomp()

void aes_test::printcomp ( const string &  exp,
const string &  act,
const char *  name 
)

Definition at line 104 of file CC32xxAesTest.hxx.

◆ run_all_tests()

bool aes_test::run_all_tests ( )
Returns
true if the tests passed, false if they failed.

Definition at line 116 of file CC32xxAesTest.hxx.

◆ str2hex()

std::string aes_test::str2hex ( const string &  s)

Definition at line 81 of file CC32xxAesTest.hxx.

Variable Documentation

◆ have_failure

bool aes_test::have_failure = false

Definition at line 102 of file CC32xxAesTest.hxx.

◆ HEXCHR

const char aes_test::HEXCHR[17] = "0123456789abcdef"

Definition at line 79 of file CC32xxAesTest.hxx.