Skip to content

Commit 22f76cf

Browse files
author
ubuntukylin 16
committed
update
1 parent d947c90 commit 22f76cf

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

src/GNUmakefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-include config.mk
22

3-
SHAIFHEPATH ?= $(HOME)/HElib/src
4-
NTLLIBPATH ?= $(HOME)/ntl-6.0.0-bin/lib
5-
NTLINCPATH ?= $(HOME)/ntl-6.0.0-bin/include
3+
SHAIFHEPATH ?= $(HOME)/Documents/HElib/src/
4+
NTLLIBPATH ?= /usr/local/lib/
5+
NTLINCPATH ?= /usr/local/include/NTL/
66
JSONCPP ?= /usr/include/jsoncpp
77

88
L_BOOST_SYSTEM ?= -lboost_system
@@ -35,7 +35,7 @@ CXXFLAGS := $(CXXOPT) -fno-strict-aliasing -fwrapv -fPIC \
3535
-fno-omit-frame-pointer -I$(TOP) -I$(SHAIFHEPATH) -I$(NTLINCPATH) -I$(JSONCPP)
3636

3737

38-
LDFLAGS := -lpthread -lrt -lgmp -lgmpxx -lgf2x
38+
LDFLAGS := -lpthread -lrt -lgmp -lgmpxx
3939
LDFLAGS += -L$(TOP)/$(OBJDIR) -Wl,-rpath=$(TOP)/$(OBJDIR)
4040

4141
PROTOC ?= protoc

src/mpc/change_encryption_scheme.cc

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Ctxt Change_ES_FHE_to_GM_A::unblind(const Ctxt &c, const FHEPubKey& publicKey, c
4141
if (coin_) {
4242
Ctxt d(c);
4343

44-
PlaintextArray array(ea);
45-
array.encode(1);
44+
NewPlaintextArray array(ea);
45+
encode(ea,array,1);
4646
ZZX poly;
4747
ea.encode(poly,array);
4848

@@ -58,8 +58,8 @@ Ctxt Change_ES_FHE_to_GM_A::unblind(const Ctxt &c, const FHEPubKey& publicKey, c
5858
Ctxt Change_ES_FHE_to_GM_B::decrypt_encrypt(const mpz_class &c, GM_priv &gm, const FHEPubKey &publicKey, const EncryptedArray &ea)
5959
{
6060
bool b = gm.decrypt(c);
61-
PlaintextArray array(ea);
62-
array.encode(b);
61+
NewPlaintextArray array(ea);
62+
encode(ea,array,b);
6363

6464
Ctxt c0(publicKey);
6565
ea.encrypt(c0, publicKey, array);
@@ -92,8 +92,8 @@ Ctxt Change_ES_FHE_to_GM_slots_A::unblind(const Ctxt &c, const FHEPubKey& public
9292
{
9393
Ctxt d(c);
9494

95-
PlaintextArray array(ea);
96-
array.encode(coins_);
95+
NewPlaintextArray array(ea);
96+
encode(ea,array,coins_);
9797
ZZX poly;
9898
ea.encode(poly,array);
9999

@@ -110,12 +110,12 @@ Ctxt Change_ES_FHE_to_GM_slots_B::decrypt_encrypt(const vector<mpz_class> &c, GM
110110
v[i] = gm.decrypt(c[i]);
111111
}
112112

113-
PlaintextArray array(ea);
114-
array.encode(v);
113+
NewPlaintextArray array(ea);
114+
encode(ea,array,v);
115115

116116
Ctxt c0(publicKey);
117117
ea.encrypt(c0, publicKey, array);
118118

119119
return c0;
120120

121-
}
121+
}

src/net/protocol_tester.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ void Tester_Client::test_fhe()
214214
bits[i] = gmp_urandomb_ui(rand_state_,1);
215215
}
216216

217-
PlaintextArray p0(ea);
218-
p0.encode(bits);
217+
NewPlaintextArray p0(ea);
218+
encode(ea,p0,bits);
219219
p0.print(cout);
220220

221221
Ctxt c0(*server_fhe_pk_);
@@ -434,7 +434,7 @@ void Tester_Server_session::test_change_es()
434434
Ctxt c = read_fhe_ctxt_from_socket(socket_, server_->fhe_sk());
435435

436436
EncryptedArray ea(server_->fhe_sk().getContext(), server_->fhe_G());
437-
PlaintextArray pp0(ea);
437+
NewPlaintextArray pp0(ea);
438438
ea.decrypt(c, server_->fhe_sk(), pp0);
439439
cout << id_ << ": Decryption result = " << endl;
440440
pp0.print(cout);
@@ -453,7 +453,7 @@ void Tester_Server_session::decrypt_fhe()
453453
Ctxt c = convert_from_message(m, server_->fhe_sk());
454454

455455
EncryptedArray ea(server_->fhe_sk().getContext(), server_->fhe_G());
456-
PlaintextArray pp0(ea);
456+
NewPlaintextArray pp0(ea);
457457
ea.decrypt(c, server_->fhe_sk(), pp0);
458458
cout << id_ << ": Decryption result = " << endl;
459459
pp0.print(cout);

src/tree/m_variate_poly.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ Ctxt evalPoly_FHE_timing(const Multivariate_poly< vector<long> > &poly, const ve
105105

106106
if (s == 0) {
107107
Ctxt c = Ctxt(pk);
108-
PlaintextArray pa(ea);
109-
pa.encode(0);
108+
NewPlaintextArray pa(ea);
109+
encode(ea,pa,0);
110110
ea.encrypt(c,pk,pa);
111111
return c;
112112
}
@@ -143,8 +143,8 @@ Ctxt evalPoly_FHE(const Multivariate_poly< vector<long> > &poly, const vector<Ct
143143

144144
if (s == 0) {
145145
Ctxt c = Ctxt(pk);
146-
PlaintextArray pa(ea);
147-
pa.encode(0);
146+
NewPlaintextArray pa(ea);
147+
encode(ea,pa,0);
148148
ea.encrypt(c,pk,pa);
149149
return c;
150150
}
@@ -156,4 +156,4 @@ Ctxt evalPoly_FHE(const Multivariate_poly< vector<long> > &poly, const vector<Ct
156156
}
157157

158158
return c;
159-
}
159+
}

src/tree/tree.hh

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ public:
131131
static Ctxt ctxt_neg(Ctxt &c, const EncryptedArray &ea)
132132
{
133133
Ctxt c_neg(c);
134-
PlaintextArray pa(ea);
135-
pa.encode(1);
134+
NewPlaintextArray pa(ea);
135+
encode(ea,pa,1);
136136
ZZX one;
137137
ea.encode(one, pa);
138138

0 commit comments

Comments
 (0)