void FHE_Params::pack(octetStream& o) const { o.store(FFTData.size()); for(auto& fd: FFTData) fd.pack(o); Chi.pack(o); Bval.pack(o); o.store(sec_p); }
void FHE_Params::unpack(octetStream& o) { size_t size; o.get(size); FFTData.resize(size); for (auto& fd : FFTData) fd.unpack(o); Chi.unpack(o); Bval.unpack(o); o.get(sec_p); }
void PRNG::get_octetStream(octetStream& ans,int len) { ans.resize(len); for (int i=0; i<len; i++) { ans.data[i]=get_uchar(); } ans.len=len; ans.ptr=0; }
void square128::unpack(octetStream &o) { o.consume((octet*)this->bytes, sizeof(bytes)); }
void square128::pack(octetStream& o) const { o.append((octet*)this->bytes, sizeof(bytes)); }
void modp::unpack(octetStream& o,const Zp_Data& ZpD) { o.consume((octet*) x,ZpD.t*sizeof(mp_limb_t)); }
void modp::pack(octetStream& o,const Zp_Data& ZpD) const { o.append((octet*) x,ZpD.t*sizeof(mp_limb_t)); }