Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ fn _poly_decompress(reg ptr u16[KYBER_N] rp, reg u64 ap) -> reg ptr u16[KYBER_N]
mask = #VPBROADCAST_8u32(pd_mask_s);
shift = #VPBROADCAST_8u32(pd_shift_s);

f = #set0_256();

for i=0 to KYBER_N/16
{
h = (128u)[:u64 ap + 8*i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn __cmov(reg ptr u8[KYBER_SYMBYTES] dst, reg u64 src cnd) -> reg ptr u8[KYBER_S
{
reg u256 f g m;
stack u64 scnd;
reg u8 t1 t2 bcond;
reg u8 t1 t2;
inline int i off;

cnd = -cnd;
Expand All @@ -63,7 +63,6 @@ fn __cmov(reg ptr u8[KYBER_SYMBYTES] dst, reg u64 src cnd) -> reg ptr u8[KYBER_S

off = KYBER_SYMBYTES/32 * 32;

bcond = (8u)cnd;
for i=off to KYBER_SYMBYTES
{
t1 = dst.[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> reg ptr u16[KYBER_N]
t &= 1;
t *= (KYBER_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down Expand Up @@ -408,7 +407,6 @@ fn _i_poly_frommsg(reg ptr u16[KYBER_N] rp, reg ptr u8[KYBER_INDCPA_MSGBYTES] ap
t &= 1;
t *= (KYBER_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down Expand Up @@ -472,8 +470,6 @@ fn __load24(reg ptr u8[KYBER_ETA1*KYBER_N/4] buf, reg u64 i) -> reg u32
t <<= 16;
r |= t;

t &= 0x00FFFFFF;

return r;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> reg ptr u16[KYBER_N]
t &= 1;
t *= (KYBER_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down Expand Up @@ -428,7 +427,6 @@ fn _i_poly_frommsg(reg ptr u16[KYBER_N] rp, reg ptr u8[32] ap) -> reg ptr u16[KY
t &= 1;
t *= (KYBER_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ fn _gen_matrix_avx2
pol, _ = __gen_matrix_sample_one_polynomial(pol, buf, rho, rc);

matrix[8*MLKEM_N:MLKEM_N] = pol;
bufx4_s = bufx4;

for i = 0 to MLKEM_K
{ for j = 0 to MLKEM_K
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ fn _poly_decompress(reg ptr u16[MLKEM_N] rp, reg u64 ap) -> reg ptr u16[MLKEM_N]
mask = #VPBROADCAST_8u32(pd_mask_s);
shift = #VPBROADCAST_8u32(pd_shift_s);

f = #set0_256();

for i=0 to MLKEM_N/16
{
h = (128u)[:u64 ap + 8*i];
Expand Down Expand Up @@ -1274,11 +1272,7 @@ fn _poly_sub(reg ptr u16[MLKEM_N] rp ap bp) -> reg ptr u16[MLKEM_N]
fn _poly_tobytes(reg u64 rp, reg ptr u16[MLKEM_N] a) -> reg ptr u16[MLKEM_N]
{
inline int i;
reg u256 t0 t1 t2 t3 t4 t5 t6 t7 qx16 tt ttt;
reg ptr u16[16] jqx16_p;

jqx16_p = jqx16;
qx16 = jqx16_p[:u256 0];
reg u256 t0 t1 t2 t3 t4 t5 t6 t7 tt ttt;

a = _poly_csubq(a);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ fn __barrett_reduce(reg u16 a) -> reg u16
//t = #SAR_32(t, 26);
t >>s= 26;
t *= MLKEM_Q;
r = t;
r = a;
r -= t;
return r;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn __cmov(reg u64 dst, reg ptr u8[MLKEM_SYMBYTES] src, reg u64 cnd)
{
reg u256 f g m;
stack u64 scnd;
reg u8 t1 t2 bcond;
reg u8 t1 t2;
inline int i off;

cnd = -cnd;
Expand All @@ -65,8 +65,6 @@ fn __cmov(reg u64 dst, reg ptr u8[MLKEM_SYMBYTES] src, reg u64 cnd)

off = MLKEM_SYMBYTES/32 * 32;

/* fixme: unused in 768, hence untested */
bcond = (8u)cnd;
for i=off to MLKEM_SYMBYTES
{
t2 = [:u8 dst + i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ fn _poly_frommsg(reg ptr u16[MLKEM_N] rp, reg u64 ap) -> reg ptr u16[MLKEM_N]
t &= 1;
t *= (MLKEM_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down Expand Up @@ -393,7 +392,6 @@ fn _i_poly_frommsg(reg ptr u16[MLKEM_N] rp, reg ptr u8[32] ap) -> reg ptr u16[ML
t &= 1;
t *= (MLKEM_Q+1)/2;
rp[8*i+7] = t;
c >>= 1;
}
return rp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fn __barrett_reduce(reg u16 a) -> reg u16
//t = #SAR_32(t, 26);
t >>s= 26;
t *= MLKEM_Q;
r = t;
r = a;
r -= t;
return r;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ inline fn __poly1305_avx_update(
inline int i;
stack u128 s_mask26 s_bit25;
reg u128[5] h;
reg u128 mask26 t;
reg u128 t;
reg u64[3] h64;

for i=0 to 5
{ h[i] = #set0_128(); }
t = #VPBROADCAST_2u64(mask26_u64); s_mask26 = t; mask26 = t;
t = #VPBROADCAST_2u64(mask26_u64); s_mask26 = t;
t = #VPBROADCAST_2u64(bit25_u64); s_bit25 = t;

while(inlen >= 64)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ inline fn __xsalsa20_ref_32(
reg ptr u8[32]
{
stack ptr u8[32] out_s;
stack u64 nonce_s key_s;
stack u64 nonce_s;
reg u32[8] subkey;

out_s = out;
nonce_s = nonce;
key_s = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ inline fn __xsalsa20_ref_32(
reg ptr u8[32]
{
stack ptr u8[32] out_s;
stack u64 nonce_s key_s;
stack u64 nonce_s;
reg u32[8] subkey;

out_s = out;
nonce_s = nonce;
key_s = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ inline fn __xsalsa20_ref_32(
reg ptr u8[32]
{
stack ptr u8[32] out_s;
stack u64 nonce_s key_s;
stack u64 nonce_s;
reg u32[8] subkey;

out_s = out;
nonce_s = nonce;
key_s = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ from Jade require "crypto_stream/salsa20/common/amd64/avx/salsa20.jinc"

inline fn __xsalsa20_xor_avx(reg u64 output input len nonce key)
{
stack u64 _output _input _len _nonce _key;
stack u64 _output _input _len _nonce;
reg u32[8] subkey;

_output = output;
_input = input;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand All @@ -28,13 +27,12 @@ inline fn __xsalsa20_xor_avx(reg u64 output input len nonce key)

inline fn __xsalsa20_avx(reg u64 output len nonce key)
{
stack u64 _output _len _nonce _key;
stack u64 _output _len _nonce;
reg u32[8] subkey;

_output = output;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ from Jade require "crypto_stream/salsa20/common/amd64/avx2/salsa20.jinc"

inline fn __xsalsa20_xor_avx2(reg u64 output input len nonce key)
{
stack u64 _output _input _len _nonce _key;
stack u64 _output _input _len _nonce;
reg u32[8] subkey;

_output = output;
_input = input;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand All @@ -28,13 +27,12 @@ inline fn __xsalsa20_xor_avx2(reg u64 output input len nonce key)

inline fn __xsalsa20_avx2(reg u64 output len nonce key)
{
stack u64 _output _len _nonce _key;
stack u64 _output _len _nonce;
reg u32[8] subkey;

_output = output;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ from Jade require "crypto_stream/salsa20/common/amd64/ref/salsa20.jinc"

inline fn __xsalsa20_xor_ref(reg u64 output input len nonce key)
{
stack u64 _output _input _len _nonce _key;
stack u64 _output _input _len _nonce;
reg u32[8] subkey;

_output = output;
_input = input;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand All @@ -27,13 +26,12 @@ inline fn __xsalsa20_xor_ref(reg u64 output input len nonce key)

inline fn __xsalsa20_ref(reg u64 output len nonce key)
{
stack u64 _output _len _nonce _key;
stack u64 _output _len _nonce;
reg u32[8] subkey;

_output = output;
_len = len;
_nonce = nonce;
_key = key;

subkey = __hsalsa20_ref(nonce, key);

Expand Down
Loading