MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / encrypt

Method encrypt

FHE/FHE_Keys.cpp:141–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140template<class T, class FD, class S>
141void FHE_PK::encrypt(Ciphertext& c,
142 const Plaintext<T, FD, S>& mess,const Random_Coins& rc) const
143{
144 if (&c.get_params()!=params) { throw params_mismatch(); }
145 if (&rc.get_params()!=params) { throw params_mismatch(); }
146 if (T::characteristic_two ^ (pr == 2))
147 throw pr_mismatch();
148
149 Rq_Element mm((*params).FFTD(),polynomial,polynomial);
150 mm.from(mess.get_iterator());
151
152 quasi_encrypt(c,mm,rc);
153}
154
155void FHE_PK::quasi_encrypt(Ciphertext& c,
156 const Rq_Element& mess,const Random_Coins& rc) const

Callers 1

checkMethod · 0.60

Calls 8

params_mismatchClass · 0.85
pr_mismatchClass · 0.85
get_paramsMethod · 0.80
ReSeedMethod · 0.80
Rq_ElementClass · 0.70
fromMethod · 0.45
get_iteratorMethod · 0.45
generateMethod · 0.45

Tested by

no test coverage detected