Skip to content

feat(taiko impl): Add Taiko Rust implementation of Jacobi symbol#3

Merged
jonas-lj merged 1 commit into
jonas-lj:mainfrom
mratsim:taiko-jacobi-impl
Apr 23, 2025
Merged

feat(taiko impl): Add Taiko Rust implementation of Jacobi symbol#3
jonas-lj merged 1 commit into
jonas-lj:mainfrom
mratsim:taiko-jacobi-impl

Conversation

@mratsim

@mratsim mratsim commented Jul 17, 2024

Copy link
Copy Markdown
Contributor

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-ethereum/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
Copy Markdown
Owner

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

@jonas-lj jonas-lj merged commit 9933c77 into jonas-lj:main Apr 23, 2025
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