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(taiko impl): Add Taiko Rust implementation of Jacobi symbol #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mratsim
Copy link

@mratsim mratsim commented Jul 17, 2024

Hi team,

I stumbled across your paper https://eprint.iacr.org/2024/1054.pdf and want to add my optimized Jacobi implementation in Rust.

Writeup: mratsim/constantine#199
Rust impl: privacy-scaling-explorations/halo2curves#95

Benchmarks

image

On 256 bits, this is a 25x acceleration over the baseline and 7.8x acceleration over your new algorithm.
On 384 bits, this is a 24x / 7.15x acceleration

Change for generic large integer

Currently the implementation is specialized for compile-time size but it should be easy to change the array buffer to use a Vec instead.
One last optimization would be to use in-place mutation as with heap-allocated Vec the compiler cannot do the same optimization as stack allocated arrays.

@jonas-lj
Copy link
Owner

Nice! Thanks for the contribution, and sorry I missed this until now. I'll check out the code and merge it.

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.

2 participants