-
Notifications
You must be signed in to change notification settings - Fork 15
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
ASN1* : Provably Correct Non-Malleable Parsing for ASN.1 DER #66
Conversation
…kyducky into haobin_x509_working
…ckyducky into haobin_x509_working
…haobin_x509_working
…kyducky into haobin_x509_working
…kyducky into haobin_x509_working
…. rest is broken)
Hi @FVRobbin hi @tahina-pro The definition of asn1_content_k is not provably strictly positive. The version of F* that was used to check this code initially had a bug in the positivity checker that was skipping positivity checks in refinement types. This has since been fixed: See F* PR FStarLang/FStar#2827 A rough summary of the situation can be seen in this Coq definition:
This is rejected by Coq's strict positivity checker too. Arguably, this type is benign and should be accepted, but positivity checkers in all dependently typed languages, including Coq and F*, and very syntactic, and this definition is not admissible. This type T is the essence of the style used in the definition of asn1_content_k. For example, this part:
The good news is that it is possible to rephrase the definition of asn1_content_k so that it is provably strictly positive. I have done this in my most recent commit to this branch, where, I decoupled the id and decorator from the decorated type, like so:
I can still define types of the previous style:
with functions to go back and forth:
But, this change is pervasive and it impacts the whole development. For example, I had to change the type interpretation to work with these new definitions, but then I was able to prove lemmas to show that the new definitions are equivalent to the old-style ones. E.g., I defined
But, I also proved:
So, that's where things stand in ASN1.Base.fst right now. A couple of questions:
It would be great to sort this out, restore this code with respect to F* master, and then merge this PR, so it doesn't fall off the CI train again. |
I restored the proofs, thanks @Black-Kamous! I would like to merge this PR, but @tahina-pro, I'm not sure why some of the checks above are failing. |
Need directions on improving code quality