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

eclib: set0_{128,256} issue; Jasmin v2022.04.0 #128

Closed
tfaoliveira opened this issue May 10, 2022 · 6 comments
Closed

eclib: set0_{128,256} issue; Jasmin v2022.04.0 #128

tfaoliveira opened this issue May 10, 2022 · 6 comments

Comments

@tfaoliveira
Copy link
Member

This issue is described in the context of Jasmin v2022.04.0 and EasyCrypt r2022.04.

When extracting to EasyCrypt a Jasmin function that contains #set0_128() or #set0_256(), those statements are extracted to <- set0_128 ; or <- set0_256 ;.

When checking the extracted file with EasyCrypt, I get the error:

This expression has type
   bool * bool * bool * bool * bool * W128.t
but is expected to have type
   W128.t

I think it is necessary to define set0_128 and set0_256 differently (without returning the flags) for these particular cases.

@fdupress
Copy link
Contributor

Are there any uses of those instructions where the flags are not ignored in the Jasmin source? Instead of defining set0_128 and set0_256 differently, it's probably a better idea to tweak extraction to mimic the source's behaviour w.r.t. ignoring the flags.

@bgregoir
Copy link
Contributor

Hi Tiago, this is clearly a bug in the extraction and the easycrypt model. I will fix this.

@eponier
Copy link
Contributor

eponier commented May 11, 2022

Before, set0 for sizes 128 and 256 was called setw0. Maybe this is related to this bug.

@tfaoliveira
Copy link
Member Author

For u128 and u256 flags are not affected. I think this is possible to see in Definition Oset0_instr from

Definition Oset0_instr sz :=
, and I also double-checked in the Intel developer's manual.

I would risk saying that the extraction is OK and only the eclib needs to be adjusted.

bgregoir added a commit that referenced this issue May 13, 2022
vbgl pushed a commit that referenced this issue May 13, 2022
@vbgl
Copy link
Member

vbgl commented May 13, 2022

This has been fixed in #134.

@vbgl vbgl closed this as completed May 13, 2022
@tfaoliveira
Copy link
Member Author

Tested on libjade; Everything fine :-)

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

5 participants