forked frombristolcrypto/SPDZ-2
- Notifications
You must be signed in to change notification settings - Fork291
Closed
Description
Hello Marcel,
I am creating a data type that uses a vector ofNTL::GF2X
polynomials namedvalue
and am trying to figure out how to pack and unpack it. I came up with the following. Does it seem along the right lines? (BTW, modulus is the polynomial used to initialize theGF2E
I am using.)
void pack(octetStream& stream) { stream.store(value.length()); size_t numBytes = deg(modulus) + 1; for(auto& poly: value) { unsigned char* c; NTL::BytesFromGF2X(c, poly, numBytes); stream.store_bytes(c, numBytes); }}void unpack(octetStream& stream) { long len; stream.get(len); size_t numBytes = deg(modulus) + 1; for(long i = 0; i < len; i++) { unsigned char* c; stream.get_bytes(c, numBytes); NTL::GF2XFromBytes(value[i], c, numBytes); }}
Metadata
Metadata
Assignees
Labels
No labels