#ifndef TA_SA_SVP_CRYPTO_H
#define TA_SA_SVP_CRYPTO_H
#include "sa_types.h"
#include "test_process_common_encryption.h"
#include "gtest/gtest.h"
class TaCryptoCipherBase {
protected:
static std::shared_ptr<sa_key> import_key(
std::vector<uint8_t>& clear_key,
bool svp);
static std::vector<uint8_t> encrypt_openssl(
sa_cipher_algorithm cipher_algorithm,
const std::vector<uint8_t>& in,
const std::vector<uint8_t>& iv,
const std::vector<uint8_t>& key);
};
typedef std::tuple<sa_cipher_algorithm, sa_cipher_mode, size_t, size_t> TaCryptoCipherTestType;
class TaCryptoCipherTest : public ::testing::TestWithParam<TaCryptoCipherTestType>, public TaCryptoCipherBase {
protected:
void SetUp() override;
};
using TaProcessCommonEncryptionType =
std::tuple<std::tuple<size_t, int64_t>, size_t, size_t, size_t, sa_cipher_algorithm>;
class TaProcessCommonEncryptionTest : public ::testing::TestWithParam<TaProcessCommonEncryptionType>,
public TaCryptoCipherBase,
public ProcessCommonEncryptionBase {
protected:
void SetUp() override;
sa_status svp_buffer_write(
sa_svp_buffer out,
const void* in,
size_t in_length) override;
};
#endif