@@ -1355,10 +1355,13 @@ TEST(TestGdvFnStubs, TestAesEncryptDecrypt16) {
1355
1355
auto data_len = static_cast <int32_t >(data.length ());
1356
1356
int64_t ctx_ptr = reinterpret_cast <int64_t >(&ctx);
1357
1357
1358
- const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key16.c_str (), key16_len, &cipher_len);
1359
- const char * decrypted_value = gdv_fn_aes_decrypt (ctx_ptr, cipher, cipher_len, key16.c_str (), key16_len, &decrypted_len);
1358
+ const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key16.c_str (),
1359
+ key16_len, &cipher_len);
1360
+ const char * decrypted_value = gdv_fn_aes_decrypt (
1361
+ ctx_ptr, cipher, cipher_len, key16.c_str (), key16_len, &decrypted_len);
1360
1362
1361
- EXPECT_EQ (data, std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1363
+ EXPECT_EQ (data,
1364
+ std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1362
1365
}
1363
1366
1364
1367
TEST (TestGdvFnStubs, TestAesEncryptDecrypt24) {
@@ -1371,11 +1374,14 @@ TEST(TestGdvFnStubs, TestAesEncryptDecrypt24) {
1371
1374
auto data_len = static_cast <int32_t >(data.length ());
1372
1375
int64_t ctx_ptr = reinterpret_cast <int64_t >(&ctx);
1373
1376
1374
- const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key24.c_str (), key24_len, &cipher_len);
1377
+ const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key24.c_str (),
1378
+ key24_len, &cipher_len);
1375
1379
1376
- const char * decrypted_value = gdv_fn_aes_decrypt (ctx_ptr, cipher, cipher_len, key24.c_str (), key24_len, &decrypted_len);
1380
+ const char * decrypted_value = gdv_fn_aes_decrypt (
1381
+ ctx_ptr, cipher, cipher_len, key24.c_str (), key24_len, &decrypted_len);
1377
1382
1378
- EXPECT_EQ (data, std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1383
+ EXPECT_EQ (data,
1384
+ std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1379
1385
}
1380
1386
1381
1387
TEST (TestGdvFnStubs, TestAesEncryptDecrypt32) {
@@ -1388,11 +1394,14 @@ TEST(TestGdvFnStubs, TestAesEncryptDecrypt32) {
1388
1394
auto data_len = static_cast <int32_t >(data.length ());
1389
1395
int64_t ctx_ptr = reinterpret_cast <int64_t >(&ctx);
1390
1396
1391
- const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key32.c_str (), key32_len, &cipher_len);
1397
+ const char * cipher = gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key32.c_str (),
1398
+ key32_len, &cipher_len);
1392
1399
1393
- const char * decrypted_value = gdv_fn_aes_decrypt (ctx_ptr, cipher, cipher_len, key32.c_str (), key32_len, &decrypted_len);
1400
+ const char * decrypted_value = gdv_fn_aes_decrypt (
1401
+ ctx_ptr, cipher, cipher_len, key32.c_str (), key32_len, &decrypted_len);
1394
1402
1395
- EXPECT_EQ (data, std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1403
+ EXPECT_EQ (data,
1404
+ std::string (reinterpret_cast <const char *>(decrypted_value), decrypted_len));
1396
1405
}
1397
1406
1398
1407
TEST (TestGdvFnStubs, TestAesEncryptDecryptValidation) {
@@ -1406,13 +1415,14 @@ TEST(TestGdvFnStubs, TestAesEncryptDecryptValidation) {
1406
1415
std::string cipher = " 12345678abcdefgh12345678abcdefghb" ;
1407
1416
auto cipher_len = static_cast <int32_t >(cipher.length ());
1408
1417
1409
- gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key33.c_str (), key33_len, &cipher_len);
1410
- EXPECT_THAT (ctx. get_error (),
1411
- ::testing::HasSubstr (" invalid key length" ));
1418
+ gdv_fn_aes_encrypt (ctx_ptr, data.c_str (), data_len, key33.c_str (), key33_len,
1419
+ &cipher_len);
1420
+ EXPECT_THAT (ctx. get_error (), ::testing::HasSubstr (" invalid key length" ));
1412
1421
ctx.Reset ();
1413
1422
1414
- gdv_fn_aes_decrypt (ctx_ptr, cipher.c_str (), cipher_len, key33.c_str (), key33_len, &decrypted_len); EXPECT_THAT (ctx.get_error (),
1415
- ::testing::HasSubstr (" invalid key length" ));
1423
+ gdv_fn_aes_decrypt (ctx_ptr, cipher.c_str (), cipher_len, key33.c_str (), key33_len,
1424
+ &decrypted_len);
1425
+ EXPECT_THAT (ctx.get_error (), ::testing::HasSubstr (" invalid key length" ));
1416
1426
ctx.Reset ();
1417
1427
}
1418
1428
} // namespace gandiva
0 commit comments