-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IF: Change bls_public_key & bls_signature serialization #2338
Conversation
…ignature to be affine non-montgomery little-endian
Note:start |
…ernal tools like EOSJS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to change fixed array to vector for clients.
friend T& operator<<(T& ds, const bls_public_key& sig) { | ||
// Serialization as variable length array when it is stored as a fixed length array. This makes for easier deserialization by external tools | ||
fc::raw::pack(ds, fc::unsigned_int(static_cast<uint32_t>(sig._affine_non_montgomery_le.size()*sizeof(uint8_t)))); | ||
ds.write(reinterpret_cast<const char*>(sig._affine_non_montgomery_le.data()), sig._affine_non_montgomery_le.size()*sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not?
ds.write(reinterpret_cast<const char*>(sig._affine_non_montgomery_le.data()), sig._affine_non_montgomery_le.size()*sizeof(uint8_t)); | |
ds.write(reinterpret_cast<const char*>(sig._affine_non_montgomery_le.data()), sizeof(sig._affine_non_montgomery_le)); | |
Change
bls_public_key
andbls_signature
serialization to be:Add
bls_aggregate_signature
which is mutable version ofbls_signature
.bls_signature
is now immutable.Serialize as variable sized array and instead of a fixed sized array to make it easier to use in external tools that use ABI since our ABI does not handle fixed sized arrays.
Resolves #2334