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

Add CI #4

Merged
merged 5 commits into from
Apr 18, 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
29 changes: 29 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests
on:
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: install dependencies
run: sudo apt install gcc-aarch64-linux-gnu qemu-user
- name: Run Dilithium NTT Tests
run: |
make run-cross-ntt_dilithium
- name: Run Kyber NTT Tests
run: |
make run-cross-ntt_kyber
- name: Run Kyber NTT Tests
run: |
make run-cross-ntt_kyber
- name: Run X25519 Tests
run: |
make run-cross-x25519
- name: Run Keccak Tests
run: |
make clean
make run-cross-keccak_neon
2 changes: 1 addition & 1 deletion asm/manual/keccak_f1600/keccak_f1600_variants.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void keccak_f1600_x2_scalar_C ( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UI
void keccak_f1600_x2_bas ( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UINT64] );
#include <arm_neon.h>
typedef uint64x2_t v128;
void keccak_f1600_x2_neon_C_cothan( v128 state[25] );
void keccak_f1600_x2_neon_C_cothan( uint64_t stateu64[2*25] );

/* PQAX implementations */
void keccak_f1600_x2_v84a_asm_v1( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UINT64] );
Expand Down
3 changes: 2 additions & 1 deletion asm/manual/keccak_f1600/third_party/keccakx2_cothan.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ static const uint64_t neon_KeccakF_RoundConstants[NROUNDS] = {
*
* Arguments: - v128 *state: pointer to input/output Keccak state
**************************************************/
void keccak_f1600_x2_neon_C_cothan(v128 state[25])
void keccak_f1600_x2_neon_C_cothan(uint64_t stateu64[2*25])
{
v128 *state = (v128 *) stateu64;
v128 Aba, Abe, Abi, Abo, Abu;
v128 Aga, Age, Agi, Ago, Agu;
v128 Aka, Ake, Aki, Ako, Aku;
Expand Down
2 changes: 1 addition & 1 deletion slothy
Submodule slothy updated 90 files
+15 −0 .github/workflows/test_basic.yaml
+26 −179 README.md
+197 −3 example.py
+12 −0 examples/misc/gen_roots.py
+24 −0 examples/naive/aarch64/aarch64_simple0.s
+55 −0 examples/naive/aarch64/aarch64_simple0_loop.s
+55 −0 examples/naive/aarch64/aarch64_simple0_macros.s
+44 −37 examples/naive/aarch64/intt_dilithium_1234_5678.s
+515 −0 examples/naive/aarch64/intt_dilithium_1234_5678_manual_ld4.s
+542 −0 examples/naive/aarch64/intt_dilithium_123_45678.s
+551 −0 examples/naive/aarch64/intt_dilithium_123_45678_manual_ld4.s
+557 −0 examples/naive/aarch64/intt_dilithium_123_456_78_twiddles.s
+461 −0 examples/naive/aarch64/intt_kyber_123_4567.s
+456 −0 examples/naive/aarch64/intt_kyber_123_4567_manual_ld4.s
+494 −0 examples/naive/aarch64/intt_kyber_123_45_67_twiddles.s
+4 −10 examples/naive/aarch64/ntt_dilithium_1234_5678.s
+4 −10 examples/naive/aarch64/ntt_dilithium_1234_5678_manual_st4.s
+4 −10 examples/naive/aarch64/ntt_dilithium_123_45678.s
+4 −10 examples/naive/aarch64/ntt_dilithium_123_45678_manual_st4.s
+4 −10 examples/naive/aarch64/ntt_dilithium_123_45678_red.s
+4 −10 examples/naive/aarch64/ntt_dilithium_123_45678_w_scalar.s
+4 −10 examples/naive/aarch64/ntt_dilithium_123_45678_w_scalar_red.s
+4 −10 examples/naive/aarch64/ntt_kyber_1234_567.s
+4 −10 examples/naive/aarch64/ntt_kyber_1234_567_manual_st4.s
+4 −10 examples/naive/aarch64/ntt_kyber_123_4567.s
+4 −10 examples/naive/aarch64/ntt_kyber_123_4567_manual_st4.s
+4 −10 examples/naive/aarch64/ntt_kyber_123_4567_scalar_load.s
+4 −10 examples/naive/aarch64/ntt_kyber_123_4567_scalar_load_store.s
+4 −10 examples/naive/aarch64/ntt_kyber_123_4567_scalar_store.s
+125 −0 examples/opt/aarch64/aarch64_simple0_loop_opt_a55.s
+117 −0 examples/opt/aarch64/aarch64_simple0_loop_opt_a72.s
+117 −0 examples/opt/aarch64/aarch64_simple0_macros_opt_a55.s
+130 −0 examples/opt/aarch64/aarch64_simple0_macros_opt_a72.s
+78 −0 examples/opt/aarch64/aarch64_simple0_opt_a55.s
+91 −0 examples/opt/aarch64/aarch64_simple0_opt_a72.s
+1,746 −0 examples/opt/aarch64/intt_dilithium_1234_5678_manual_ld4_opt_a55.s
+1,810 −0 examples/opt/aarch64/intt_dilithium_1234_5678_manual_ld4_opt_a72.s
+1,934 −0 examples/opt/aarch64/intt_dilithium_1234_5678_manual_ld4_opt_m1_firestorm.s
+1,710 −0 examples/opt/aarch64/intt_dilithium_1234_5678_manual_ld4_opt_m1_icestorm.s
+1,718 −0 examples/opt/aarch64/intt_dilithium_1234_5678_opt_a55.s
+1,794 −0 examples/opt/aarch64/intt_dilithium_1234_5678_opt_a72.s
+2,096 −0 examples/opt/aarch64/intt_dilithium_1234_5678_opt_m1_firestorm.s
+1,764 −0 examples/opt/aarch64/intt_dilithium_1234_5678_opt_m1_icestorm.s
+2,327 −0 examples/opt/aarch64/intt_dilithium_123_45678_manual_ld4_opt_a55.s
+2,629 −0 examples/opt/aarch64/intt_dilithium_123_45678_manual_ld4_opt_a72.s
+2,531 −0 examples/opt/aarch64/intt_dilithium_123_45678_manual_ld4_opt_m1_firestorm.s
+2,155 −0 examples/opt/aarch64/intt_dilithium_123_45678_manual_ld4_opt_m1_icestorm.s
+2,233 −0 examples/opt/aarch64/intt_dilithium_123_45678_opt_a55.s
+2,483 −0 examples/opt/aarch64/intt_dilithium_123_45678_opt_a72.s
+2,335 −0 examples/opt/aarch64/intt_dilithium_123_45678_opt_m1_firestorm.s
+1,999 −0 examples/opt/aarch64/intt_dilithium_123_45678_opt_m1_icestorm.s
+557 −0 examples/opt/aarch64/intt_dilithium_123_456_78_twiddles.s
+1,482 −0 examples/opt/aarch64/intt_kyber_123_4567_manual_ld4_opt_a55.s
+1,823 −0 examples/opt/aarch64/intt_kyber_123_4567_manual_ld4_opt_a72.s
+1,970 −0 examples/opt/aarch64/intt_kyber_123_4567_manual_ld4_opt_m1_firestorm.s
+1,474 −0 examples/opt/aarch64/intt_kyber_123_4567_manual_ld4_opt_m1_icestorm.s
+1,516 −0 examples/opt/aarch64/intt_kyber_123_4567_opt_a55.s
+1,839 −0 examples/opt/aarch64/intt_kyber_123_4567_opt_a72.s
+1,776 −0 examples/opt/aarch64/intt_kyber_123_4567_opt_m1_firestorm.s
+1,440 −0 examples/opt/aarch64/intt_kyber_123_4567_opt_m1_icestorm.s
+493 −0 examples/opt/aarch64/intt_kyber_123_45_67_twiddles.s
+541 −0 examples/opt/aarch64/ntt_dilithium_1234_5678_twiddles.s
+2 −4 slothy-cli
+72 −6 slothy/core/config.py
+396 −48 slothy/core/core.py
+4 −0 slothy/core/dataflow.py
+2 −2 slothy/core/heuristics.py
+42 −26 slothy/core/slothy.py
+33 −15 slothy/helper.py
+103 −11 slothy/targets/aarch64/aarch64_neon.py
+3 −3 slothy/targets/aarch64/apple_m1_firestorm_experimental.py
+3 −3 slothy/targets/aarch64/apple_m1_icestorm_experimental.py
+10 −2 slothy/targets/aarch64/cortex_a55.py
+3 −3 slothy/targets/aarch64/cortex_a72_frontend.py
+22 −6 slothy/targets/aarch64/neoverse_n1_experimental.py
+3 −2 slothy/targets/arm_v81m/arch_v81m.py
+1,050 −0 tutorial/README.md
+3,652 −0 tutorial/opt/X25519-AArch64-simple_opt.s
+125 −0 tutorial/opt/aarch64_simple0_loop_opt_a55.s
+421 −0 tutorial/opt/aarch64_simple0_loop_opt_mca_a55.s
+117 −0 tutorial/opt/aarch64_simple0_macros_opt_a55.s
+78 −0 tutorial/opt/aarch64_simple0_opt_a55.s
+1,350 −0 tutorial/opt/ntt_kyber_123_4567_opt_a55.s
+23 −0 tutorial/tutorial-3a.py
+23 −0 tutorial/tutorial-3b.py
+26 −0 tutorial/tutorial-4.py
+27 −0 tutorial/tutorial-5.py
+27 −0 tutorial/tutorial-6.py
+37 −0 tutorial/tutorial-7.py
+27 −0 tutorial/tutorial_all.sh
2 changes: 1 addition & 1 deletion tests/keccak_neon/manual/keccak_f1600_variants.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void keccak_f1600_x2_scalar_C ( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UI
void keccak_f1600_x2_bas ( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UINT64] );
#include <arm_neon.h>
typedef uint64x2_t v128;
void keccak_f1600_x2_neon_C_cothan( v128 state[25] );
void keccak_f1600_x2_neon_C_cothan( uint64_t stateu64[2*25] );

/* PQAX implementations */
void keccak_f1600_x2_v84a_asm_v1( uint64_t state[KECCAK_F1600_X2_STATE_SIZE_UINT64] );
Expand Down
3 changes: 2 additions & 1 deletion tests/keccak_neon/manual/third_party/keccakx2_cothan.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ static const uint64_t neon_KeccakF_RoundConstants[NROUNDS] = {
*
* Arguments: - v128 *state: pointer to input/output Keccak state
**************************************************/
void keccak_f1600_x2_neon_C_cothan(v128 state[25])
void keccak_f1600_x2_neon_C_cothan(uint64_t stateu64[2*25])
{
v128 *state = (v128 *) stateu64;
v128 Aba, Abe, Abi, Abo, Abu;
v128 Aga, Age, Agi, Ago, Agu;
v128 Aka, Ake, Aki, Ako, Aku;
Expand Down
Loading