#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <vector>
#include <gtest/gtest.h>
#include <openssl/aes.h>
#include <openssl/cipher.h>
#include <openssl/err.h>
#include <openssl/nid.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/span.h>
#include "../test/file_test.h"
#include "../test/test_util.h"
#include "../test/wycheproof_util.h"
#include "./internal.h"
Go to the source code of this file.
|
static bool | DoCipher (EVP_CIPHER_CTX *ctx, std::vector< uint8_t > *out, bssl::Span< const uint8_t > in, size_t chunk, bool in_place) |
|
static const EVP_CIPHER * | GetCipher (const std::string &name) |
|
| TEST (CipherTest, CAVP_AES_128_CBC) |
|
| TEST (CipherTest, CAVP_AES_128_CTR) |
|
| TEST (CipherTest, CAVP_AES_192_CBC) |
|
| TEST (CipherTest, CAVP_AES_192_CTR) |
|
| TEST (CipherTest, CAVP_AES_256_CBC) |
|
| TEST (CipherTest, CAVP_AES_256_CTR) |
|
| TEST (CipherTest, CAVP_TDES_CBC) |
|
| TEST (CipherTest, CAVP_TDES_ECB) |
|
| TEST (CipherTest, GetCipher) |
|
| TEST (CipherTest, SHA1WithSecretSuffix) |
|
| TEST (CipherTest, TestVectors) |
|
| TEST (CipherTest, WycheproofAESCBC) |
|
static void | TestCipher (FileTest *t) |
|
static void | TestOperation (FileTest *t, const EVP_CIPHER *cipher, bool encrypt, bool copy, bool in_place, size_t chunk_size, const std::vector< uint8_t > &key, const std::vector< uint8_t > &iv, const std::vector< uint8_t > &plaintext, const std::vector< uint8_t > &ciphertext, const std::vector< uint8_t > &aad, const std::vector< uint8_t > &tag) |
|
◆ DoCipher()
◆ GetCipher()
◆ TEST() [1/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_128_CBC |
|
|
) |
| |
◆ TEST() [2/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_128_CTR |
|
|
) |
| |
◆ TEST() [3/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_192_CBC |
|
|
) |
| |
◆ TEST() [4/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_192_CTR |
|
|
) |
| |
◆ TEST() [5/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_256_CBC |
|
|
) |
| |
◆ TEST() [6/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_AES_256_CTR |
|
|
) |
| |
◆ TEST() [7/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_TDES_CBC |
|
|
) |
| |
◆ TEST() [8/12]
TEST |
( |
CipherTest |
, |
|
|
CAVP_TDES_ECB |
|
|
) |
| |
◆ TEST() [9/12]
◆ TEST() [10/12]
TEST |
( |
CipherTest |
, |
|
|
SHA1WithSecretSuffix |
|
|
) |
| |
◆ TEST() [11/12]
TEST |
( |
CipherTest |
, |
|
|
TestVectors |
|
|
) |
| |
◆ TEST() [12/12]
TEST |
( |
CipherTest |
, |
|
|
WycheproofAESCBC |
|
|
) |
| |
◆ TestCipher()
◆ TestOperation()
static void TestOperation |
( |
FileTest * |
t, |
|
|
const EVP_CIPHER * |
cipher, |
|
|
bool |
encrypt, |
|
|
bool |
copy, |
|
|
bool |
in_place, |
|
|
size_t |
chunk_size, |
|
|
const std::vector< uint8_t > & |
key, |
|
|
const std::vector< uint8_t > & |
iv, |
|
|
const std::vector< uint8_t > & |
plaintext, |
|
|
const std::vector< uint8_t > & |
ciphertext, |
|
|
const std::vector< uint8_t > & |
aad, |
|
|
const std::vector< uint8_t > & |
tag |
|
) |
| |
|
static |