-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use fiat-crypto for Fp128 and other fields #757
Comments
I looked into this briefly a while back, and I found that the word-by-word Montgomery synthesis program had issues when the prime modulus fit in only one machine word. It appeared that the IR expressions were of an unexpected shape, or they were being split into statements incorrectly. This would be nice to do, but it'll require some upstream work first, I think. |
It is true that fiat-crypto has issues with single-word arithmetic, it only works with multi-precision. So, it's applicable in the case of Fp128 using 2 words of 64-bits, or Fp64 using 2 words of 32-bits. |
I don't think I understand the situation: if we split the |
fiat-crypto cannot produce is single-word implementations. For example, it cannot generate code for the Fp32 or Fp64 fields using (one) word of 64 bits. On the other hand, fiat-crypto can produce code for 128-bit primes (internally numbers are split in two 64-words), and this is the case shown in #758. |
As an example, running
Note that 18446744069414584321 is a 64-bit modulus, and we specified 64 bits for "machine_wordsize". |
@armfazh an incremental step we can take is to use fiat-crypto for |
We can't implement Field64 with a 64-bit word size until some improvements are made to fiat-crypto, to plumb in a rewrite pass that fixes the above error. Until then, Field64 could only be implemented with smaller word sizes. |
Ah so it's the same problem as for |
Code generation for |
fiat-crypto code generator is currently used for Fp255, however it can also be used for other fields, such as Fp128.
The text was updated successfully, but these errors were encountered: