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

62 bit montgomery multiply. #12

Open
coltfred opened this issue Dec 19, 2018 · 0 comments
Open

62 bit montgomery multiply. #12

coltfred opened this issue Dec 19, 2018 · 0 comments
Assignees

Comments

@coltfred
Copy link
Member

The implementation of montgomery multiplication is currently using our 31 bit representation. This is because of our desire to support WASM. We should detect if the machine has a 64 bit native multiply and if it does, use a 62 bit representation instead. I've hacked this up in a branch to only support 62 bit and the gains are around 40% on a 256 bit prime. These gains would be even larger on larger primes as the montgomery multiplication is n^2 in the length of the limbs array.

This gain is realized for multiplication as well as the exponentiation and is probably the lowest hanging fruit we have left.

See https://github.com/IronCoreLabs/gridiron/tree/62-bit-hack for my work on this.

@coltfred coltfred self-assigned this Dec 19, 2018
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

No branches or pull requests

1 participant