-
Notifications
You must be signed in to change notification settings - Fork 231
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
feat!(math): improve prime field (de)serialization #440
Conversation
@chokobole Please fix c67611f's commit message filed -> field. |
6c4f373
to
bcc4a37
Compare
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.
LGTM
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.
LGTM
…g json BREAKING CHANGE: This update simplifies the (de)serialization of prime fields in JSON. Previously, a prime field was (de)serialized as an object with a member 'value'. Now, it is (de)serialized directly as a hex string. For example, the value 3 was previously serialized as `{"value": "0x3"}` and is now serialized as "0x3".
BREAKING CHANGE: This update changes the (de)serialization of small prime fields in JSON to use numbers instead of hex strings. Given that the modulus of the small prime field is less than `uint32_t`, using JSON numbers is more appropriate. Previously, these values were (de)serialized as hex strings.
BREAKING CHANGE: This update changes the (de)serialization of small prime fields using `base::Copyable` to use `uint32_t` instead of `math::BigInt<N>`. Given that the modulus of the small prime field is less than `uint32_t`, using `uint32_t` is more appropriate. Previously, these values were (de)serialized as `math::BigInt<N>`.
bcc4a37
to
f76714d
Compare
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.
LGTM
Description
This PR improves prime field (de)serializations in several aspects.