Skip to content

Commit

Permalink
Revert "release: revert shifts semantic to ensure compat. with jasmin…
Browse files Browse the repository at this point in the history
… 2022.09.2"

This reverts commit e67ee07.
  • Loading branch information
tfaoliveira committed Oct 17, 2023
1 parent 555e233 commit 4a556a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/crypto_scalarmult/curve25519/amd64/common/bit.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 8,7 @@ inline fn __ith_bit(stack u8[32] k, reg u64 ctr) -> reg u64

p = ctr;
p &= 7;
bit >>= p; //bit >>= (p & 63);
bit >>= (p & 63);

bit &= 1;

Expand Down
15 changes: 4 additions & 11 deletions src/crypto_sign/falcon/falcon512/common/amd64/encode_decode.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 28,7 @@ inline fn __modq_decode_8(
if(acc_len >= 14)
{
acc_len -= 14;
w = acc;
w >>= acc_len; //w >>= (acc_len & 31);
w &= 0x3fff;
w = acc; w >>= (acc_len & 31); w &= 0x3fff;

if(w >= 12289)
{ is_zero = 1; }
Expand Down Expand Up @@ -104,9 102,7 @@ fn __modq_decode_8_unrolled(stack u16[8] out, reg u64 in)

if(acc_len >= 14) {
acc_len -= 14;
w = acc;
w >>= acc_len; //w >>= (acc_len & 31);
w &= 0x3fff;
w = acc; w >>= (acc_len & 31); w &= 0x3fff;

if(w >= 12289){
is_zero = 1;
Expand Down Expand Up @@ -186,8 182,7 @@ fn __comp_decode(stack u16[ARRAY_N] out, reg u64 in, reg u64 max_in_len)
}

acc <<= 8; t = (32u)(u8)[in in_i]; in_i = 1; acc |= t;
b = acc;
b >>= acc_len; //b >>= (acc_len & 31);
b = acc; b >>= (acc_len & 31);
s = b; s &= 128;
m = b; m &= 127;

Expand All @@ -209,9 204,7 @@ fn __comp_decode(stack u16[ARRAY_N] out, reg u64 in, reg u64 max_in_len)
acc_len = 8;
}
acc_len -= 1;
getnext = acc;
getnext >>= acc_len; //getnext >>= (acc_len & 31);
getnext &= 1;
getnext = acc; getnext >>= (acc_len & 31); getnext &= 1;
} (getnext == 0)

if(s != 0){
Expand Down

0 comments on commit 4a556a7

Please sign in to comment.