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

Fix/remove unused variable warning #102

Merged
merged 2 commits into from
Jan 17, 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
2 changes: 1 addition & 1 deletion scripts/ci/config/jasmin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9e87718c35083acc3349bee84e2b3a12ce385032
903c843f20cef1be802dea1f7ee11548e59d586c
2 changes: 0 additions & 2 deletions src/common/keccak/keccak1600/amd64/avx2/keccak1600.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ inline fn __add_full_block_avx2(

inline int i;
reg u64 j l t rate8;
reg u8 c;

rate8 = rate;
rate8 >>= 3;
Expand Down Expand Up @@ -141,7 +140,6 @@ inline fn __xtr_full_block_avx2(
inline int i;
stack u64[28] s_state;
reg u64 j l t len8;
reg u8 c;

for i = 0 to 7
{ s_state[u256 i] = state[i]; }
Expand Down
1 change: 0 additions & 1 deletion src/common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ inline fn __absorb_bmi1(
{
stack u64 s_in s_inlen s_rate;
reg u8 trail_byte;
reg u64 t;

// intermediate blocks
while ( inlen >= rate )
Expand Down
1 change: 0 additions & 1 deletion src/common/keccak/keccak1600/amd64/ref/keccak1600.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ inline fn __absorb_ref(
{
stack u64 s_in s_inlen s_rate;
reg u8 trail_byte;
reg u64 t;

// intermediate blocks
while ( inlen >= rate )
Expand Down
1 change: 0 additions & 1 deletion src/common/keccak/keccak1600/amd64/ref1/keccak1600.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ inline fn __absorb_ref1(
{
stack u64 s_in s_inlen s_rate;
reg u8 trail_byte;
reg u64 t;

// intermediate blocks
while ( inlen >= rate )
Expand Down
25 changes: 8 additions & 17 deletions src/crypto_onetimeauth/poly1305/amd64/avx/poly1305.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ inline fn __broadcast_r4_avx(
stack u128[5],
stack u128[4]
{
inline int i mask26;
inline int i;
stack u128[5] r44;
stack u128[4] r44x5;
reg u64[5] t;
reg u64 h l;

r44 = __unpack_avx(r44, r4, 0);

Expand All @@ -117,12 +116,10 @@ inline fn __poly1305_avx_setup(
stack u128[5], stack u128[4],
stack u128[5], stack u128[4]
{
inline int i mask26;
inline int i;
stack u128[5] r44 r22 r12;
stack u128[4] r44x5 r22x5 r12x5;
reg u128 t;
reg u64[3] rt;
reg u64 h l;

// rt = r; store rt
for i=0 to 2 { rt[i] = r[i]; } rt[2] = 0;
Expand Down Expand Up @@ -151,7 +148,7 @@ inline fn __load_avx(
reg u128[5],
reg u64
{
reg u128 t m0 m1;
reg u128 t;
reg u128[5] m;

t = (u128)[in + 0];
Expand Down Expand Up @@ -182,9 +179,7 @@ inline fn __load_avx(
inline fn __pack_avx(reg u128[5] h) -> reg u64[3]
{
reg bool cf;
inline int i;
reg u128[3] t;
reg u128 t0;
reg u128[2] u;
reg u64[3] d r;
reg u64 c cx4;
Expand Down Expand Up @@ -274,14 +269,12 @@ inline fn __carry_reduce_avx(
inline fn __mulmod_avx(
reg u128[5] h,
stack u128[5] s_r,
stack u128[4] s_rx5,
stack u128 s_mask26 s_bit25
stack u128[4] s_rx5
) -> reg u128[5]
{
reg u128[5] t;
reg u128[4] u;
reg u128 r0 r1 r4x5 r2 r3x5 r3 r2x5;
reg u128 mask26;

r0 = s_r[0];
r1 = s_r[1];
Expand Down Expand Up @@ -372,8 +365,6 @@ inline fn __mainloop_avx_v1(
reg u128[5],
reg u64
{
inline int i;
reg u128 mask26;
stack u128[5] s_h;
reg u128[5] m;
reg u128[5] t;
Expand Down Expand Up @@ -536,13 +527,13 @@ inline fn __final_avx_v0(
reg u128[5] h,
stack u128[5] s_r,
stack u128[4] s_rx5,
stack u128 s_mask26 s_bit25)
stack u128 s_mask26)
->
reg u128[5]
{
reg u128 mask26;

h = __mulmod_avx(h, s_r, s_rx5, s_mask26, s_bit25);
h = __mulmod_avx(h, s_r, s_rx5);
mask26 = s_mask26;
h = __carry_reduce_avx(h, mask26);

Expand All @@ -565,7 +556,7 @@ inline fn __poly1305_avx_update(
{
inline int i;
stack u128 s_mask26 s_bit25;
reg u128[5] h m;
reg u128[5] h;
reg u128 mask26 t;
reg u64[3] h64;

Expand All @@ -580,7 +571,7 @@ inline fn __poly1305_avx_update(
inlen -= 64;
}

h = __final_avx_v0(h, r12, r12x5, s_mask26, s_bit25);
h = __final_avx_v0(h, r12, r12x5, s_mask26);
h64 = __pack_avx(h);

return in, inlen, h64;
Expand Down
18 changes: 5 additions & 13 deletions src/crypto_onetimeauth/poly1305/amd64/avx2/poly1305.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ inline fn __poly1305_avx2_setup(
stack u256[5],
stack u256[4]
{
inline int i mask26;
inline int i;
stack u256[5] r4444 r1234;
stack u256[4] r4444x5 r1234x5;
reg u256 t;
reg u64[3] rt;
reg u64 h l;

// rt = r; store rt
for i=0 to 2 { rt[i] = r[i]; } rt[2] = 0;
Expand Down Expand Up @@ -195,7 +193,6 @@ inline fn __load_avx2(
inline fn __pack_avx2(reg u256[5] h) -> reg u64[3]
{
reg bool cf;
inline int i;
reg u256[3] t;
reg u128 t0;
reg u256[2] u;
Expand Down Expand Up @@ -372,15 +369,11 @@ inline fn __carry_reduce_avx2(
inline fn __add_mulmod_avx2(
reg u256[5] h m,
stack u256[5] s_r,
stack u256[4] s_rx5,
stack u256 s_mask26
s_bit25
) -> reg u256[5]
stack u256[4] s_rx5) -> reg u256[5]
{
reg u256[5] t;
reg u256[4] u;
reg u256 r0 r1 r4x5 r2 r3x5 r3 r2x5;
reg u256 mask26;
inline int i;

r0 = s_r[0];
Expand Down Expand Up @@ -476,7 +469,7 @@ inline fn __mainloop_avx2_v0(
{
reg u256 mask26;

h = __add_mulmod_avx2(h, m, s_r, s_rx5, s_mask26, s_bit25);
h = __add_mulmod_avx2(h, m, s_r, s_rx5);
mask26 = s_mask26;
h = __carry_reduce_avx2(h, mask26);
m, in = __load_avx2(in, mask26, s_bit25);
Expand Down Expand Up @@ -628,12 +621,11 @@ inline fn __final_avx2_v0(
stack u256[5] s_r,
stack u256[4] s_rx5,
stack u256 s_mask26
s_bit25
) -> reg u256[5]
{
reg u256 mask26;

h = __add_mulmod_avx2(h, m, s_r, s_rx5, s_mask26, s_bit25);
h = __add_mulmod_avx2(h, m, s_r, s_rx5);
mask26 = s_mask26;
h = __carry_reduce_avx2(h, mask26);

Expand Down Expand Up @@ -674,7 +666,7 @@ inline fn __poly1305_avx2_update(
}
inlen -= 64;

h = __final_avx2_v0(h, m, r1234, r1234x5, s_mask26, s_bit25);
h = __final_avx2_v0(h, m, r1234, r1234x5, s_mask26);
h64 = __pack_avx2(h);

return in, inlen, h64;
Expand Down
5 changes: 1 addition & 4 deletions src/crypto_onetimeauth/poly1305/amd64/ref/poly1305.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ inline fn __poly1305_setup_ref(reg u64 k) -> reg u64[3], reg u64[3], reg u64

inline fn __poly1305_update_ref(reg u64 in inlen, reg u64[3] h r) -> reg u64, reg u64, reg u64[3]
{
reg bool cf;
reg u64[2] m;

while(inlen >= 16)
{
h = __load_add(h, in);
Expand All @@ -207,7 +204,7 @@ inline fn __poly1305_update_ref(reg u64 in inlen, reg u64[3] h r) -> reg u64, re

inline fn __poly1305_last_ref(reg u64 in inlen k, reg u64[3] h r) -> reg u64[2]
{
reg u64[2] m s h2;
reg u64[2] s h2;

if(inlen > 0)
{ h = __load_last_add(h, in, inlen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inline fn __cswap5(
stack u64[5]
{
inline int i;
reg u64[5] t4 x2r x3r z3r;
reg u64[5] t4 x2r x3r;
reg u64 t mask;

?{}, mask = #set0();
Expand Down
1 change: 0 additions & 1 deletion src/crypto_scalarmult/curve25519/amd64/common/51/sub5.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ inline fn __sub5_sss(stack u64[5] fs gs) -> stack u64[5]

inline fn __sub5_rss(stack u64[5] fs gs) -> reg u64[5]
{
stack u64[5] hs;
reg u64[5] h f;

f = #copy(fs);
Expand Down
1 change: 0 additions & 1 deletion src/crypto_scalarmult/curve25519/amd64/common/64/sub4.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ inline fn __sub4_sss(stack u64[4] fs gs) -> stack u64[4]

inline fn __sub4_rss(stack u64[4] fs gs) -> reg u64[4]
{
stack u64[4] hs;
reg u64[4] h f;

f = #copy(fs);
Expand Down
2 changes: 1 addition & 1 deletion src/crypto_scalarmult/curve25519/amd64/mulx/invert4.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require "sqr4.jinc"
inline fn __invert4(reg u64[4] f) -> reg u64[4]
{
reg u32 i;
stack u64[4] fs t0s t1s t2s t3s;
stack u64[4] fs t0s t1s t2s;
reg u64[4] t0 t1 t2 t3;

fs = #copy(f);
Expand Down
7 changes: 1 addition & 6 deletions src/crypto_scalarmult/curve25519/amd64/mulx/mul4.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ inline fn __mul4_c0
reg bool,
reg bool
{
inline int i;
reg u64 hi lo;
reg u64 lo;
reg u64[4] h r;

(h[1], h[0]) = #MULX ( f0, g[0] );
Expand Down Expand Up @@ -44,7 +43,6 @@ inline fn __mul4_c1
reg bool,
reg bool
{
inline int i;
reg u64 hi lo;

( hi, lo ) = #MULX ( f, g[0] );
Expand Down Expand Up @@ -81,7 +79,6 @@ inline fn __mul4_c2
reg bool,
reg bool
{
inline int i;
reg u64 hi lo;

( hi, lo ) = #MULX ( f, g[0] );
Expand Down Expand Up @@ -118,7 +115,6 @@ inline fn __mul4_c3
reg bool,
reg bool
{
inline int i;
reg u64 hi lo;

( hi, lo ) = #MULX ( f, g[0] );
Expand Down Expand Up @@ -253,7 +249,6 @@ inline fn __mul4_rss(stack u64[4] fs gs) -> reg u64[4]

inline fn __mul4_a24_rs(stack u64[4] fs, inline u64 a24) -> reg u64[4]
{
inline int i;
reg bool cf;
reg u64[4] h;
reg u64 c r0 lo;
Expand Down
1 change: 0 additions & 1 deletion src/crypto_scalarmult/curve25519/amd64/mulx/reduce4.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ inline fn __reduce4
reg bool cf of // cf = 0 and of = 0
) -> reg u64[4]
{
inline int i;
reg u64 hi lo;

//
Expand Down
1 change: 0 additions & 1 deletion src/crypto_scalarmult/curve25519/amd64/mulx/sqr4.jinc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ require "reduce4.jinc"
inline fn __sqr4_rr(reg u64[4] f) -> reg u64[4]
{
reg bool cf of;
inline int i;
reg u64[8] t;
reg u64[4] h r;
reg u64 z _38 fx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ inline fn __sum_states_ref_32(reg u32[16] k, stack u32 k15, stack u32[16] st) ->

inline fn __store_ref_32(
reg mut ptr u8[32] out,
reg u32[16] k,
stack u32 k15)
reg u32[16] k)
->
reg ptr u8[32]
{
Expand Down Expand Up @@ -178,7 +177,7 @@ inline fn __salsa20_ref_32(
k, k15 = __sum_states_ref_32(k, k15, st);

out = s_out;
out = __store_ref_32(out, k, k15);
out = __store_ref_32(out, k);

return out;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
param int SALSA20_ROUNDS=20;

from Jade require "crypto_stream/xsalsa20/amd64/ref/hsalsa20.jinc"
require "salsa20_32D.jinc"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ inline fn __sum_states_ref_32(reg u32[16] k, stack u32 k15, stack u32[16] st) ->

inline fn __store_ref_32(
reg mut ptr u8[32] out,
reg u32[16] k,
stack u32 k15)
reg u32[16] k)
->
reg ptr u8[32]
{
Expand Down Expand Up @@ -178,7 +177,7 @@ inline fn __salsa20_ref_32(
k, k15 = __sum_states_ref_32(k, k15, st);

out = s_out;
out = __store_ref_32(out, k, k15);
out = __store_ref_32(out, k);

return out;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
param int SALSA20_ROUNDS=20;

from Jade require "crypto_stream/xsalsa20/amd64/ref/hsalsa20.jinc"
require "salsa20_32D.jinc"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ inline fn __poly1305_last_ref_k(
reg u64[2]
{
reg bool cf;
reg u64[2] m s h2;
reg u64[2] h2;

if(inlen > 0)
{ h = __load_last_add(h, in, inlen);
Expand Down
Loading