diff --git a/src/common/keccak/keccak1600/amd64/spec/keccak1600.jinc b/src/common/keccak/keccak1600/amd64/spec/keccak1600.jinc index 7dd3b9e3..783813b2 100644 --- a/src/common/keccak/keccak1600/amd64/spec/keccak1600.jinc +++ b/src/common/keccak/keccak1600/amd64/spec/keccak1600.jinc @@ -136,7 +136,7 @@ inline fn __xtr_bytes_spec( inline fn __keccak1600_spec(reg u64 out outlen in inlen, reg u8 trail_byte, reg u64 rate) { stack u64[25] state; - stack u64 s_out s_outlen s_in s_inlen s_rate; + #mmx reg u64 s_out s_outlen s_in s_inlen s_rate; stack u8 s_trail_byte; s_out = out; diff --git a/src/crypto_xof/shake128/amd64/avx2/shake128.jinc b/src/crypto_xof/shake128/amd64/avx2/shake128.jinc index 187aac91..70875d0c 100644 --- a/src/crypto_xof/shake128/amd64/avx2/shake128.jinc +++ b/src/crypto_xof/shake128/amd64/avx2/shake128.jinc @@ -1,6 +1,6 @@ from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" -inline fn __shake128_avx2(reg u64 out outlen in inlen) +inline fn __shake128_avx2(reg u64 out outlen in inlen, #msf reg u64 ms) { reg u64 rate; reg u8 trail_byte; @@ -8,7 +8,7 @@ inline fn __shake128_avx2(reg u64 out outlen in inlen) trail_byte = 0x1F; rate = (1344/8); - __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate); + __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); } diff --git a/src/crypto_xof/shake128/amd64/avx2/xof.jazz b/src/crypto_xof/shake128/amd64/avx2/xof.jazz index 23dd3b45..6b41b262 100644 --- a/src/crypto_xof/shake128/amd64/avx2/xof.jazz +++ b/src/crypto_xof/shake128/amd64/avx2/xof.jazz @@ -3,7 +3,11 @@ require "shake128.jinc" export fn jade_xof_shake128_amd64_avx2(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; - __shake128_avx2(output, output_length, input, input_length); + #msf reg u64 ms; + + ms = #init_msf(); + + __shake128_avx2(output, output_length, input, input_length, ms); ?{}, r = #set0(); return r; } diff --git a/src/crypto_xof/shake128/amd64/bmi1/xof.jazz b/src/crypto_xof/shake128/amd64/bmi1/xof.jazz index 19921991..4c32db8d 100644 --- a/src/crypto_xof/shake128/amd64/bmi1/xof.jazz +++ b/src/crypto_xof/shake128/amd64/bmi1/xof.jazz @@ -3,6 +3,9 @@ require "shake128.jinc" export fn jade_xof_shake128_amd64_bmi1(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake128_bmi1(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake128/amd64/ref/xof.jazz b/src/crypto_xof/shake128/amd64/ref/xof.jazz index ad386786..3cb07b30 100644 --- a/src/crypto_xof/shake128/amd64/ref/xof.jazz +++ b/src/crypto_xof/shake128/amd64/ref/xof.jazz @@ -3,6 +3,9 @@ require "shake128.jinc" export fn jade_xof_shake128_amd64_ref(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake128_ref(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake128/amd64/ref1/xof.jazz b/src/crypto_xof/shake128/amd64/ref1/xof.jazz index 28e571ea..063f9637 100644 --- a/src/crypto_xof/shake128/amd64/ref1/xof.jazz +++ b/src/crypto_xof/shake128/amd64/ref1/xof.jazz @@ -3,6 +3,9 @@ require "shake128.jinc" export fn jade_xof_shake128_amd64_ref1(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake128_ref1(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake256/amd64/avx2/shake256.jinc b/src/crypto_xof/shake256/amd64/avx2/shake256.jinc index 37c02fef..17a24c27 100644 --- a/src/crypto_xof/shake256/amd64/avx2/shake256.jinc +++ b/src/crypto_xof/shake256/amd64/avx2/shake256.jinc @@ -1,6 +1,6 @@ from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" -inline fn __shake256_avx2(reg u64 out outlen in inlen) +inline fn __shake256_avx2(reg u64 out outlen in inlen, #msf reg u64 ms) { reg u64 rate; reg u8 trail_byte; @@ -8,7 +8,7 @@ inline fn __shake256_avx2(reg u64 out outlen in inlen) trail_byte = 0x1F; rate = (1088/8); - __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate); + __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); } diff --git a/src/crypto_xof/shake256/amd64/avx2/xof.jazz b/src/crypto_xof/shake256/amd64/avx2/xof.jazz index 169f7701..80d3ae69 100644 --- a/src/crypto_xof/shake256/amd64/avx2/xof.jazz +++ b/src/crypto_xof/shake256/amd64/avx2/xof.jazz @@ -3,7 +3,12 @@ require "shake256.jinc" export fn jade_xof_shake256_amd64_avx2(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; - __shake256_avx2(output, output_length, input, input_length); + #msf reg u64 ms; + + ms = #init_msf(); + + __shake256_avx2(output, output_length, input, input_length, ms); + ?{}, r = #set0(); return r; } diff --git a/src/crypto_xof/shake256/amd64/bmi1/xof.jazz b/src/crypto_xof/shake256/amd64/bmi1/xof.jazz index f0988dd9..0a01874f 100644 --- a/src/crypto_xof/shake256/amd64/bmi1/xof.jazz +++ b/src/crypto_xof/shake256/amd64/bmi1/xof.jazz @@ -3,6 +3,9 @@ require "shake256.jinc" export fn jade_xof_shake256_amd64_bmi1(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake256_bmi1(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake256/amd64/ref/xof.jazz b/src/crypto_xof/shake256/amd64/ref/xof.jazz index 8eb4e643..c876881e 100644 --- a/src/crypto_xof/shake256/amd64/ref/xof.jazz +++ b/src/crypto_xof/shake256/amd64/ref/xof.jazz @@ -3,6 +3,9 @@ require "shake256.jinc" export fn jade_xof_shake256_amd64_ref(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake256_ref(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake256/amd64/ref1/xof.jazz b/src/crypto_xof/shake256/amd64/ref1/xof.jazz index 2051d26f..23d811bb 100644 --- a/src/crypto_xof/shake256/amd64/ref1/xof.jazz +++ b/src/crypto_xof/shake256/amd64/ref1/xof.jazz @@ -3,6 +3,9 @@ require "shake256.jinc" export fn jade_xof_shake256_amd64_ref1(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake256_ref1(output, output_length, input, input_length); ?{}, r = #set0(); return r; diff --git a/src/crypto_xof/shake256/amd64/spec/xof.jazz b/src/crypto_xof/shake256/amd64/spec/xof.jazz index f7045070..04b30887 100644 --- a/src/crypto_xof/shake256/amd64/spec/xof.jazz +++ b/src/crypto_xof/shake256/amd64/spec/xof.jazz @@ -3,6 +3,9 @@ require "shake256.jinc" export fn jade_xof_shake256_amd64_spec(reg u64 output output_length input input_length) -> reg u64 { reg u64 r; + + _ = #init_msf(); + __shake256_spec(output, output_length, input, input_length); ?{}, r = #set0(); return r;