Skip to content

Commit

Permalink
Remove declarations of unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl authored and tfaoliveira-sb committed Jul 15, 2024
1 parent b3c9d34 commit e278ded
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 40 deletions.
1 change: 0 additions & 1 deletion src/common/keccak/common/fips202_DIRTY.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ fn _sha3_512_32(reg ptr u8[64] out, reg const ptr u8[32] in) -> stack u8[64]
inline
fn __shake128_absorb34(reg u256[7] state, reg const ptr u8[34] in) -> reg u256[7]
{
reg u128 t128;
stack u64[28] s_state;
stack u64[25] a_jagged_p;
reg u64 l t;
Expand Down
17 changes: 3 additions & 14 deletions src/crypto_kem/kyber/common/amd64/avx2/poly.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,7 @@ fn _poly_compress(reg u64 rp, reg ptr u16[KYBER_N] a) -> reg ptr u16[KYBER_N]
{
inline int i;
reg u256 f0 f1 f2 f3 v shift1 mask shift2 permidx;
reg u128 t0 t1 t3;
reg ptr u16[16] x16p;
reg u64 t64;
reg u32 t32;
reg u16 t16;

a = _poly_csubq(a);

Expand Down Expand Up @@ -258,11 +254,7 @@ fn _poly_compress_1(reg ptr u8[KYBER_POLYCOMPRESSEDBYTES] rp, reg ptr u16[KYBER_
{
inline int i;
reg u256 f0 f1 f2 f3 v shift1 mask shift2 permidx;
reg u128 t0 t1 t3;
reg ptr u16[16] x16p;
reg u64 t64;
reg u32 t32;
reg u16 t16;

a = _poly_csubq(a);

Expand Down Expand Up @@ -451,7 +443,7 @@ u8[16] pfm_idx_s = {0, 1, 4, 5, 8, 9, 12, 13,
fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> stack u16[KYBER_N]
{
inline int i;
reg u256 f g0 g1 g2 g3 g4 h0 h1 h2 h3;
reg u256 f g0 g1 g2 g3 h0 h1 h2 h3;
reg u256 shift idx hqs;
reg ptr u16[16] x16p;

Expand Down Expand Up @@ -499,7 +491,7 @@ fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> stack u16[KYBER_N]
fn _poly_frommsg_1(reg ptr u16[KYBER_N] rp, reg ptr u8[KYBER_INDCPA_MSGBYTES] ap) -> stack u16[KYBER_N]
{
inline int i;
reg u256 f g0 g1 g2 g3 g4 h0 h1 h2 h3;
reg u256 f g0 g1 g2 g3 h0 h1 h2 h3;
reg u256 shift idx hqs;
reg ptr u16[16] x16p;

Expand Down Expand Up @@ -879,7 +871,7 @@ inline
fn __invntt___butterfly64x(reg u256 rl0 rl1 rl2 rl3 rh0 rh1 rh2 rh3 zl0 zl1 zh0 zh1 qx16)
-> reg u256, reg u256, reg u256, reg u256, reg u256, reg u256, reg u256, reg u256
{
reg u256 t0 t1 t2 t3 t4 t5 t6 t7;
reg u256 t0 t1 t2 t3;

t0 = #VPSUB_16u16(rl0, rh0);
t1 = #VPSUB_16u16(rl1, rh1);
Expand Down Expand Up @@ -921,7 +913,6 @@ fn _poly_invntt(reg ptr u16[KYBER_N] rp) -> reg ptr u16[KYBER_N]
{
reg u256 zeta0 zeta1 zeta2 zeta3 r0 r1 r2 r3 r4 r5 r6 r7 qx16 vx16 flox16 fhix16;
reg ptr u16[400] zetasp;
reg ptr u16[16] qx16p;
inline int i;

zetasp = jzetas_inv_exp;
Expand Down Expand Up @@ -1119,8 +1110,6 @@ fn __butterfly64x(reg u256 rl0 rl1 rl2 rl3 rh0 rh1 rh2 rh3 zl0 zl1 zh0 zh1 qx16)
fn _poly_ntt(reg ptr u16[KYBER_N] rp) -> reg ptr u16[KYBER_N]
{
reg u256 zeta0 zeta1 zeta2 zeta3 r0 r1 r2 r3 r4 r5 r6 r7 qx16 vx16;
reg u32 t;
reg u16 w;
reg ptr u16[400] zetasp;
inline int i;

Expand Down
2 changes: 0 additions & 2 deletions src/crypto_kem/kyber/common/amd64/avx2/polyvec.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ fn __polyvec_compress(reg u64 rp, stack u16[KYBER_VECN] a)
reg u256 f0 f1 f2 v v8 off shift1 mask shift2 sllvdidx shufbidx;
reg u128 t0 t1;
reg ptr u16[16] x16p;
reg ptr u8[32] x8p;

a = __polyvec_csubq(a);

Expand Down Expand Up @@ -127,7 +126,6 @@ fn __polyvec_compress_1(reg ptr u8[KYBER_POLYVECCOMPRESSEDBYTES] rp, stack u16[K
reg u256 f0 f1 f2 v v8 off shift1 mask shift2 sllvdidx shufbidx;
reg u128 t0 t1;
reg ptr u16[16] x16p;
reg ptr u8[32] x8p;

a = __polyvec_csubq(a);

Expand Down
1 change: 0 additions & 1 deletion src/crypto_kem/kyber/common/amd64/kem.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fn __crypto_kem_enc_derand_jazz(reg u64 ctp, reg u64 shkp, reg u64 pkp, reg ptr
stack u8[KYBER_SYMBYTES * 2] buf kr;
stack u64 s_pkp s_ctp s_shkp;
reg u64 t64;
inline int i;

s_pkp = pkp;
s_ctp = ctp;
Expand Down
3 changes: 0 additions & 3 deletions src/crypto_kem/kyber/common/amd64/ref/poly.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fn _poly_csubq(reg ptr u16[KYBER_N] rp) -> reg ptr u16[KYBER_N]

fn _poly_basemul(reg ptr u16[KYBER_N] rp, reg const ptr u16[KYBER_N] ap bp) -> reg ptr u16[KYBER_N]
{
reg u64 offset;
reg u16 zeta;
reg u16 r0;
reg u16 r1;
Expand Down Expand Up @@ -296,7 +295,6 @@ fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> stack u16[KYBER_N]
reg u8 c;
reg u16 t;
inline int i;
inline int j;

for i = 0 to KYBER_INDCPA_MSGBYTES
{
Expand Down Expand Up @@ -359,7 +357,6 @@ fn _i_poly_frommsg(reg ptr u16[KYBER_N] rp, reg ptr u8[KYBER_INDCPA_MSGBYTES] ap
reg u8 c;
reg u16 t;
inline int i;
inline int j;

for i = 0 to KYBER_INDCPA_MSGBYTES
{
Expand Down
2 changes: 0 additions & 2 deletions src/crypto_kem/kyber/common/amd64/ref/polyvec.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fn __polyvec_compress(reg u64 rp, stack u16[KYBER_VECN] a)
{
stack u16[KYBER_VECN] aa;
reg u16 c, b;
reg u16 d;
reg u64[4] t;
reg u64 i j;
inline int k;
Expand Down Expand Up @@ -95,7 +94,6 @@ fn __i_polyvec_compress(reg ptr u8[KYBER_POLYVECCOMPRESSEDBYTES] rp, stack u16[K
{
stack u16[KYBER_VECN] aa;
reg u16 c, b;
reg u16 d;
reg u64[4] t;
reg u64 i j;
inline int k;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto_kem/kyber/common/amd64/ref/verify.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn __verify(reg u64 ctp, reg ptr u8[KYBER_INDCPA_BYTES] ctpc) -> reg u64
inline
fn __cmov(reg ptr u8[KYBER_SYMBYTES] dst, reg u64 src cnd) -> reg ptr u8[KYBER_SYMBYTES]
{
reg u8 t1 t2 bcond;
reg u8 t1 t2;
inline int i;

cnd = -cnd;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto_kem/kyber/kyber512/amd64/ref/indcpa.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn __indcpa_keypair_derand(reg u64 pkp, reg u64 skp, reg ptr u8[KYBER_SYMBYTES]
stack u8[64] buf;
stack u8[KYBER_SYMBYTES] publicseed noiseseed;
reg u64 t64;
reg u8 nonce, c;
reg u8 nonce;
inline int i;

spkp = pkp;
Expand Down
1 change: 0 additions & 1 deletion src/crypto_kem/kyber/kyber768/amd64/avx2/gen_matrix.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ fn __gen_matrix(stack u8[KYBER_SYMBYTES] seed, inline int transposed) -> stack u
stack u256 fs;
reg u256 f;
reg u64 ctr0 ctr1 ctr2 ctr3 tmp;
stack u64 ctr0_s;
reg u8 flg0 flg1 bflg;
reg bool b;
reg bool zf;
Expand Down
10 changes: 4 additions & 6 deletions src/crypto_kem/kyber/kyber768/amd64/ref/indcpa.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ fn __indcpa_enc(stack u64 sctp, reg ptr u8[32] msgp, reg u64 pkp, reg ptr u8[KYB
{
stack u16[KYBER_VECN] pkpv sp ep bp;
stack u16[KYBER_K*KYBER_VECN] aat;
stack u16[KYBER_N] k poly epp v poly0 poly1 poly2;
stack u16[KYBER_N] k epp v;
stack u8[KYBER_SYMBYTES] publicseed;
reg u64 i j t64;
reg u64 i t64;
reg u64 ctp;
reg u16 t;
reg u8 nonce;

pkpv = __polyvec_frombytes(pkp);
Expand Down Expand Up @@ -161,10 +160,9 @@ fn __iindcpa_enc(reg ptr u8[KYBER_CT_LEN] ctp, reg ptr u8[32] msgp, reg u64 pkp,
{
stack u16[KYBER_VECN] pkpv sp ep bp;
stack u16[KYBER_K*KYBER_VECN] aat;
stack u16[KYBER_N] k poly epp v poly0 poly1 poly2;
stack u16[KYBER_N] k epp v;
stack u8[KYBER_SYMBYTES] publicseed;
reg u64 i j t64;
reg u16 t;
reg u64 i t64;
reg u8 nonce;
stack ptr u8[KYBER_CT_LEN] sctp;

Expand Down
4 changes: 0 additions & 4 deletions src/crypto_kem/kyber/kyber768/amd64/ref/poly.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ fn _poly_csubq(reg ptr u16[KYBER_N] rp) -> reg ptr u16[KYBER_N]

fn _poly_basemul(reg ptr u16[KYBER_N] rp, reg const ptr u16[KYBER_N] ap bp) -> reg ptr u16[KYBER_N]
{
reg u64 offset;
reg u16 zeta;
reg u16 r0;
reg u16 r1;
Expand Down Expand Up @@ -316,7 +315,6 @@ fn _poly_frommsg(reg ptr u16[KYBER_N] rp, reg u64 ap) -> stack u16[KYBER_N]
reg u8 c;
reg u16 t;
inline int i;
inline int j;

for i = 0 to 32
{
Expand Down Expand Up @@ -379,7 +377,6 @@ fn _i_poly_frommsg(reg ptr u16[KYBER_N] rp, reg ptr u8[32] ap) -> stack u16[KYBE
reg u8 c;
reg u16 t;
inline int i;
inline int j;

for i = 0 to 32
{
Expand Down Expand Up @@ -441,7 +438,6 @@ fn _poly_getnoise(reg ptr u16[KYBER_N] rp, reg ptr u8[KYBER_SYMBYTES] seed, reg
{
stack u8[33] extseed; /* 33 = KYBER_SYMBYTES +1 */
stack u8[128] buf; /* 128 = KYBER_ETA*KYBER_N/4 */
reg u64 outlen;
reg u8 c,a,b;
reg u16 t;
reg u64 i j;
Expand Down
2 changes: 0 additions & 2 deletions src/crypto_kem/kyber/kyber768/amd64/ref/polyvec.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fn __polyvec_compress(reg u64 rp, stack u16[KYBER_VECN] a)
{
stack u16[KYBER_VECN] aa;
reg u16 c, b;
reg u16 d;
reg u64[4] t;
reg u64 i j;
inline int k;
Expand Down Expand Up @@ -90,7 +89,6 @@ fn __i_polyvec_compress(reg ptr u8[KYBER_POLYVECCOMPRESSEDBYTES] rp, stack u16[K
{
stack u16[KYBER_VECN] aa;
reg u16 c, b;
reg u16 d;
reg u64[4] t;
reg u64 i j;
inline int k;
Expand Down
2 changes: 1 addition & 1 deletion src/crypto_kem/kyber/kyber768/amd64/ref/verify.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn __verify(reg u64 ctp, reg ptr u8[KYBER_CT_LEN] ctpc) -> reg u64
inline
fn __cmov(reg ptr u8[KYBER_SYMBYTES] dst, reg u64 src cnd) -> reg ptr u8[KYBER_SYMBYTES]
{
reg u8 t1 t2 bcond;
reg u8 t1 t2;
inline int i;

cnd = -cnd;
Expand Down
1 change: 0 additions & 1 deletion src/crypto_sign/falcon/falcon512/amd64/avx2/test.jazz
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ fn __decode_public_key_external(reg u64 h pk) -> reg u32 {
reg u32 failed;
stack u16[ARRAY_N] h_buff;
reg u64 i;
reg u16 tmp16;

h_buff, failed = __decode_public_key(h_buff, pk);

Expand Down

0 comments on commit e278ded

Please sign in to comment.