Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Packing and unpacking vector of NTL polynomials #1593

Closed
@sknc

Description

@sknc

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp