Skip to content
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

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

chokobole
Copy link
Contributor

Description

This PR improves prime field (de)serializations in several aspects.

@TomTaehoonKim
Copy link
Contributor

@chokobole Please fix c67611f's commit message filed -> field.

@chokobole chokobole force-pushed the feat/improve-prime-field-de-serialization branch from 6c4f373 to bcc4a37 Compare June 18, 2024 07:42
Copy link
Contributor

@TomTaehoonKim TomTaehoonKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dongchangYoo dongchangYoo left a 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>`.
@chokobole chokobole force-pushed the feat/improve-prime-field-de-serialization branch from bcc4a37 to f76714d Compare June 19, 2024 11:40
Copy link
Contributor

@ashjeong ashjeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chokobole chokobole merged commit f2ede4e into main Jun 19, 2024
3 checks passed
@chokobole chokobole deleted the feat/improve-prime-field-de-serialization branch June 19, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants