1818#include " basic_encryptor.h"
1919#include " ../exceptions.h"
2020#include " ../decoding_utils.h"
21+ #include " ../common/enums.h"
2122#include < gtest/gtest.h>
2223#include < vector>
2324
25+ using namespace dbps ::external;
26+
2427TEST (BasicEncryptor, EncryptDecryptBlock_RoundTrip) {
25- BasicEncryptor encryptor (" test_key" , " test_column" , " test_user" , " test_context" );
28+ BasicEncryptor encryptor (" test_key" , " test_column" , " test_user" , " test_context" , Type:: BYTE_ARRAY );
2629
2730 std::vector<uint8_t > original = {1 , 2 , 3 , 4 , 5 , 10 , 20 , 30 , 40 , 50 };
2831 std::vector<uint8_t > encrypted = encryptor.EncryptBlock (original);
@@ -33,7 +36,7 @@ TEST(BasicEncryptor, EncryptDecryptBlock_RoundTrip) {
3336}
3437
3538TEST (BasicEncryptor, EncryptBlock_EmptyData) {
36- BasicEncryptor encryptor (" test_key" , " test_column" , " test_user" , " test_context" );
39+ BasicEncryptor encryptor (" test_key" , " test_column" , " test_user" , " test_context" , Type:: BYTE_ARRAY );
3740
3841 std::vector<uint8_t > empty;
3942 std::vector<uint8_t > encrypted = encryptor.EncryptBlock (empty);
@@ -42,8 +45,8 @@ TEST(BasicEncryptor, EncryptBlock_EmptyData) {
4245}
4346
4447TEST (BasicEncryptor, EncryptBlock_DifferentKeys) {
45- BasicEncryptor encryptor1 (" key1" , " test_column" , " test_user" , " test_context" );
46- BasicEncryptor encryptor2 (" key2" , " test_column" , " test_user" , " test_context" );
48+ BasicEncryptor encryptor1 (" key1" , " test_column" , " test_user" , " test_context" , Type:: BYTE_ARRAY );
49+ BasicEncryptor encryptor2 (" key2" , " test_column" , " test_user" , " test_context" , Type:: BYTE_ARRAY );
4750
4851 std::vector<uint8_t > data = {1 , 2 , 3 , 4 , 5 };
4952 std::vector<uint8_t > encrypted1 = encryptor1.EncryptBlock (data);
0 commit comments