-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ipe_et.cpp
More file actions
29 lines (20 loc) · 759 Bytes
/
Copy pathtest_ipe_et.cpp
File metadata and controls
29 lines (20 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <gtest/gtest.h>
#include "ipe_et.hpp"
TEST(IpeEtTests, AggreTrue){
const auto pp = IpeEt::pp_gen(10);
const auto msk = IpeEt::msk_gen(pp);
const IntVec x = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
const IntVec y = {1, 1, 1, 1, 1, 0, 0, 0, 0, 2};
const auto ct = IpeEt::enc(pp, msk, x);
const auto sk = IpeEt::keygen(pp, msk, y, 35);
EXPECT_TRUE(IpeEt::dec(ct, sk));
}
TEST(IpeEtTests, AggreFalse){
const auto pp = IpeEt::pp_gen(10);
const auto msk = IpeEt::msk_gen(pp);
const IntVec x = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
const IntVec y = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
const auto ct = IpeEt::enc(pp, msk, x);
const auto sk = IpeEt::keygen(pp, msk, y, 100);
EXPECT_FALSE(IpeEt::dec(ct, sk));
}