AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::crypto::test Namespace Reference

Test cases for Cryptographic Functions Implementation. More...

Classes

class  MapCipher
 
class  MapDigest
 

Typedefs

typedef std::tuple< AlgorithmType, const OpenSslCryptoCodec::Key &, const std::string &, const std::string & > TestParams
 

Functions

static std::vector< unsigned char > hexStringToBytes (const std::string &hex)
 
static std::string bytesToHexString (const std::vector< unsigned char > &bytes)
 
static std::vector< unsigned char > stringToBytes (const std::string &str)
 
static std::string bytesToString (const std::vector< unsigned char > &bytes)
 
 TEST_P (AeAdCodecTest, test_encodeNoInit)
 
 TEST_P (AeAdCodecTest, test_decodeNoInit)
 
 TEST_P (AeAdCodecTest, test_encodeFinalizeNoInit)
 
 TEST_P (AeAdCodecTest, test_decodeFinalizeNoInit)
 
 TEST_P (AeAdCodecTest, test_encodeDecodeEmpty)
 
 TEST_P (AeAdCodecTest, test_encodeDecodeNonEmpty)
 
 TEST_P (AeAdCodecTest, test_encodeAadAfterProcess)
 
 TEST_P (AeAdCodecTest, test_decodeAadAfterProcess)
 
 TEST_P (AeAdCodecTest, test_encodeTestData)
 
 TEST_P (AeAdCodecTest, test_decodeTestData)
 
 TEST_P (AeAdCodecTest, test_decodeStringWrongTag)
 
 TEST_P (AeAdCodecTest, test_decodeStringNoTag)
 
 INSTANTIATE_TEST_CASE_P (OpenSslCryptoCodecAEADTest, AeAdCodecTest, Values(TestParams{AlgorithmType::AES_256_GCM, TEST_KEY256, TEST_TAG256, TEST_CIPHERTEXT256}, TestParams{AlgorithmType::AES_128_GCM, TEST_KEY128, TEST_TAG128, TEST_CIPHERTEXT128}))
 
static std::vector< unsigned char > hexStringToBytes (const std::string &hex)
 
static std::string bytesToHexString (const std::vector< unsigned char > &bytes)
 
static std::vector< unsigned char > stringToBytes (const std::string &str)
 
static std::string bytesToString (const std::vector< unsigned char > &bytes)
 
 TEST (OpenSslCryptoCodecTest, test_badAlgorithmEncoder)
 
 TEST (OpenSslCryptoCodecTest, test_badAlgorithmDecoder)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcEncoder)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcPadEncoder)
 
 TEST_P (GenericCodecTest, test_encodeNoInit)
 
 TEST_P (GenericCodecTest, test_decodeNoInit)
 
 TEST_P (GenericCodecTest, test_encodeFinalizeNoInit)
 
 TEST_P (GenericCodecTest, test_decodeFinalizeNoInit)
 
 TEST_P (GenericCodecTest, test_encoderInitBadIV)
 
 TEST_P (GenericCodecTest, test_decoderInitBadIV)
 
 TEST_P (GenericCodecTest, test_encoderInitBadKey)
 
 TEST_P (GenericCodecTest, test_decoderInitBadKey)
 
 TEST_P (GenericCodecTest, test_encodeDecodeEmpty)
 
 TEST_P (GenericCodecTest, test_encodeDecodeNonEmpty)
 
 TEST_P (GenericCodecTest, test_decodeEmptyError)
 
 INSTANTIATE_TEST_CASE_P (OpenSslCryptoCodecTest, GenericCodecTest, Values(AlgorithmType::AES_256_CBC, AlgorithmType::AES_256_CBC_PAD, AlgorithmType::AES_128_CBC, AlgorithmType::AES_128_CBC_PAD))
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcPadEncodeEmpty)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcEncodeZeroIV)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcPadEncodeZeroIV)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcEncodeNonEmptyIV)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcPadEncodeNonEmptyIV)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcPadDecodeEmptyError)
 
 TEST (OpenSslCryptoCodecTest, test_aes256CbcDecodeString)
 
 TEST (OpenSslCryptoFactoryTest, test_createNotNull)
 
 TEST (OpenSslCryptoFactoryTest, test_createTools)
 
 TEST (OpenSslCryptoFactoryTest, test_createUnknownTools)
 
 TEST (OpenSslCryptoFactoryTest, test_encryptDecrypt)
 
 TEST_P (OpenSslDigestCreateFixture, test_create)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestCreateFixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, ""), OpenSslDigestTestData(DigestType::MD5, "")))
 
 TEST (OpenSslDigestTest, test_createInvalid)
 
 TEST_P (OpenSslDigestEmptyFixture, test_emptyDigest)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestEmptyFixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_EMPTY_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_EMPTY_HEX)))
 
 TEST_P (OpenSslDigestTestDataFixture, test_digest)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestTestDataFixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_TEST_DATA_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_TEST_DATA_HEX)))
 
 TEST_P (OpenSslDigestUInt8Fixture, test_digestUInt8)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestUInt8Fixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT8_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT8_HEX)))
 
 TEST_P (OpenSslDigestUInt16Fixture, test_digestUInt16)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestUInt16Fixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UNT16_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UNT16_HEX)))
 
 TEST_P (OpenSslDigestUInt32Fixture, test_digestUInt32)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestUInt32Fixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT32_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT32_HEX)))
 
 TEST_P (OpenSslDigestUInt64Fixture, test_digestUInt64)
 
 INSTANTIATE_TEST_CASE_P (Parameterized, OpenSslDigestUInt64Fixture, ::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT64_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT64_HEX)))
 
 TEST_P (KeyFactoryTest, testCreateUniqueKeys)
 
 TEST_P (KeyFactoryTest, testCreateUniqueIVs)
 
 TEST_F (KeyFactoryTest, test_createKeyUnknown)
 
 TEST_F (KeyFactoryTest, test_createIvUnknown)
 
 INSTANTIATE_TEST_CASE_P (OpenSslKeyFactoryTest, KeyFactoryTest, Values(AlgorithmType::AES_256_CBC, AlgorithmType::AES_256_CBC_PAD, AlgorithmType::AES_128_CBC, AlgorithmType::AES_128_CBC_PAD, AlgorithmType::AES_128_GCM, AlgorithmType::AES_256_GCM))
 
 TEST_P (MapDigest, testMapDigest)
 
 INSTANTIATE_TEST_CASE_P (OpenSslTypeMapperTest, MapDigest, Values(std::pair< DigestType, const EVP_MD *>{DigestType::SHA_256, EVP_sha256()}))
 
 TEST (OpenSslTypeMapperTest, test_unknownDigest)
 
 TEST_P (MapCipher, testCipherMap)
 
 INSTANTIATE_TEST_CASE_P (OpenSslTypeMapperTest, MapCipher, Values(std::pair< AlgorithmType, const EVP_CIPHER *>{AlgorithmType::AES_256_CBC, EVP_aes_256_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER *>{AlgorithmType::AES_256_CBC_PAD, EVP_aes_256_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER *>{AlgorithmType::AES_128_CBC, EVP_aes_128_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER *>{AlgorithmType::AES_128_CBC_PAD, EVP_aes_128_cbc()}))
 
 TEST (OpenSslTypeMapperTest, test_unknownAlgorithm)
 

Variables

static const std::string TEST_STR {"The quick brown fox jumps over the lazy dog"}
 Test string for encryption and decryption. More...
 
static const std::string TEST_AD {"Authentication data"}
 Test authentication data for encryption and decryption. More...
 
const OpenSslCryptoCodec::IV TEST_IV = hexStringToBytes("0EB033BB783123FBA5391E94")
 Initialization vector. More...
 
const OpenSslCryptoCodec::Key TEST_KEY128 = hexStringToBytes("3595292D00F5F379C231DD785609C3F1")
 AES-128 bit key. More...
 
const OpenSslCryptoCodec::Key TEST_KEY256
 AES-256 bit key. More...
 
const std::string TEST_TAG128 {"0554a0cb6e9d120b041a246c0376b02b"}
 MAC for encrypting TEST_STR with TEST_KEY128 and TEST_IV. More...
 
const std::string TEST_TAG256 {"d79fbdd28e70ff74f267301f51c2471e"}
 MAC for encrypting TEST_STR with TEST_KEY256 and TEST_IV. More...
 
const std::string TEST_TAGBAD {"00000000000000000000000000000000"}
 Random MAC code. More...
 
const std::string TEST_CIPHERTEXT128
 Ciphertext from encrypting TEST_STR with TEST_KEY128 and TEST_IV. More...
 
const std::string TEST_CIPHERTEXT256
 Ciphertext from encrypting TEST_STR with TEST_KEY256 and TEST_IV. More...
 
const std::string TEST_STR2 = "The quick brown fox jumps over the lazy dog....."
 
const OpenSslCryptoCodec::Key ZERO_KEY
 
const OpenSslCryptoCodec::IV IV0 = hexStringToBytes("00000000000000000000000000000000")
 Zero IV. More...
 
const OpenSslCryptoCodec::IV IVR = hexStringToBytes("0123456789abcdef0123456789abcdef")
 Random IV. More...
 
const OpenSslCryptoCodec::IV IVB = hexStringToBytes("0123456789")
 Bad IV. More...
 
const std::string AES256CBCPAD_CIPHERTEXT_IVR
 Test string encrypted with AES-256-CBC-PAD with IVR. More...
 
const std::string AES256CBCPAD_CIPHERTEXT_IV0
 Test string encrypted with AES-256-CBC-PAD with IV0. More...
 
const std::string AES256CBC_CIPHERTEXT_IVR
 Test string 2 encrypted with AES-256-CBC with IVR. More...
 
const std::string AES256CBC_CIPHERTEXT_IV0
 Test string 2 encrypted with AES-256-CBC with IV0. More...
 
static const char TEST_STR [] = "The quick brown fox jumps over the lazy dog"
 
static const std::vector< unsigned char > TEST_DATA {TEST_STR, TEST_STR + sizeof(TEST_STR) - 1}
 
static const uint8_t TEST_UINT8 = 1
 
static const uint16_t TEST_UINT16 = 1
 
static const uint32_t TEST_UINT32 = 1
 
static const uint64_t TEST_UINT64 = 1
 
static const std::string SHA256_EMPTY_HEX {"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
 
static const std::string SHA256_TEST_DATA_HEX {"d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"}
 
static const std::string SHA256_UINT8_HEX {"4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a"}
 
static const std::string SHA256_UNT16_HEX {"b413f47d13ee2fe6c845b2ee141af81de858df4ec549a58b7970bb96645bc8d2"}
 
static const std::string SHA256_UINT32_HEX {"b40711a88c7039756fb8a73827eabe2c0fe5a0346ca7e0a104adc0fc764f528d"}
 
static const std::string SHA256_UINT64_HEX {"cd2662154e6d76b2b2b92e70c0cac3ccf534f9b74eb5b89819ec509083d00a50"}
 
static const std::string MD5_EMPTY_HEX {"d41d8cd98f00b204e9800998ecf8427e"}
 
static const std::string MD5_TEST_DATA_HEX {"9e107d9d372bb6826bd81d3542a419d6"}
 
static const std::string MD5_UINT8_HEX {"55a54008ad1ba589aa210d2629c1df41"}
 
static const std::string MD5_UNT16_HEX {"441077cc9e57554dd476bdfb8b8b8102"}
 
static const std::string MD5_UINT32_HEX {"f1450306517624a57eafbbf8ed995985"}
 
static const std::string MD5_UINT64_HEX {"fa5ad9a8557e5a84cf23e52d3d3adf77"}
 
static constexpr DigestType BAD_DIGEST_TYPE = static_cast<DigestType>(0)
 
static constexpr size_t AES_256_KEY_SIZE = 32u
 
static constexpr size_t AES_128_KEY_SIZE = 16u
 
static constexpr size_t AES_CBC_IV_SIZE = 16u
 
static constexpr size_t AES_GCM_IV_SIZE = 12u
 
static constexpr AlgorithmType BAD_ALGORITHM_TYPE = static_cast<AlgorithmType>(0)
 

Detailed Description

Test cases for Cryptographic Functions Implementation.

See also
Cryptographic Functions Implementation

Typedef Documentation

◆ TestParams

typedef std::tuple<AlgorithmType, const OpenSslCryptoCodec::Key&, const std::string&, const std::string&> alexaClientSDK::crypto::test::TestParams

Test parameter type.

Tests take algorithm type, key, tag, and ciphertext as input.

Function Documentation

◆ bytesToHexString() [1/2]

static std::string alexaClientSDK::crypto::test::bytesToHexString ( const std::vector< unsigned char > &  bytes)
static

◆ bytesToHexString() [2/2]

static std::string alexaClientSDK::crypto::test::bytesToHexString ( const std::vector< unsigned char > &  bytes)
static

◆ bytesToString() [1/2]

static std::string alexaClientSDK::crypto::test::bytesToString ( const std::vector< unsigned char > &  bytes)
static

◆ bytesToString() [2/2]

static std::string alexaClientSDK::crypto::test::bytesToString ( const std::vector< unsigned char > &  bytes)
static

◆ hexStringToBytes() [1/2]

static std::vector< unsigned char > alexaClientSDK::crypto::test::hexStringToBytes ( const std::string &  hex)
static

◆ hexStringToBytes() [2/2]

static std::vector<unsigned char> alexaClientSDK::crypto::test::hexStringToBytes ( const std::string &  hex)
static

◆ INSTANTIATE_TEST_CASE_P() [1/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( OpenSslTypeMapperTest  ,
MapDigest  ,
Values(std::pair< DigestType, const EVP_MD * >{DigestType::SHA_256, EVP_sha256()})   
)

◆ INSTANTIATE_TEST_CASE_P() [2/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( OpenSslTypeMapperTest  ,
MapCipher  ,
Values(std::pair< AlgorithmType, const EVP_CIPHER * >{AlgorithmType::AES_256_CBC, EVP_aes_256_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER * >{AlgorithmType::AES_256_CBC_PAD, EVP_aes_256_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER * >{AlgorithmType::AES_128_CBC, EVP_aes_128_cbc()}, std::pair< AlgorithmType, const EVP_CIPHER * >{AlgorithmType::AES_128_CBC_PAD, EVP_aes_128_cbc()})   
)

◆ INSTANTIATE_TEST_CASE_P() [3/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestCreateFixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, ""), OpenSslDigestTestData(DigestType::MD5, ""))   
)

◆ INSTANTIATE_TEST_CASE_P() [4/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( OpenSslKeyFactoryTest  ,
KeyFactoryTest  ,
Values(AlgorithmType::AES_256_CBC, AlgorithmType::AES_256_CBC_PAD, AlgorithmType::AES_128_CBC, AlgorithmType::AES_128_CBC_PAD, AlgorithmType::AES_128_GCM, AlgorithmType::AES_256_GCM)   
)

◆ INSTANTIATE_TEST_CASE_P() [5/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestEmptyFixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_EMPTY_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_EMPTY_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [6/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestTestDataFixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_TEST_DATA_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_TEST_DATA_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [7/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestUInt8Fixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT8_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT8_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [8/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestUInt16Fixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UNT16_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UNT16_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [9/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestUInt32Fixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT32_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT32_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [10/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( Parameterized  ,
OpenSslDigestUInt64Fixture  ,
::testing::Values(OpenSslDigestTestData(DigestType::SHA_256, SHA256_UINT64_HEX), OpenSslDigestTestData(DigestType::MD5, MD5_UINT64_HEX))   
)

◆ INSTANTIATE_TEST_CASE_P() [11/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( OpenSslCryptoCodecTest  ,
GenericCodecTest  ,
Values(AlgorithmType::AES_256_CBC, AlgorithmType::AES_256_CBC_PAD, AlgorithmType::AES_128_CBC, AlgorithmType::AES_128_CBC_PAD)   
)

◆ INSTANTIATE_TEST_CASE_P() [12/12]

alexaClientSDK::crypto::test::INSTANTIATE_TEST_CASE_P ( OpenSslCryptoCodecAEADTest  ,
AeAdCodecTest  ,
Values(TestParams{AlgorithmType::AES_256_GCM, TEST_KEY256, TEST_TAG256, TEST_CIPHERTEXT256}, TestParams{AlgorithmType::AES_128_GCM, TEST_KEY128, TEST_TAG128, TEST_CIPHERTEXT128})   
)

◆ stringToBytes() [1/2]

static std::vector<unsigned char> alexaClientSDK::crypto::test::stringToBytes ( const std::string &  str)
static

◆ stringToBytes() [2/2]

static std::vector<unsigned char> alexaClientSDK::crypto::test::stringToBytes ( const std::string &  str)
static

◆ TEST() [1/18]

alexaClientSDK::crypto::test::TEST ( OpenSslTypeMapperTest  ,
test_unknownDigest   
)

◆ TEST() [2/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoFactoryTest  ,
test_createNotNull   
)

◆ TEST() [3/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoFactoryTest  ,
test_createTools   
)

◆ TEST() [4/18]

alexaClientSDK::crypto::test::TEST ( OpenSslTypeMapperTest  ,
test_unknownAlgorithm   
)

◆ TEST() [5/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoFactoryTest  ,
test_createUnknownTools   
)

◆ TEST() [6/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_badAlgorithmEncoder   
)

◆ TEST() [7/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoFactoryTest  ,
test_encryptDecrypt   
)

◆ TEST() [8/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_badAlgorithmDecoder   
)

◆ TEST() [9/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcEncoder   
)

◆ TEST() [10/18]

alexaClientSDK::crypto::test::TEST ( OpenSslDigestTest  ,
test_createInvalid   
)

◆ TEST() [11/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcPadEncoder   
)

◆ TEST() [12/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcPadEncodeEmpty   
)

◆ TEST() [13/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcEncodeZeroIV   
)

◆ TEST() [14/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcPadEncodeZeroIV   
)

◆ TEST() [15/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcEncodeNonEmptyIV   
)

◆ TEST() [16/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcPadEncodeNonEmptyIV   
)

◆ TEST() [17/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcPadDecodeEmptyError   
)

◆ TEST() [18/18]

alexaClientSDK::crypto::test::TEST ( OpenSslCryptoCodecTest  ,
test_aes256CbcDecodeString   
)

◆ TEST_F() [1/2]

alexaClientSDK::crypto::test::TEST_F ( KeyFactoryTest  ,
test_createKeyUnknown   
)

◆ TEST_F() [2/2]

alexaClientSDK::crypto::test::TEST_F ( KeyFactoryTest  ,
test_createIvUnknown   
)

◆ TEST_P() [1/34]

alexaClientSDK::crypto::test::TEST_P ( MapDigest  ,
testMapDigest   
)

◆ TEST_P() [2/34]

alexaClientSDK::crypto::test::TEST_P ( KeyFactoryTest  ,
testCreateUniqueKeys   
)

◆ TEST_P() [3/34]

alexaClientSDK::crypto::test::TEST_P ( MapCipher  ,
testCipherMap   
)

◆ TEST_P() [4/34]

alexaClientSDK::crypto::test::TEST_P ( KeyFactoryTest  ,
testCreateUniqueIVs   
)

◆ TEST_P() [5/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestCreateFixture  ,
test_create   
)

◆ TEST_P() [6/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestEmptyFixture  ,
test_emptyDigest   
)

◆ TEST_P() [7/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeNoInit   
)

◆ TEST_P() [8/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encodeNoInit   
)

◆ TEST_P() [9/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeNoInit   
)

◆ TEST_P() [10/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_decodeNoInit   
)

◆ TEST_P() [11/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestTestDataFixture  ,
test_digest   
)

◆ TEST_P() [12/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeFinalizeNoInit   
)

◆ TEST_P() [13/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encodeFinalizeNoInit   
)

◆ TEST_P() [14/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeFinalizeNoInit   
)

◆ TEST_P() [15/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_decodeFinalizeNoInit   
)

◆ TEST_P() [16/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encoderInitBadIV   
)

◆ TEST_P() [17/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeDecodeEmpty   
)

◆ TEST_P() [18/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestUInt8Fixture  ,
test_digestUInt8   
)

◆ TEST_P() [19/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_decoderInitBadIV   
)

◆ TEST_P() [20/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encoderInitBadKey   
)

◆ TEST_P() [21/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_decoderInitBadKey   
)

◆ TEST_P() [22/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestUInt16Fixture  ,
test_digestUInt16   
)

◆ TEST_P() [23/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encodeDecodeEmpty   
)

◆ TEST_P() [24/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeDecodeNonEmpty   
)

◆ TEST_P() [25/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestUInt32Fixture  ,
test_digestUInt32   
)

◆ TEST_P() [26/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_encodeDecodeNonEmpty   
)

◆ TEST_P() [27/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeAadAfterProcess   
)

◆ TEST_P() [28/34]

alexaClientSDK::crypto::test::TEST_P ( OpenSslDigestUInt64Fixture  ,
test_digestUInt64   
)

◆ TEST_P() [29/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeAadAfterProcess   
)

◆ TEST_P() [30/34]

alexaClientSDK::crypto::test::TEST_P ( GenericCodecTest  ,
test_decodeEmptyError   
)

◆ TEST_P() [31/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_encodeTestData   
)

◆ TEST_P() [32/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeTestData   
)

◆ TEST_P() [33/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeStringWrongTag   
)

◆ TEST_P() [34/34]

alexaClientSDK::crypto::test::TEST_P ( AeAdCodecTest  ,
test_decodeStringNoTag   
)

Variable Documentation

◆ AES256CBC_CIPHERTEXT_IV0

const std::string alexaClientSDK::crypto::test::AES256CBC_CIPHERTEXT_IV0
Initial value:
=
"6db0c67c0cf728b37640f65f0e7db88f5cd217822b08cbad8817dda0f194766832570123a3c6dd75c19fd304f9321b6f"

Test string 2 encrypted with AES-256-CBC with IV0.

◆ AES256CBC_CIPHERTEXT_IVR

const std::string alexaClientSDK::crypto::test::AES256CBC_CIPHERTEXT_IVR
Initial value:
=
"0df523194582f51a623a9ad0395d5ed62f7880b70e14818f7648fb01999bca27cd24efc62c1b96e0c14b661d4ef5cdf9"

Test string 2 encrypted with AES-256-CBC with IVR.

◆ AES256CBCPAD_CIPHERTEXT_IV0

const std::string alexaClientSDK::crypto::test::AES256CBCPAD_CIPHERTEXT_IV0
Initial value:
=
"6db0c67c0cf728b37640f65f0e7db88f5cd217822b08cbad8817dda0f19476684d05a1b1c6a7b5184510b3a0e43b552a"

Test string encrypted with AES-256-CBC-PAD with IV0.

◆ AES256CBCPAD_CIPHERTEXT_IVR

const std::string alexaClientSDK::crypto::test::AES256CBCPAD_CIPHERTEXT_IVR
Initial value:
=
"0df523194582f51a623a9ad0395d5ed62f7880b70e14818f7648fb01999bca27f955aac7e15dff71944d952de2ca9e99"

Test string encrypted with AES-256-CBC-PAD with IVR.

◆ AES_128_KEY_SIZE

constexpr size_t alexaClientSDK::crypto::test::AES_128_KEY_SIZE = 16u
static

◆ AES_256_KEY_SIZE

constexpr size_t alexaClientSDK::crypto::test::AES_256_KEY_SIZE = 32u
static

◆ AES_CBC_IV_SIZE

constexpr size_t alexaClientSDK::crypto::test::AES_CBC_IV_SIZE = 16u
static

◆ AES_GCM_IV_SIZE

constexpr size_t alexaClientSDK::crypto::test::AES_GCM_IV_SIZE = 12u
static

◆ BAD_ALGORITHM_TYPE

constexpr AlgorithmType alexaClientSDK::crypto::test::BAD_ALGORITHM_TYPE = static_cast<AlgorithmType>(0)
static

◆ BAD_DIGEST_TYPE

constexpr DigestType alexaClientSDK::crypto::test::BAD_DIGEST_TYPE = static_cast<DigestType>(0)
static

◆ IV0

const OpenSslCryptoCodec::IV alexaClientSDK::crypto::test::IV0 = hexStringToBytes("00000000000000000000000000000000")

Zero IV.

◆ IVB

const OpenSslCryptoCodec::IV alexaClientSDK::crypto::test::IVB = hexStringToBytes("0123456789")

Bad IV.

◆ IVR

const OpenSslCryptoCodec::IV alexaClientSDK::crypto::test::IVR = hexStringToBytes("0123456789abcdef0123456789abcdef")

Random IV.

◆ MD5_EMPTY_HEX

const std::string alexaClientSDK::crypto::test::MD5_EMPTY_HEX {"d41d8cd98f00b204e9800998ecf8427e"}
static

◆ MD5_TEST_DATA_HEX

const std::string alexaClientSDK::crypto::test::MD5_TEST_DATA_HEX {"9e107d9d372bb6826bd81d3542a419d6"}
static

◆ MD5_UINT32_HEX

const std::string alexaClientSDK::crypto::test::MD5_UINT32_HEX {"f1450306517624a57eafbbf8ed995985"}
static

◆ MD5_UINT64_HEX

const std::string alexaClientSDK::crypto::test::MD5_UINT64_HEX {"fa5ad9a8557e5a84cf23e52d3d3adf77"}
static

◆ MD5_UINT8_HEX

const std::string alexaClientSDK::crypto::test::MD5_UINT8_HEX {"55a54008ad1ba589aa210d2629c1df41"}
static

◆ MD5_UNT16_HEX

const std::string alexaClientSDK::crypto::test::MD5_UNT16_HEX {"441077cc9e57554dd476bdfb8b8b8102"}
static

◆ SHA256_EMPTY_HEX

const std::string alexaClientSDK::crypto::test::SHA256_EMPTY_HEX {"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
static

◆ SHA256_TEST_DATA_HEX

const std::string alexaClientSDK::crypto::test::SHA256_TEST_DATA_HEX {"d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"}
static

◆ SHA256_UINT32_HEX

const std::string alexaClientSDK::crypto::test::SHA256_UINT32_HEX {"b40711a88c7039756fb8a73827eabe2c0fe5a0346ca7e0a104adc0fc764f528d"}
static

◆ SHA256_UINT64_HEX

const std::string alexaClientSDK::crypto::test::SHA256_UINT64_HEX {"cd2662154e6d76b2b2b92e70c0cac3ccf534f9b74eb5b89819ec509083d00a50"}
static

◆ SHA256_UINT8_HEX

const std::string alexaClientSDK::crypto::test::SHA256_UINT8_HEX {"4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a"}
static

◆ SHA256_UNT16_HEX

const std::string alexaClientSDK::crypto::test::SHA256_UNT16_HEX {"b413f47d13ee2fe6c845b2ee141af81de858df4ec549a58b7970bb96645bc8d2"}
static

◆ TEST_AD

const std::string alexaClientSDK::crypto::test::TEST_AD {"Authentication data"}
static

Test authentication data for encryption and decryption.

◆ TEST_CIPHERTEXT128

const std::string alexaClientSDK::crypto::test::TEST_CIPHERTEXT128
Initial value:
{
"40d7b2a1e750f8e3d731424f7536b4a113b77ca248c3356075d3a9cfedcd7fae84ea2d7983e86f9581833f"}

Ciphertext from encrypting TEST_STR with TEST_KEY128 and TEST_IV.

◆ TEST_CIPHERTEXT256

const std::string alexaClientSDK::crypto::test::TEST_CIPHERTEXT256
Initial value:
{
"f940a05f273315d1fae75e4fc68f401848051231d7c20319ea7efaa7eb6166b56fcfb790056fc84a912050"}

Ciphertext from encrypting TEST_STR with TEST_KEY256 and TEST_IV.

◆ TEST_DATA

const std::vector<unsigned char> alexaClientSDK::crypto::test::TEST_DATA {TEST_STR, TEST_STR + sizeof(TEST_STR) - 1}
static

◆ TEST_IV

const OpenSslCryptoCodec::IV alexaClientSDK::crypto::test::TEST_IV = hexStringToBytes("0EB033BB783123FBA5391E94")

Initialization vector.

◆ TEST_KEY128

const OpenSslCryptoCodec::Key alexaClientSDK::crypto::test::TEST_KEY128 = hexStringToBytes("3595292D00F5F379C231DD785609C3F1")

AES-128 bit key.

◆ TEST_KEY256

const OpenSslCryptoCodec::Key alexaClientSDK::crypto::test::TEST_KEY256
Initial value:
=
hexStringToBytes("829E7C69986F36F0F3116F3D3F9E941839193C3849D6CCCCA42AA734792A7081")
static std::vector< unsigned char > hexStringToBytes(const std::string &hex)
Definition: OpenSslCryptoCodecAEADTest.cpp:60

AES-256 bit key.

◆ TEST_STR [1/2]

const char alexaClientSDK::crypto::test::TEST_STR[] = "The quick brown fox jumps over the lazy dog"
static

◆ TEST_STR [2/2]

const std::string alexaClientSDK::crypto::test::TEST_STR {"The quick brown fox jumps over the lazy dog"}
static

Test string for encryption and decryption.

◆ TEST_STR2

const std::string alexaClientSDK::crypto::test::TEST_STR2 = "The quick brown fox jumps over the lazy dog....."

◆ TEST_TAG128

const std::string alexaClientSDK::crypto::test::TEST_TAG128 {"0554a0cb6e9d120b041a246c0376b02b"}

MAC for encrypting TEST_STR with TEST_KEY128 and TEST_IV.

◆ TEST_TAG256

const std::string alexaClientSDK::crypto::test::TEST_TAG256 {"d79fbdd28e70ff74f267301f51c2471e"}

MAC for encrypting TEST_STR with TEST_KEY256 and TEST_IV.

◆ TEST_TAGBAD

const std::string alexaClientSDK::crypto::test::TEST_TAGBAD {"00000000000000000000000000000000"}

Random MAC code.

◆ TEST_UINT16

const uint16_t alexaClientSDK::crypto::test::TEST_UINT16 = 1
static

◆ TEST_UINT32

const uint32_t alexaClientSDK::crypto::test::TEST_UINT32 = 1
static

◆ TEST_UINT64

const uint64_t alexaClientSDK::crypto::test::TEST_UINT64 = 1
static

◆ TEST_UINT8

const uint8_t alexaClientSDK::crypto::test::TEST_UINT8 = 1
static

◆ ZERO_KEY

const OpenSslCryptoCodec::Key alexaClientSDK::crypto::test::ZERO_KEY
Initial value:
=
hexStringToBytes("0000000000000000000000000000000000000000000000000000000000000000")
static std::vector< unsigned char > hexStringToBytes(const std::string &hex)
Definition: OpenSslCryptoCodecTest.cpp:38

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0