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

Remove declarations of unused variables #126

Merged
merged 1 commit into from
Jun 27, 2024
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
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 @@ -336,7 +336,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;
stack ptr u8[KYBER_SYMBYTES] noiseseed_s;

Expand Down Expand Up @@ -175,10 +174,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;
stack ptr u8[KYBER_SYMBYTES] noiseseed_s;
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
2 changes: 0 additions & 2 deletions src/crypto_scalarmult/curve25519/amd64/ref5/scalarmult.jazz
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ require "curve25519.jinc"
export fn jade_scalarmult_curve25519_amd64_ref5(#spill_to_mmx reg u64 qp np pp) -> reg u64
{
reg u64 r;
stack u64 qps;
reg u64[4] q n p;

_ = #init_msf();
Expand All @@ -25,7 +24,6 @@ export fn jade_scalarmult_curve25519_amd64_ref5(#spill_to_mmx reg u64 qp np pp)
export fn jade_scalarmult_curve25519_amd64_ref5_base(#spill_to_mmx reg u64 qp np) -> reg u64
{
reg u64 r;
stack u64 qps;
reg u64[4] q n;

_ = #init_msf();
Expand Down
1 change: 0 additions & 1 deletion src/crypto_sign/dilithium/common/amd64/avx2/expandA.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ fn expandA_chunk(

stack u64[4] coeffs_filled;
stack u64[4] xof_offset;
reg u64 lane;

reg u256 v256 v256_zero;
reg u64 v64;
Expand Down
4 changes: 0 additions & 4 deletions src/crypto_sign/dilithium/common/amd64/avx2/expandA_end.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ fn expandA_aligned(stack u8[32] rho) -> stack u32[Li2_k * Li2_l * Li2_polydeg]
stack u32[Li2_k * Li2_l * Li2_polydeg] matrix;

stack u64[4] nonces;
stack u64[4] coeffs_left;
stack u64[4] xof_bytes_left;

inline int row col chunk idx lane;

Expand Down Expand Up @@ -62,8 +60,6 @@ fn expandA_unaligned2(stack u8[32] rho) -> stack u32[Li2_k * Li2_l * Li2_polydeg
stack u32[Li2_polydeg] scratch0 scratch1;

stack u64[4] nonces;
stack u64[4] coeffs_left;
stack u64[4] xof_bytes_left;

inline int row col chunk idx lane;

Expand Down
4 changes: 0 additions & 4 deletions src/crypto_sign/dilithium/common/amd64/avx2/expandMask.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ fn expandMask_poly_gamma1_217_4x(
stack u64 y_packed_filled;
stack u64 output_squeeze_counter;
stack u256[25] xof;
stack u64[4] coeffs_filled;
stack u64[4] xof_offset;

reg u64 addr v64;
reg u64 i j;
Expand Down Expand Up @@ -182,8 +180,6 @@ fn expandMask_poly_gamma1_219_4x(
stack u64 y_packed_filled;
stack u64 output_squeeze_counter;
stack u256[25] xof;
stack u64[4] coeffs_filled;
stack u64[4] xof_offset;

reg u64 addr v64;
reg u64 i j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ fn expandMask_buffered(

reg u32 v32;

reg ptr u32[Li2_polydeg] poly;

?{}, polys_generated = #set0_64();
while (polys_generated < Li2_l) {
if buffer_offset >= 4 {
Expand Down
7 changes: 2 additions & 5 deletions src/crypto_sign/dilithium/common/amd64/avx2/ntt.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ fn ntt_levels0t1(reg ptr u32[256] poly_ptr, reg u256 q, inline int offset)
// TODO: Interleave loads/stores with arithmetic ops

reg u256 zeta_qinv zeta;
reg u256 poly0 poly1 poly2 poly3 poly4 poly5 poly6 poly7 poly8;

inline int ii;
reg u256 poly0 poly1 poly2 poly3 poly4 poly5 poly6 poly7;

poly0 = #VMOVDQU_256(poly_ptr.[u256 (32 * (0*4 + offset))]);
poly1 = #VMOVDQU_256(poly_ptr.[u256 (32 * (1*4 + offset))]);
Expand Down Expand Up @@ -267,8 +265,7 @@ fn ntt_levels2t7(reg ptr u32[256] poly_ptr, reg u256 q, inline int offset)
// TODO: Interleave shuffles with butterflies

reg u256 zeta_qinv0 zeta_qinv1 zeta0 zeta1;
reg u256[8] poly;
reg u256 poly0 poly1 poly2 poly3 poly4 poly5 poly6 poly7 poly8 polyx;
reg u256 poly0 poly1 poly2 poly3 poly4 poly5 poly6 poly7 polyx;

poly0 = #VMOVDQU_256(poly_ptr.[u256 32 * (8*offset + 0)]);
poly1 = #VMOVDQU_256(poly_ptr.[u256 32 * (8*offset + 1)]);
Expand Down
7 changes: 2 additions & 5 deletions src/crypto_sign/dilithium/common/amd64/expandS.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ fn expandSEta2_poly(stack u8[64] rho_prime, reg u16 elem_idx, reg ptr u32[Li2_po

// temps
reg u64 i;
reg u64 addr;

reg u8 c;
reg u32 c32 t0 t1;
Expand Down Expand Up @@ -89,10 +88,8 @@ fn expandSEta4_poly(stack u8[64] rho_prime, reg u16 elem_idx, reg ptr u32[Li2_po

// temps
reg u64 i;
reg u8 c1 c2;
reg u32 u32_c1;
reg u8 c1;
reg u32 v;
reg u64 addr;

reg u8 c;
reg u32 c32;
Expand Down Expand Up @@ -144,4 +141,4 @@ fn expandSEta4_poly(stack u8[64] rho_prime, reg u16 elem_idx, reg ptr u32[Li2_po
}
}
return poly;
}
}
1 change: 0 additions & 1 deletion src/crypto_sign/dilithium/common/amd64/fips202.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ u64[24] roundconstants = {0x0000000000000001, 0x0000000000008082, 0x800000000000
0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008};

fn __keccakf1600_ref(reg ptr u64[25] state) -> reg ptr u64[25] {
inline int round;
reg ptr u64[24] constptr;

reg u64 rctr;
Expand Down
Loading
Loading