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

Get random2 #171

Merged
merged 3 commits into from
Jun 22, 2022
Merged

Get random2 #171

merged 3 commits into from
Jun 22, 2022

Conversation

bgregoir
Copy link
Contributor

Need to fix the ocaml part.

@bgregoir
Copy link
Contributor Author

I'm done with this PR. It will be nice to review it.

@vbgl
Copy link
Member

vbgl commented Jun 20, 2022

Can you please rebase to fix the conflicts? Thanks.

@bgregoir
Copy link
Contributor Author

Merge done.
I have realized that one test did not pass.
I think the pb is that we need to link the syscall (I don't know how to do that).

@vbgl vbgl force-pushed the get-random2 branch 2 times, most recently from 24f114e to 814ef9e Compare June 21, 2022 09:21
@vbgl
Copy link
Member

vbgl commented Jun 21, 2022

Libjade fails:

"…/libjade-main/src/crypto_kem/kyber/common/amd64/kem.jinc", line 46 (4-21)
from "kem.jazz", line 8 (2-38):
compilation error in function jade_kem_kyber_kyber512_amd64_avx2_keypair:
one-varmap checker: modified expression

cc @tfaoliveira

@tfaoliveira
Copy link
Member

I will try to understand why this happens

@tfaoliveira
Copy link
Member

tfaoliveira commented Jun 21, 2022

The following program (similar to the usage in Kyber) fails:

param int KYBER_SYMBYTES = 32;

export fn test2(reg u64 skp)
{
  inline int i;
  stack u8[KYBER_SYMBYTES] rb;
  reg u64 t64;
  
  skp = skp;

  rb = #randombytes(rb);

  for i=0 to KYBER_SYMBYTES/8
  {
    t64 = rb[u64 i];
    (u64)[skp] = t64;
    skp += 8;
  }
}

with the error:

"test2.jazz", line 16 (4-21):
compilation error in function test2:
one-varmap checker: modified expression

Is there something wrong with it?

@vbgl
Copy link
Member

vbgl commented Jun 21, 2022

Looks like a bug in this PR. I’ll try to understand.

@vbgl
Copy link
Member

vbgl commented Jun 21, 2022

Fixed! Thanks Tiago for your help.

@tfaoliveira
Copy link
Member

I'm compiling this branch to run some tests locally as well

@tfaoliveira
Copy link
Member

It seems fine on my side: the checksums of the implementations match; I think I didn't miss anything.

@vbgl
Copy link
Member

vbgl commented Jun 21, 2022

Great! I’ve also changed the tests a bit to avoid link failures in some environments.

vbgl and others added 3 commits June 21, 2022 18:33
Fills its argument with unspecified data

Co-authored-by: Benjamin Grēgoire <Benjamin.Gregoire@inria.fr>
@bgregoir
Copy link
Contributor Author

Are we ready ?

@bgregoir
Copy link
Contributor Author

The patch for the test works on my MAC

Copy link
Member

@vbgl vbgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a major, long-awaited, change!

@vbgl vbgl merged commit e9f21c5 into main Jun 22, 2022
@vbgl vbgl deleted the get-random2 branch June 22, 2022 08:22
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

Successfully merging this pull request may close these issues.

None yet

3 participants