-
Notifications
You must be signed in to change notification settings - Fork 11
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
A few questions about Rupicola #11
Comments
To get rupicola to compile a function, you need to define lemmas for every kind of expression you want to compile (other than the ones in the core library) and add them to the The Montgomery ladder proof is a bit of a mess, to be honest, but the basic structure of the proof is:
At various points the proof converts between "literal" local variables and local-variables-as-separation-logic, which is mostly a side effect of an experiment we were doing at the time but may be helpful to get the loop lemma working. I'd suggest trying with a simple loop first and then scaling up. |
Also, instead of using the |
Thanks for the response; I have now a few more questions: |
Yes, it is possible to generate the Montgomery ladder function with calls to field functions. In fact, fiat-crypto has a definition and output test for this. The line here prints The expected value is here (sorry, no nice bedrock2 notations): This version requires the caller to allocate all the memory the function needs for intermediate values. In There are proofs for these that show they are correct assuming whatever functions you have for field operations match the specifications given in Spec/Field.v. It's highly unfortunate that the fiat-crypto field operation specs are not quite aligned (I've been spending some of my free time on fixing the issue, but it's not my day job and may still take some time), but if you wanted to write some untrusted glue code that makes them compatible that should work fine. If you have a specific curve in mind, you could even write the glue code in bedrock2 and prove that it's correct. The That proof is here (bedrock2's
There's an unverified print-as-C functionality for bedrock2: |
I asked these questions on the fiat-crypto zulip stream, but am not sure who has seen the post; so I will post here as well:
We have had a look at the Rupicola project and have a few questions:
We have tried compiling some very simple functions to bedrock2 using rupicola, by simply using the compile tactic after writing the function specification in Gallina. This approach, however, seems insufficient when compiling more complicated functions.
What kinds of functions can the compile tactic reasonably be expected to derive? And how can the compilation procedure be modified/extended to handle different kinds of functions.
Also, we had a look at the derivation of of the MontgomeryLadder here: https://github.com/mit-plv/fiat-crypto/blob/master/src/Bedrock/Group/ScalarMult/MontgomeryLadder.v#L301
This is quite a bit more involved. Can you comment on a general strategy to derive more complicated functions such as this? We are particularly interested in functions making use of loops and function calls, so if you could comment on this, that would be great as well.
The questions are mainly aimed at @jadephilipoom and @cpitclaudel, but anyone with insight is more than welcome to comment : )
The text was updated successfully, but these errors were encountered: