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

perf(math): add fast reduction for a special case #404

Merged
merged 7 commits into from
Apr 29, 2024

Conversation

chokobole
Copy link
Contributor

@chokobole chokobole commented Apr 25, 2024

Description

This PR implements followings

  1. Adds faster reductions for addition, subtraction and negation when the modulus of the prime field is less than 2³¹ + 1.
  2. Removes redundant Reduce() function calls
  3. Enables 32-bit custom reductions for small prime fields.

@chokobole chokobole force-pushed the perf/add-fast-reduction-for-a-special-case branch from fb27825 to 942a018 Compare April 25, 2024 07:25
@chokobole chokobole marked this pull request as ready for review April 25, 2024 07:25
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

@chokobole chokobole force-pushed the perf/add-fast-reduction-for-a-special-case branch 2 times, most recently from 9ce1477 to c91d49c Compare April 25, 2024 12:42
Copy link
Contributor

@Insun35 Insun35 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

@chokobole chokobole force-pushed the perf/add-fast-reduction-for-a-special-case branch 4 times, most recently from 1f8fba8 to abdbe03 Compare April 26, 2024 04:51
@chokobole chokobole force-pushed the perf/add-fast-reduction-for-a-special-case branch from abdbe03 to 147b76a Compare April 26, 2024 06:56
Copy link
Contributor

@Insun35 Insun35 left a comment

Choose a reason for hiding this comment

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

LGTM

@TomTaehoonKim
Copy link
Contributor

Can you fix the commit message of c767c64 from reduce() to Reduce()?

@chokobole chokobole force-pushed the perf/add-fast-reduction-for-a-special-case branch from 147b76a to 16e24c2 Compare April 26, 2024 09:21
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

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 5853579 into main Apr 29, 2024
3 checks passed
@chokobole chokobole deleted the perf/add-fast-reduction-for-a-special-case branch April 29, 2024 02:13
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.

None yet

5 participants