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

assert false in CT extraction #202

Closed
eponier opened this issue Jul 8, 2022 · 5 comments
Closed

assert false in CT extraction #202

eponier opened this issue Jul 8, 2022 · 5 comments

Comments

@eponier
Copy link
Contributor

eponier commented Jul 8, 2022

The following program

export fn main (reg u64 i) {
  stack u8[2] a;

  a[1] = i;
}

triggers

Fatal error: exception File "src/toEC.ml", line 380, characters 55-61: Assertion failed

when we call the extraction using jasminc test.jazz -CT -ec main. What seems important is that i is unknown.

@eponier
Copy link
Contributor Author

eponier commented Jul 8, 2022

(this was first observed by Ethan in https://github.com/ethanlee515/jasmin-dilithium)

@tfaoliveira
Copy link
Member

I was about to report the same issue and found this one. To replicate it on libjade:

Is this something that can be avoided by rewriting the code?
Is it possible to print more information about why it fails, or does it need fixing on the extraction?

vbgl added a commit that referenced this issue Sep 1, 2022
vbgl added a commit that referenced this issue Sep 1, 2022
vbgl added a commit that referenced this issue Sep 1, 2022
@vbgl
Copy link
Member

vbgl commented Sep 1, 2022

This is certainly a bug in toEC.ml. I’ve proposed a fix in #229. Tiago, can you please double-check that it solves your current issue?

@tfaoliveira
Copy link
Member

Yes, it does fix the described issue. Then I get [critical] [sign_ct.ec: line 5788 (11-28)] unknown function: SC.randombytes_32 when running easycrypt sign_ct.ec but that is for another topic, I believe.

@vbgl
Copy link
Member

vbgl commented Sep 1, 2022

Thanks for testing. Indeed, you’ll need to specify the randombytes system calls in EasyCrypt (contributions to eclib/ welcome!).

vbgl added a commit that referenced this issue Sep 1, 2022
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

3 participants