Conversation
|
|
||
| #define STACK_SIZE (16*6 + 8*8 + 6*8 + (STACK_LOCS) * 8) | ||
| #define MLK_STACK_SIZE (16*6 + 8*8 + 6*8 + (STACK_LOCS) * 8) | ||
| #define STACK_BASE_GPRS (6*8) |
There was a problem hiding this comment.
We shouldn't namespace STACK_SIZE, but not the other macros; either all of them, or none.
hanno-becker
left a comment
There was a problem hiding this comment.
If we do this we should namespace all macros in the assembly files.
Note that the lack of namespacing here is of little effect since all affected files are in dev/ and not in the main source tree.
a7001df to
59a18fd
Compare
e96e223 to
0878495
Compare
f855045 to
b6a4787
Compare
4db09cb to
5f64f67
Compare
0b7e708 to
17d96d2
Compare
CBMC Results (ML-KEM-512)Full Results (187 proofs)
|
CBMC Results (ML-KEM-1024)Full Results (187 proofs)
|
CBMC Results (ML-KEM-768)Full Results (187 proofs)
|
17d96d2 to
4be4259
Compare
|
@willieyz Could you rebase this please? |
Hello @hanno-becker, |
- The STACK_SIZE should namespace as MLK_STACK_SIZE to avoid clashing with symbols in consuming libraries. - Also, found a missing namespace macro called KECCAK_F1600_ROUNDS, also namespace it. - This commit also namespace rej_uniform_asm Signed-off-by: willieyz <willie.zhao@chelpis.com>
4be4259 to
68eabf4
Compare
|
Hello, @hanno-becker , |
mkannwischer
left a comment
There was a problem hiding this comment.
Thanks @willieyz. Generally I support this change for consistency and I checked that you have not missed any non-namespaced macros.
A couple of comments got wrongly changed in the x86_64 code (see below), please change them back.
Since the scope of this PR has changed, please update the commit message and PR description to reflect that.
| // | ||
| // Notes: | ||
| // - We exit early if we find the required number of good values, | ||
| // - We exit early if we find the required number of MLK_GOOD values, |
There was a problem hiding this comment.
| // - We exit early if we find the required number of MLK_GOOD values, | |
| // - We exit early if we find the required number of good values, |
| // occupies a corresponding 16-bit element of `MLK_VALS` xmm register, | ||
| // 2. Compute an 8-bit value `MLK_GOOD` such that | ||
| // MLK_GOOD[i] = MLK_VALS[i] < MLKEM_Q ? 1 : 0, for i in [0, 7], | ||
| // 3. Shuffle the elements in `MLK_VALS` such that all MLK_GOOD elements |
There was a problem hiding this comment.
| // 3. Shuffle the elements in `MLK_VALS` such that all MLK_GOOD elements | |
| // 3. Shuffle the elements in `MLK_VALS` such that all good elements |
| movq $0, cnt // cnt counts the number of good values we've found. | ||
| movq $0, pos // pos is the current position in the input buffer. | ||
| movq $0x5555, pext_mask // 0x5555 mask to extract every second bit. | ||
| movq $0, MLK_CNT // MLK_CNT counts the number of MLK_GOOD values we've found. |
There was a problem hiding this comment.
| movq $0, MLK_CNT // MLK_CNT counts the number of MLK_GOOD values we've found. | |
| movq $0, MLK_CNT // MLK_CNT counts the number of good values we've found. |
| pinsrq $1, %rax, MLK_BOUND | ||
|
|
||
| // Broadcast 12-bit mask 0xFFF to all 16-bit elements of bound reg. | ||
| // Broadcast 12-bit mask 0xFFF to all 16-bit elements of MLK_BOUND reg. |
There was a problem hiding this comment.
| // Broadcast 12-bit mask 0xFFF to all 16-bit elements of MLK_BOUND reg. | |
| // Broadcast 12-bit mask 0xFFF to all 16-bit elements of MLK_AND_MASK reg. |
|
Marking as draft for now. Please mark it as ready when my comments have been addressed. |
|
@willieyz - gentle ping. Could you please get this updated so we can get it merged? |
Resolves: Namespace
STACK_SIZEin various assembly files #1395The STACK_SIZE should namespace as MLK_STACK_SIZE to avoid clashing with symbols in consuming libraries.