-
Notifications
You must be signed in to change notification settings - Fork 147
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
Field operations for small prime moduli #1982
Comments
The relevant entry-point for the bedrock2 pipeline is fiat-crypto/src/Bedrock/Field/Stringification/Stringification.v Lines 200 to 202 in 9bf41bc
fiat-crypto/src/Bedrock/Field/Stringification/Stringification.v Lines 212 to 220 in 9bf41bc
translate_func avoid load/store when we only have one limb, I think @jadephilipoom or @andres-erbsen is better-placed to answer about the difficulty, since I haven't touched the bedrock2 code much.There seems to be some documentation in https://github.com/mit-plv/fiat-crypto/blob/master/src/Bedrock/Field/README.md. translate_func itself is implemented at fiat-crypto/src/Bedrock/Field/Translation/Func.v Lines 45 to 89 in 9bf41bc
Adjusting the wrapper code shouldn't be too hard; it's at fiat-crypto/src/Bedrock/Field/Stringification/Stringification.v Lines 116 to 147 in 9bf41bc
If you want to play with this all using tactics like |
Thank you for the pointers! I was just planning to use the pretty printer, since I will be using Rupicola to synthesize the NTT code after I manage to teach it how to compile arrays of field elements. To make sure I understand the translation pipeline:
So I would need to modify/copy |
The existing |
I think you want to add a reification of fiat-crypto/src/PushButtonSynthesis/UnsaturatedSolinasReificationCache.v Lines 200 to 210 in 704fe3d
fiat-crypto/src/PushButtonSynthesis/UnsaturatedSolinasReificationCache.v Lines 224 to 234 in 704fe3d
fiat-crypto/src/PushButtonSynthesis/WordByWordMontgomeryReificationCache.v Lines 251 to 256 in 704fe3d
Then we want versions of all the operations that compose with fiat-crypto/src/PushButtonSynthesis/WordByWordMontgomeryReificationCache.v Lines 67 to 68 in 704fe3d
|
I'm trying to use fiat-crypto to synthesize (bedrock2) C code for NTT operations as used in some PQ lattice-based cryptography, where the prime modulus fits in one word.
How difficult would it be to output "call-by-value" field operations, i.e., without the load/store opening/ending in functions ?
I tried looking into how to modify the pipeline, though I have a bit of a hard time understanding, so I would appreciate some help to get started.
The text was updated successfully, but these errors were encountered: