├── .github └── workflows │ ├── amd64-linux-main-build-instructions.yml.0 │ ├── amd64-linux-main-proof.yml.0 │ ├── amd64-linux-main-safety.yml.0 │ ├── amd64-linux-main.yml.0 │ └── amd64-linux.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── LICENSES ├── Apache-2.0.txt └── CC0-1.0.txt ├── README.md ├── bench ├── .gitignore ├── Makefile ├── Makefile.partial_implementations └── common │ ├── alignedcalloc.c │ ├── benchrandombytes.c │ ├── config.h │ ├── cpucycles.c │ ├── crypto_hash.c │ ├── crypto_kem.c │ ├── crypto_onetimeauth.c │ ├── crypto_scalarmult.c │ ├── crypto_secretbox.c │ ├── crypto_sign.c │ ├── crypto_stream.c │ ├── crypto_xof.c │ ├── increment.c │ ├── min.c │ ├── namespace.h │ ├── printbench.c │ └── stability.c ├── build-common ├── Makefile ├── Makefile.checksafety ├── Makefile.checksct ├── Makefile.common └── Makefile.functions ├── default.nix ├── doc └── api.md ├── ext ├── .gitignore └── randombytes │ ├── Makefile │ ├── randombytes.c │ └── randombytes.h ├── flake.lock ├── flake.nix ├── oldsrc-should-delete ├── .gitignore ├── Makefile ├── Makefile.checksafety ├── Makefile.checksct ├── Makefile.common ├── Makefile.functions ├── common │ ├── EcFlags.mk │ ├── keccak │ │ ├── common │ │ │ ├── fips202_4x_DIRTY.jinc │ │ │ ├── fips202_DIRTY.jinc │ │ │ ├── fips202_params.jinc │ │ │ └── fips202_ref_DIRTY.jinc │ │ └── keccak1600 │ │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── keccak1600.jinc │ │ │ ├── keccak1600_nomsf.jinc │ │ │ ├── keccakf1600.jinc │ │ │ ├── keccakf1600_4x.jinc │ │ │ └── keccakf1600_nomsf.jinc │ │ │ ├── bmi1 │ │ │ ├── Makefile │ │ │ ├── keccak1600.jinc │ │ │ └── keccakf1600.jinc │ │ │ ├── ref │ │ │ ├── Makefile │ │ │ ├── keccak1600.jinc │ │ │ ├── keccakf1600.jinc │ │ │ └── keccakf1600_v0.jinc │ │ │ ├── ref1 │ │ │ ├── Makefile │ │ │ ├── keccak1600.jinc │ │ │ └── keccakf1600.jinc │ │ │ └── spec │ │ │ ├── keccak1600.jinc │ │ │ ├── keccakf1600.jinc │ │ │ └── keccakf1600_globals.jinc │ └── tofromstack.jinc ├── crypto_hash │ ├── EcFlags.mk │ ├── sha256 │ │ ├── META.yml │ │ └── amd64 │ │ │ └── ref │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ └── api.h │ │ │ ├── sha256.jinc │ │ │ └── sha256_globals.jinc │ ├── sha3-224 │ │ ├── META.yml │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-224.jinc │ │ │ ├── bmi1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-224.jinc │ │ │ ├── ref │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-224.jinc │ │ │ └── ref1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ └── api.h │ │ │ └── sha3-224.jinc │ ├── sha3-256 │ │ ├── META.yml │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-256.jinc │ │ │ ├── bmi1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-256.jinc │ │ │ ├── ref │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-256.jinc │ │ │ └── ref1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ └── api.h │ │ │ └── sha3-256.jinc │ ├── sha3-384 │ │ ├── META.yml │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-384.jinc │ │ │ ├── bmi1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-384.jinc │ │ │ ├── ref │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-384.jinc │ │ │ └── ref1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ └── api.h │ │ │ └── sha3-384.jinc │ ├── sha3-512 │ │ ├── META.yml │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-512.jinc │ │ │ ├── bmi1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-512.jinc │ │ │ ├── ref │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── sha3-512.jinc │ │ │ └── ref1 │ │ │ ├── Makefile │ │ │ ├── hash.jazz │ │ │ ├── include │ │ │ └── api.h │ │ │ └── sha3-512.jinc │ └── sha512 │ │ ├── META.yml │ │ └── amd64 │ │ └── ref │ │ ├── Makefile │ │ ├── hash.jazz │ │ ├── include │ │ └── api.h │ │ ├── sha512.jinc │ │ └── sha512_globals.jinc ├── crypto_kem │ ├── EcFlags.mk │ ├── kyber │ │ ├── common │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ ├── consts.jinc │ │ │ │ ├── poly.jinc │ │ │ │ ├── polyvec.jinc │ │ │ │ ├── reduce.jinc │ │ │ │ ├── shuffle.jinc │ │ │ │ └── verify.jinc │ │ │ │ ├── kem.jinc │ │ │ │ └── ref │ │ │ │ ├── gen_matrix.jinc │ │ │ │ ├── poly.jinc │ │ │ │ ├── polyvec.jinc │ │ │ │ ├── reduce.jinc │ │ │ │ ├── verify.jinc │ │ │ │ └── zetas.jinc │ │ ├── kyber512 │ │ │ ├── META.yml │ │ │ ├── amd64 │ │ │ │ ├── avx2 │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── gen_matrix.jinc │ │ │ │ │ ├── include │ │ │ │ │ │ └── api.h │ │ │ │ │ ├── indcpa.jinc │ │ │ │ │ └── kem.jazz │ │ │ │ └── ref │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ │ ├── indcpa.jinc │ │ │ │ │ └── kem.jazz │ │ │ ├── common │ │ │ │ └── params.jinc │ │ │ └── hacspec │ │ │ │ └── empty │ │ └── kyber768 │ │ │ ├── META.yml │ │ │ ├── amd64 │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── gen_matrix.jinc │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ ├── indcpa.jinc │ │ │ │ └── kem.jazz │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ ├── indcpa.jinc │ │ │ │ ├── kem.jazz │ │ │ │ ├── kem.jinc │ │ │ │ ├── params.jinc │ │ │ │ ├── poly.jinc │ │ │ │ ├── polyvec.jinc │ │ │ │ └── verify.jinc │ │ │ ├── common │ │ │ └── params.jinc │ │ │ └── hacspec │ │ │ └── empty │ ├── mlkem │ │ └── mlkem768 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── consts.jinc │ │ │ ├── fips202.jinc │ │ │ ├── fips202_4x.jinc │ │ │ ├── fips202_common.jinc │ │ │ ├── gen_matrix.jinc │ │ │ ├── gen_matrix_globals.jinc │ │ │ ├── include │ │ │ │ └── api.h │ │ │ ├── indcpa.jinc │ │ │ ├── keccak │ │ │ │ ├── keccakf1600.jinc │ │ │ │ ├── keccakf1600_4x_avx2_compact.jinc │ │ │ │ ├── keccakf1600_avx2.jinc │ │ │ │ └── keccakf1600_generic.jinc │ │ │ ├── kem.jazz │ │ │ ├── kem.jinc │ │ │ ├── params.jinc │ │ │ ├── poly.jinc │ │ │ ├── polyvec.jinc │ │ │ ├── reduce.jinc │ │ │ ├── shuffle.jinc │ │ │ └── verify.jinc │ │ │ └── ref │ │ │ ├── Makefile │ │ │ ├── fips202.jinc │ │ │ ├── gen_matrix.jinc │ │ │ ├── include │ │ │ └── api.h │ │ │ ├── indcpa.jinc │ │ │ ├── kem.jazz │ │ │ ├── kem.jinc │ │ │ ├── params.jinc │ │ │ ├── poly.jinc │ │ │ ├── polyvec.jinc │ │ │ ├── reduce.jinc │ │ │ ├── verify.jinc │ │ │ └── zetas.jinc │ └── xwing │ │ ├── META.yml │ │ └── amd64 │ │ ├── avx2 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ └── kem.jazz │ │ └── ref │ │ ├── Makefile │ │ ├── include │ │ └── api.h │ │ ├── kem.jazz │ │ ├── kem.jinc │ │ ├── params.jinc │ │ ├── scalarmult.jinc │ │ └── sha3.jinc ├── crypto_onetimeauth │ ├── EcFlags.mk │ └── poly1305 │ │ ├── META.yml │ │ └── amd64 │ │ ├── avx │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── onetimeauth.jazz │ │ └── poly1305.jinc │ │ ├── avx2 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── onetimeauth.jazz │ │ └── poly1305.jinc │ │ └── ref │ │ ├── Makefile │ │ ├── include │ │ └── api.h │ │ ├── onetimeauth.jazz │ │ └── poly1305.jinc ├── crypto_scalarmult │ ├── EcFlags.mk │ └── curve25519 │ │ ├── META.yml │ │ └── amd64 │ │ ├── mulx │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ └── scalarmult.jazz │ │ ├── ref4 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ └── scalarmult.jazz │ │ └── ref5 │ │ ├── Makefile │ │ ├── include │ │ └── api.h │ │ └── scalarmult.jazz ├── crypto_secretbox │ ├── EcFlags.mk │ └── xsalsa20poly1305 │ │ ├── META.yml │ │ └── amd64 │ │ ├── avx │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── poly1305_kD.jinc │ │ ├── salsa20_32D.jinc │ │ ├── secretbox.jazz │ │ ├── xsalsa20_32D.jinc │ │ └── xsalsa20poly1305.jinc │ │ ├── avx2 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── poly1305_kD.jinc │ │ ├── salsa20_32D.jinc │ │ ├── secretbox.jazz │ │ ├── xsalsa20_32D.jinc │ │ └── xsalsa20poly1305.jinc │ │ └── ref │ │ ├── Makefile │ │ ├── include │ │ └── api.h │ │ ├── poly1305_kD.jinc │ │ ├── salsa20_32D.jinc │ │ ├── secretbox.jazz │ │ ├── xsalsa20_32D.jinc │ │ └── xsalsa20poly1305.jinc ├── crypto_sign │ ├── EcFlags.mk │ ├── dilithium │ │ ├── common │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ ├── expandA.jinc │ │ │ │ ├── expandA_end.jinc │ │ │ │ ├── expandMask.jinc │ │ │ │ ├── expandMask_end.jinc │ │ │ │ ├── keccak1600.jinc │ │ │ │ ├── keccakf1600.jinc │ │ │ │ ├── ntt.jinc │ │ │ │ ├── poly.jinc │ │ │ │ ├── poly_end.jinc │ │ │ │ ├── polyvec_end.jinc │ │ │ │ └── sign_end.jinc │ │ │ │ ├── expandA_end.jinc │ │ │ │ ├── expandMask.jinc │ │ │ │ ├── expandMask_end.jinc │ │ │ │ ├── expandS.jinc │ │ │ │ ├── expandS_end.jinc │ │ │ │ ├── fips202.jinc │ │ │ │ ├── hashing_end.jinc │ │ │ │ ├── keygen_end.jinc │ │ │ │ ├── montgomery.jinc │ │ │ │ ├── ntt.jinc │ │ │ │ ├── packing.jinc │ │ │ │ ├── packing_end.jinc │ │ │ │ ├── params.jinc │ │ │ │ ├── params_end.jinc │ │ │ │ ├── poly.jinc │ │ │ │ ├── poly_end.jinc │ │ │ │ ├── polyvec_end.jinc │ │ │ │ ├── rounding.jinc │ │ │ │ ├── rounding_end.jinc │ │ │ │ ├── sign.jinc │ │ │ │ ├── sign_end.jinc │ │ │ │ ├── twiddle_factors.jinc │ │ │ │ └── verify_end.jinc │ │ ├── dilithium2 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── common.jinc │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ ├── packing.jinc │ │ │ │ ├── params.jinc │ │ │ │ └── sign.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── common.jinc │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ ├── packing.jinc │ │ │ │ ├── params.jinc │ │ │ │ └── sign.jazz │ │ ├── dilithium3 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── common.jinc │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ ├── packing.jinc │ │ │ │ ├── params.jinc │ │ │ │ └── sign.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── common.jinc │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ ├── packing.jinc │ │ │ │ ├── params.jinc │ │ │ │ └── sign.jazz │ │ └── dilithium5 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── common.jinc │ │ │ ├── include │ │ │ │ └── api.h │ │ │ ├── packing.jinc │ │ │ ├── params.jinc │ │ │ └── sign.jazz │ │ │ └── ref │ │ │ ├── Makefile │ │ │ ├── common.jinc │ │ │ ├── include │ │ │ └── api.h │ │ │ ├── packing.jinc │ │ │ ├── params.jinc │ │ │ └── sign.jazz │ └── falcon │ │ └── falcon512 │ │ ├── META.yml │ │ ├── amd64 │ │ └── avx2 │ │ │ ├── .partial │ │ │ ├── Makefile │ │ │ ├── NTT.jinc │ │ │ ├── NTT_params.jinc │ │ │ ├── butterfly.jinc │ │ │ ├── include │ │ │ ├── .gitkeep │ │ │ └── api.h │ │ │ ├── polymul.jinc │ │ │ ├── sign.jazz │ │ │ ├── sign.jinc │ │ │ ├── table.jinc │ │ │ ├── test.jazz │ │ │ ├── vec.jinc │ │ │ └── verify.jinc │ │ └── common │ │ ├── amd64 │ │ ├── common.jinc │ │ ├── encode_decode.jinc │ │ └── shake256.jinc │ │ └── params.jinc ├── crypto_stream │ ├── EcFlags.mk │ ├── chacha │ │ ├── chacha12 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ ├── chacha20-ietf │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── Makefile │ │ │ │ ├── _chacha.jinc │ │ │ │ ├── chacha_entry_h.jinc │ │ │ │ ├── chacha_entry_v.jinc │ │ │ │ ├── chacha_state.jinc │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── _chacha.jinc │ │ │ │ ├── chacha_entry_h.jinc │ │ │ │ ├── chacha_entry_v.jinc │ │ │ │ ├── chacha_state.jinc │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── chacha_entry.jinc │ │ │ │ ├── chacha_state.jinc │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ ├── chacha20 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ └── common │ │ │ └── amd64 │ │ │ ├── avx │ │ │ ├── Flags.mk │ │ │ ├── _chacha.jinc │ │ │ ├── chacha.jinc │ │ │ ├── chacha_core_h.jinc │ │ │ ├── chacha_core_v.jinc │ │ │ ├── chacha_entry_h.jinc │ │ │ ├── chacha_entry_v.jinc │ │ │ ├── chacha_globals.jinc │ │ │ ├── chacha_h.jinc │ │ │ ├── chacha_state_h.jinc │ │ │ ├── chacha_state_v.jinc │ │ │ ├── chacha_store_h.jinc │ │ │ ├── chacha_store_v.jinc │ │ │ └── chacha_v.jinc │ │ │ ├── avx2 │ │ │ ├── Flags.mk │ │ │ ├── _chacha.jinc │ │ │ ├── chacha.jinc │ │ │ ├── chacha_core_h.jinc │ │ │ ├── chacha_core_v.jinc │ │ │ ├── chacha_entry_h.jinc │ │ │ ├── chacha_entry_v.jinc │ │ │ ├── chacha_globals.jinc │ │ │ ├── chacha_h.jinc │ │ │ ├── chacha_state_h.jinc │ │ │ ├── chacha_state_v.jinc │ │ │ ├── chacha_store_h.jinc │ │ │ ├── chacha_store_v.jinc │ │ │ └── chacha_v.jinc │ │ │ └── ref │ │ │ ├── chacha.jinc │ │ │ ├── chacha_core.jinc │ │ │ ├── chacha_entry.jinc │ │ │ ├── chacha_state.jinc │ │ │ └── chacha_store.jinc │ ├── salsa20 │ │ ├── common │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── Flags.mk │ │ │ │ ├── _salsa20.jinc │ │ │ │ ├── salsa20.jinc │ │ │ │ ├── salsa20_core_v.jinc │ │ │ │ ├── salsa20_globals.jinc │ │ │ │ ├── salsa20_state_v.jinc │ │ │ │ └── salsa20_v.jinc │ │ │ │ ├── avx2 │ │ │ │ ├── Flags.mk │ │ │ │ ├── _salsa20.jinc │ │ │ │ ├── salsa20.jinc │ │ │ │ ├── salsa20_core_v.jinc │ │ │ │ ├── salsa20_globals.jinc │ │ │ │ ├── salsa20_state_v.jinc │ │ │ │ └── salsa20_v.jinc │ │ │ │ └── ref │ │ │ │ ├── salsa20.jinc │ │ │ │ ├── salsa20_core.jinc │ │ │ │ └── salsa20_state.jinc │ │ ├── salsa20 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ ├── avx2 │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ │ │ └── ref │ │ │ │ ├── Makefile │ │ │ │ ├── include │ │ │ │ └── api.h │ │ │ │ └── stream.jazz │ │ └── salsa2012 │ │ │ ├── META.yml │ │ │ └── amd64 │ │ │ ├── avx │ │ │ ├── Makefile │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── stream.jazz │ │ │ ├── avx2 │ │ │ ├── Makefile │ │ │ ├── include │ │ │ │ └── api.h │ │ │ └── stream.jazz │ │ │ └── ref │ │ │ ├── Makefile │ │ │ ├── include │ │ │ └── api.h │ │ │ └── stream.jazz │ └── xsalsa20 │ │ ├── META.yml │ │ └── amd64 │ │ ├── avx │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── stream.jazz │ │ └── xsalsa20.jinc │ │ ├── avx2 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── stream.jazz │ │ └── xsalsa20.jinc │ │ └── ref │ │ ├── Makefile │ │ ├── hsalsa20.jinc │ │ ├── include │ │ └── api.h │ │ ├── stream.jazz │ │ └── xsalsa20.jinc ├── crypto_verify │ ├── 16 │ │ └── amd64 │ │ │ └── common │ │ │ ├── Makefile │ │ │ └── crypto_verify_16.jinc │ └── EcFlags.mk └── crypto_xof │ ├── EcFlags.mk │ ├── shake128 │ ├── META.yml │ └── amd64 │ │ ├── avx2 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── shake128.jinc │ │ ├── shake128_4x.jinc │ │ └── xof.jazz │ │ ├── bmi1 │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── shake128.jinc │ │ └── xof.jazz │ │ ├── ref │ │ ├── Makefile │ │ ├── include │ │ │ └── api.h │ │ ├── shake128.jinc │ │ └── xof.jazz │ │ └── ref1 │ │ ├── Makefile │ │ ├── include │ │ └── api.h │ │ ├── shake128.jinc │ │ └── xof.jazz │ └── shake256 │ ├── META.yml │ └── amd64 │ ├── avx2 │ ├── Makefile │ ├── include │ │ └── api.h │ ├── shake256.jinc │ ├── shake256_4x.jinc │ └── xof.jazz │ ├── bmi1 │ ├── Makefile │ ├── include │ │ └── api.h │ ├── shake256.jinc │ └── xof.jazz │ ├── ref │ ├── Makefile │ ├── include │ │ └── api.h │ ├── shake256.jinc │ └── xof.jazz │ ├── ref1 │ ├── Makefile │ ├── include │ │ └── api.h │ ├── shake256.jinc │ └── xof.jazz │ └── spec │ ├── Makefile │ ├── include │ └── api.h │ ├── shake256.jinc │ └── xof.jazz ├── proof ├── .gitignore ├── Makefile ├── common │ └── keccak │ │ └── keccak1600 │ │ └── amd64 │ │ ├── avx2 │ │ └── .gitkeep │ │ ├── bmi1 │ │ └── .gitkeep │ │ ├── ref │ │ └── .gitkeep │ │ └── ref1 │ │ └── .gitkeep ├── crypto-specs ├── crypto_hash │ ├── sha256 │ │ └── amd64 │ │ │ └── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ ├── sha3-224 │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── bmi1 │ │ │ └── .gitkeep │ │ │ ├── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref1 │ │ │ └── .gitkeep │ ├── sha3-256 │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── bmi1 │ │ │ └── .gitkeep │ │ │ ├── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref1 │ │ │ └── .gitkeep │ ├── sha3-384 │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── bmi1 │ │ │ └── .gitkeep │ │ │ ├── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref1 │ │ │ └── .gitkeep │ ├── sha3-512 │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── bmi1 │ │ │ └── .gitkeep │ │ │ ├── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref1 │ │ │ └── .gitkeep │ └── sha512 │ │ └── amd64 │ │ └── ref │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec ├── crypto_kem │ ├── kyber │ │ ├── kyber512 │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ └── .gitkeep │ │ │ │ └── ref │ │ │ │ └── .gitkeep │ │ └── kyber768 │ │ │ └── amd64 │ │ │ ├── avx2 │ │ │ └── .gitkeep │ │ │ └── ref │ │ │ └── .gitkeep │ └── xwing │ │ └── amd64 │ │ └── .gitkeep ├── crypto_onetimeauth │ └── poly1305 │ │ └── amd64 │ │ ├── avx │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ ├── avx2 │ │ ├── .gitkeep │ │ ├── EClib.ec │ │ ├── Ops.ec │ │ ├── Poly1305_hop1.ec │ │ ├── Poly1305_hop2.ec │ │ ├── Poly1305_hop3.ec │ │ ├── Poly1305_savx2.ec │ │ ├── Poly1305_savx2_prevec.ec │ │ ├── Poly1305_savx2_vec.ec │ │ ├── Poly1305_spec.ec │ │ ├── Rep3Limb.ec │ │ ├── Rep5Limb.ec │ │ ├── W64limbs.ec │ │ ├── Zp.ec │ │ ├── extracted_ct_proof.ec │ │ ├── extracted_s_equiv.ec │ │ └── extracted_s_proof.ec │ │ └── ref │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec ├── crypto_scalarmult │ └── curve25519 │ │ └── amd64 │ │ ├── mulx │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ ├── ref4 │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ └── ref5 │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec ├── crypto_secretbox │ └── xsalsa20poly1305 │ │ └── amd64 │ │ ├── avx │ │ └── .gitkeep │ │ ├── avx2 │ │ └── .gitkeep │ │ └── ref │ │ └── .gitkeep ├── crypto_sign │ ├── dilithium │ │ ├── dilithium2 │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ └── .gitkeep │ │ │ │ └── ref │ │ │ │ └── .gitkeep │ │ ├── dilithium3 │ │ │ └── amd64 │ │ │ │ ├── avx2 │ │ │ │ └── .gitkeep │ │ │ │ └── ref │ │ │ │ └── .gitkeep │ │ └── dilithium5 │ │ │ └── amd64 │ │ │ ├── avx2 │ │ │ └── .gitkeep │ │ │ └── ref │ │ │ └── .gitkeep │ └── falcon │ │ └── falcon512 │ │ └── amd64 │ │ └── avx2 │ │ └── .gitkeep ├── crypto_stream │ ├── chacha │ │ ├── chacha12 │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ ├── avx2 │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ └── ref │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ ├── chacha20-ietf │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ ├── avx2 │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ └── ref │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ ├── chacha20 │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ ├── avx2 │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ └── ref │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ └── common │ │ │ └── amd64 │ │ │ ├── avx │ │ │ └── .gitkeep │ │ │ ├── avx2 │ │ │ └── .gitkeep │ │ │ └── ref │ │ │ └── .gitkeep │ ├── salsa20 │ │ ├── salsa20 │ │ │ └── amd64 │ │ │ │ ├── avx │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ ├── avx2 │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ │ │ └── ref │ │ │ │ ├── .gitkeep │ │ │ │ └── extracted_ct_proof.ec │ │ └── salsa2012 │ │ │ └── amd64 │ │ │ ├── avx │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ └── xsalsa20 │ │ └── amd64 │ │ ├── avx │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ ├── avx2 │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ └── ref │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec ├── crypto_verify │ └── 16 │ │ └── amd64 │ │ └── common │ │ └── .gitkeep ├── crypto_xof │ ├── shake128 │ │ └── amd64 │ │ │ ├── avx2 │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ ├── bmi1 │ │ │ └── .gitkeep │ │ │ ├── ref │ │ │ ├── .gitkeep │ │ │ └── extracted_ct_proof.ec │ │ │ └── ref1 │ │ │ └── .gitkeep │ └── shake256 │ │ └── amd64 │ │ ├── avx2 │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ ├── bmi1 │ │ └── .gitkeep │ │ ├── ref │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ ├── ref1 │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec │ │ └── spec │ │ ├── .gitkeep │ │ └── extracted_ct_proof.ec └── tests.config ├── scripts ├── ci │ ├── config │ │ ├── easycrypt │ │ └── jasmin │ ├── jbcmp0 │ ├── jbcmp1 │ ├── jbcmp2 │ ├── jbcompare │ ├── jbench │ ├── jdiff │ ├── jlog │ ├── jproof │ ├── jsrc │ ├── jtiming │ ├── local │ │ └── run │ ├── misc │ │ ├── jasmin-build-instructions0 │ │ └── jasmin-build-instructions1 │ ├── releaser │ │ ├── jdist-proof │ │ ├── jdist-src-test-v1 │ │ └── jdist-src-v1 │ └── reporter │ │ └── jlog ├── docker │ └── Dockerfile ├── extract-all.sh └── reporter │ └── jlog └── test ├── .gitignore ├── Makefile ├── Makefile.partial_implementations ├── common ├── config.h ├── files.c ├── namespace.h ├── notrandombytes.c ├── print.c ├── print.h ├── print_dist.c ├── randombytes.h ├── try-anything.c └── try-anything.h ├── crypto_hash ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_kem ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── mlkem │ └── mlkem768 │ │ ├── dec_tests.c │ │ ├── enc_tests.c │ │ └── keypair_tests.c ├── printparams.c ├── safetyparams.c └── test_vectors.c ├── crypto_onetimeauth ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_scalarmult ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_secretbox ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_sign ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_stream ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── crypto_xof ├── checksumbig.c ├── checksums.c ├── checksumsmall.c ├── functest.c ├── memory.c ├── printparams.c └── safetyparams.c ├── external ├── .gitignore └── crypto_sign │ └── falcon │ └── falcon512 │ └── amd64 │ └── avx2 │ ├── Makefile │ ├── api.h │ ├── codec.c │ ├── common.c │ ├── fft.c │ ├── fpr.c │ ├── fpr.h │ ├── inner.h │ ├── keygen.c │ ├── nist.c │ ├── rng.c │ ├── shake.c │ ├── sign.c │ └── vrfy.c ├── include ├── jade_hash.h ├── jade_kem.h ├── jade_onetimeauth.h ├── jade_scalarmult.h ├── jade_secretbox.h ├── jade_sign.h ├── jade_stream.h ├── jade_xof.h ├── namespace.h └── namespace_dist.h └── scripts └── checksumsok /.github/workflows/amd64-linux-main-build-instructions.yml.0: -------------------------------------------------------------------------------- 1 | name: amd64-linux-main-build-instructions 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | schedule: 7 | - cron: '00 1 * * *' 8 | 9 | jobs: 10 | 11 | build0: 12 | runs-on: [self-hosted, linux, X64, amd64-instructions] 13 | steps: 14 | - name: checkout 15 | uses: actions/checkout@v4 16 | 17 | - name: build 18 | run: sh scripts/ci/misc/jasmin-build-instructions0 19 | 20 | build1: 21 | runs-on: [self-hosted, linux, X64, amd64-instructions] 22 | steps: 23 | - name: checkout 24 | uses: actions/checkout@v4 25 | 26 | - name: build 27 | run: sh scripts/ci/misc/jasmin-build-instructions1 28 | -------------------------------------------------------------------------------- /.github/workflows/amd64-linux-main-safety.yml.0: -------------------------------------------------------------------------------- 1 | name: amd64-linux-main-safety 2 | 3 | on: 4 | workflow_run: 5 | workflows: [amd64-linux-main] 6 | types: [completed] 7 | 8 | jobs: 9 | 10 | safety: 11 | runs-on: [self-hosted, linux, X64, amd64-main-safety] 12 | timeout-minutes: 4320 13 | steps: 14 | - name: checkout 15 | uses: actions/checkout@v4 16 | 17 | - name: compile 18 | run: (timeout 4300m make -j$JOBS -C src/ CI=1 SAFETY_TIMEOUT=2880m safety) || true 19 | 20 | - name: print logs 21 | run: make -C src/ CI=1 reporter_safety 22 | 23 | - name: libjade-logs-safety.tar.gz - contains non-empty logs and errors 24 | if: always() 25 | uses: actions/upload-artifact@v4 26 | with: 27 | name: libjade-logs-safety.tar.gz 28 | path: src/libjade-logs-src.tar.gz 29 | 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .ci 2 | *.tar.gz 3 | libjade-* 4 | .vscode 5 | result 6 | src/ 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/ssbd-tools"] 2 | path = submodules/ssbd-tools 3 | url = https://github.com/tyhicks/ssbd-tools.git 4 | [submodule "submodules/crypto-specs"] 5 | path = submodules/crypto-specs 6 | url = https://github.com/formosa-crypto/crypto-specs.git 7 | [submodule "submodules/formosa-25519"] 8 | path = submodules/formosa-25519 9 | url = https://github.com/formosa-crypto/formosa-25519.git 10 | [submodule "submodules/formosa-mlkem"] 11 | path = submodules/formosa-mlkem 12 | url = git@github.com:formosa-crypto/formosa-mlkem.git 13 | [submodule "submodules/formosa-mlkem/"] 14 | branch = bdep-comments 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | SPDX-License-Identifier: CC0-1.0 OR Apache-2.0 2 | -------------------------------------------------------------------------------- /bench/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | -------------------------------------------------------------------------------- /bench/common/alignedcalloc.c: -------------------------------------------------------------------------------- 1 | #ifndef ALIGNEDCALLOC_C 2 | #define ALIGNEDCALLOC_C 3 | 4 | #include 5 | #include 6 | //include 7 | 8 | static size_t alignedcalloc_step(size_t len) 9 | { 10 | size_t step; 11 | step = len + (63 & (-len)); 12 | return step; 13 | } 14 | 15 | static uint8_t *alignedcalloc(uint8_t** _x, size_t len) 16 | { 17 | uint8_t* x = (uint8_t*) calloc(1, len + 128); 18 | if (!x) exit(-1); //error(-1, -1, "out of memory"); 19 | if(_x){ *_x = x; } 20 | x += 63 & (-(unsigned long) x); 21 | return x; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /bench/common/benchrandombytes.c: -------------------------------------------------------------------------------- 1 | #ifndef BENCHRANDOMBYTES_C 2 | #define BENCHRANDOMBYTES_C 3 | 4 | #include 5 | #include 6 | 7 | #include "randombytes.h" 8 | 9 | static uint8_t* benchrandombytes(uint8_t* x, uint64_t xlen) 10 | { 11 | x = __jasmin_syscall_randombytes__(x, xlen); 12 | return x; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /bench/common/namespace.h: -------------------------------------------------------------------------------- 1 | 2 | // https://stackoverflow.com/a/1489985/1711232 3 | #define PASTER(x, y) x##_##y 4 | #define EVALUATOR(x, y) PASTER(x, y) 5 | #define NAMESPACE(fun) EVALUATOR(JADE_NAMESPACE, fun) 6 | #define NAMESPACE_LC(fun) EVALUATOR(JADE_NAMESPACE_LC, fun) 7 | 8 | // https://stackoverflow.com/a/55243651/248065 9 | #define MY_TRUTHY_VALUE_X 1 10 | #define CAT(x,y) CAT_(x,y) 11 | #define CAT_(x,y) x##y 12 | #define HAS_NAMESPACE(x) CAT(CAT(MY_TRUTHY_VALUE_,CAT(JADE_NAMESPACE,CAT(_,x))),X) 13 | 14 | #if !HAS_NAMESPACE(API_H) 15 | #error "namespace not properly defined for header guard" 16 | #endif 17 | 18 | #define xstr(s,e) str(s)#e 19 | #define str(s) #s 20 | 21 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import { } 2 | , jasminc 3 | }: 4 | with pkgs; 5 | stdenv.mkDerivation { 6 | name = "libjade"; 7 | src = ./src; 8 | 9 | nativeBuildInputs = with pkgs; [ 10 | jasminc 11 | clang 12 | gnumake 13 | ]; 14 | 15 | buildPhase = '' 16 | make FAIL_ON_ERROR=1 -j$(nproc) 17 | ''; 18 | 19 | installPhase = '' 20 | mkdir -p $out/lib 21 | mkdir -p $out/include 22 | cp libjade.a $out/lib/ 23 | cp libjade.h $out/include/ 24 | ''; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /ext/.gitignore: -------------------------------------------------------------------------------- 1 | *.s 2 | *.o 3 | *.a 4 | -------------------------------------------------------------------------------- /ext/randombytes/Makefile: -------------------------------------------------------------------------------- 1 | CC ?= clang 2 | CFLAGS ?= -O3 -Wall -Wextra -Wpedantic -Wvla -Werror -std=c99 \ 3 | -Wundef -Wshadow -Wcast-align -Wpointer-arith -Wmissing-prototypes \ 4 | -fstrict-aliasing -fno-common -pipe 5 | 6 | default: librandombytes.a 7 | 8 | librandombytes.a: randombytes.o 9 | ar -rc $@ $< && ranlib $@ 10 | 11 | randombytes.o: randombytes.c randombytes.h 12 | $(CC) $(CFLAGS) -o $@ -c randombytes.c 13 | 14 | clean: 15 | @rm -fr *.a *.o 16 | -------------------------------------------------------------------------------- /ext/randombytes/randombytes.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBJADE_RANDOMBYTES_H 2 | #define LIBJADE_RANDOMBYTES_H 3 | 4 | #include 5 | 6 | uint8_t* __jasmin_syscall_randombytes__(uint8_t* _x, uint64_t xlen) __asm__("__jasmin_syscall_randombytes__"); 7 | void randombytes(uint8_t* _x, uint64_t xlen); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /oldsrc-should-delete/.gitignore: -------------------------------------------------------------------------------- 1 | *.s 2 | *.safety 3 | *.safety_* 4 | *.sct 5 | *.sct_* 6 | *.o 7 | *.a 8 | _build/ 9 | libjade.a 10 | libjade.h 11 | .deps 12 | .ec 13 | .log 14 | .error 15 | .jflags 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/EcFlags.mk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/oldsrc-should-delete/common/EcFlags.mk -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/common/fips202_params.jinc: -------------------------------------------------------------------------------- 1 | param int SHAKE128_RATE = 168; 2 | param int SHAKE256_RATE = 136; 3 | param int SHA3_256_RATE = 136; 4 | param int SHA3_512_RATE = 72; 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/keccak1600/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f _keccak1600_avx2 2 | JEXT := jinc 3 | SRCS := keccak1600.jinc 4 | entry: extract 5 | include ../../../../../Makefile.common 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/keccak1600/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f _keccak1600_bmi1 2 | JEXT := jinc 3 | SRCS := keccak1600.jinc 4 | entry: extract 5 | include ../../../../../Makefile.common 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/keccak1600/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f _keccak1600_ref 2 | JEXT := jinc 3 | SRCS := keccak1600.jinc 4 | entry: extract 5 | include ../../../../../Makefile.common 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/keccak1600/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f _keccak1600_ref1 2 | JEXT := jinc 3 | SRCS := keccak1600.jinc 4 | entry: extract 5 | include ../../../../../Makefile.common 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/common/keccak/keccak1600/amd64/spec/keccakf1600_globals.jinc: -------------------------------------------------------------------------------- 1 | 2 | u64[24] KECCAK1600_RC = 3 | { 0x0000000000000001 4 | ,0x0000000000008082 5 | ,0x800000000000808a 6 | ,0x8000000080008000 7 | ,0x000000000000808b 8 | ,0x0000000080000001 9 | ,0x8000000080008081 10 | ,0x8000000000008009 11 | ,0x000000000000008a 12 | ,0x0000000000000088 13 | ,0x0000000080008009 14 | ,0x000000008000000a 15 | ,0x000000008000808b 16 | ,0x800000000000008b 17 | ,0x8000000000008089 18 | ,0x8000000000008003 19 | ,0x8000000000008002 20 | ,0x8000000000000080 21 | ,0x000000000000800a 22 | ,0x800000008000000a 23 | ,0x8000000080008081 24 | ,0x8000000000008080 25 | ,0x0000000080000001 26 | ,0x8000000080008008 27 | }; 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha256/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-256 2 | type: hash 3 | checksumsmall: 0fb5122d471d9310c4ff212c64a73cc985f0826484c24f34b56cb1d39534ba24 4 | checksumbig: 55ff5e29282c4d7d192a20b427c000ec121fcda33dd96d53aa8857e3f2dd1469 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha256/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha256/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha256.jinc" 2 | 3 | export fn jade_hash_sha256_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha256_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha256/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha256_amd64_ref_API_H 2 | #define JADE_HASH_sha256_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha256_amd64_ref_BYTES 32 5 | 6 | #define JADE_HASH_sha256_amd64_ref_ALGNAME "SHA256" 7 | #define JADE_HASH_sha256_amd64_ref_ARCH "amd64" 8 | #define JADE_HASH_sha256_amd64_ref_IMPL "ref" 9 | 10 | #include 11 | 12 | int jade_hash_sha256_amd64_ref( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha256/amd64/ref/sha256_globals.jinc: -------------------------------------------------------------------------------- 1 | 2 | u32[64] SHA256_K = { 3 | 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5, 4 | 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5, 5 | 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3, 6 | 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174, 7 | 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc, 8 | 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da, 9 | 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7, 10 | 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967, 11 | 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13, 12 | 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85, 13 | 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3, 14 | 0xd192e819,0xd6990624,0xf40e3585,0x106aa070, 15 | 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5, 16 | 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3, 17 | 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208, 18 | 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 19 | }; 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-224 2 | type: hash 3 | checksumsmall: 6f17d2131ba2f0c5930fec6fe1b36cf70f54dd6305b84dad280a06fefa0f9f67 4 | checksumbig: 308ede006235c1f6336c4041335bfb3b97d4d4367100b3f869b99bc8d0925965 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | - name: amd64/avx2 16 | version: TODO 17 | supported_platforms: 18 | - architecture: x86_64 19 | operating_systems: 20 | - Linux 21 | - Darwin 22 | required_flags: #FIXME 23 | - avx2 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/avx2/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-224.jinc" 2 | 3 | export fn jade_hash_sha3_224_amd64_avx2(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __sha3_224_avx2(hash, input, input_length, ms); 11 | 12 | ?{}, r = #set0(); 13 | return r; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_224_amd64_avx2_API_H 2 | #define JADE_HASH_sha3_224_amd64_avx2_API_H 3 | 4 | #define JADE_HASH_sha3_224_amd64_avx2_BYTES 28 5 | 6 | #define JADE_HASH_sha3_224_amd64_avx2_ALGNAME "SHA3-224" 7 | #define JADE_HASH_sha3_224_amd64_avx2_ARCH "amd64" 8 | #define JADE_HASH_sha3_224_amd64_avx2_IMPL "avx2" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_224_amd64_avx2( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/avx2/sha3-224.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __sha3_224_avx2(reg u64 out in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (224/8); 9 | trail_byte = 0x6; 10 | rate = (1152/8); 11 | 12 | _keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/bmi1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-224.jinc" 2 | 3 | export fn jade_hash_sha3_224_amd64_bmi1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_224_bmi1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_224_amd64_bmi1_API_H 2 | #define JADE_HASH_sha3_224_amd64_bmi1_API_H 3 | 4 | #define JADE_HASH_sha3_224_amd64_bmi1_BYTES 28 5 | #define JADE_HASH_sha3_224_amd64_bmi1_ALGNAME "SHA3-224" 6 | #define JADE_HASH_sha3_224_amd64_bmi1_ARCH "amd64" 7 | #define JADE_HASH_sha3_224_amd64_bmi1_IMPL "bmi1" 8 | 9 | #include 10 | 11 | int jade_hash_sha3_224_amd64_bmi1( 12 | uint8_t *hash, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/bmi1/sha3-224.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __sha3_224_bmi1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (224/8); 9 | trail_byte = 0x6; 10 | rate = (1152/8); 11 | 12 | _keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-224.jinc" 2 | 3 | export fn jade_hash_sha3_224_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_224_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_224_amd64_ref_API_H 2 | #define JADE_HASH_sha3_224_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha3_224_amd64_ref_BYTES 28 5 | #define JADE_HASH_sha3_224_amd64_ref_ALGNAME "SHA3-224" 6 | #define JADE_HASH_sha3_224_amd64_ref_ARCH "amd64" 7 | #define JADE_HASH_sha3_224_amd64_ref_IMPL "ref" 8 | 9 | #include 10 | 11 | int jade_hash_sha3_224_amd64_ref( 12 | uint8_t *hash, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref/sha3-224.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __sha3_224_ref(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (224/8); 9 | trail_byte = 0x6; 10 | rate = (1152/8); 11 | 12 | _keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-224.jinc" 2 | 3 | export fn jade_hash_sha3_224_amd64_ref1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_224_ref1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_224_amd64_ref1_API_H 2 | #define JADE_HASH_sha3_224_amd64_ref1_API_H 3 | 4 | #define JADE_HASH_sha3_224_amd64_ref1_BYTES 28 5 | #define JADE_HASH_sha3_224_amd64_ref1_ALGNAME "SHA3-224" 6 | #define JADE_HASH_sha3_224_amd64_ref1_ARCH "amd64" 7 | #define JADE_HASH_sha3_224_amd64_ref1_IMPL "ref1" 8 | 9 | #include 10 | 11 | int jade_hash_sha3_224_amd64_ref1( 12 | uint8_t *hash, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-224/amd64/ref1/sha3-224.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __sha3_224_ref1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (224/8); 9 | trail_byte = 0x6; 10 | rate = (1152/8); 11 | 12 | _keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-256 2 | type: hash 3 | checksumsmall: ebbed3a47232047ad399cb77b6324d6c902f4715de871750545b1a3b12046ebe 4 | checksumbig: 86f524b63449ca0d5c29e58e7bc22c279187af259f83d6eecfb51db5c8d511e9 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | - name: amd64/avx2 16 | version: TODO 17 | supported_platforms: 18 | - architecture: x86_64 19 | operating_systems: 20 | - Linux 21 | - Darwin 22 | required_flags: #FIXME 23 | - avx2 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/avx2/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-256.jinc" 2 | 3 | export fn jade_hash_sha3_256_amd64_avx2(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __sha3_256_avx2(hash, input, input_length, ms); 11 | 12 | ?{}, r = #set0(); 13 | return r; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_256_amd64_avx2_API_H 2 | #define JADE_HASH_sha3_256_amd64_avx2_API_H 3 | 4 | #define JADE_HASH_sha3_256_amd64_avx2_BYTES 32 5 | 6 | #define JADE_HASH_sha3_256_amd64_avx2_ALGNAME "SHA3-256" 7 | #define JADE_HASH_sha3_256_amd64_avx2_ARCH "amd64" 8 | #define JADE_HASH_sha3_256_amd64_avx2_IMPL "avx2" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_256_amd64_avx2( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/avx2/sha3-256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __sha3_256_avx2(reg u64 out in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (256/8); 9 | trail_byte = 0x6; 10 | rate = (1088/8); 11 | 12 | _keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/bmi1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-256.jinc" 2 | 3 | export fn jade_hash_sha3_256_amd64_bmi1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_256_bmi1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_256_amd64_bmi1_API_H 2 | #define JADE_HASH_sha3_256_amd64_bmi1_API_H 3 | 4 | #define JADE_HASH_sha3_256_amd64_bmi1_BYTES 32 5 | 6 | #define JADE_HASH_sha3_256_amd64_bmi1_ALGNAME "SHA3-256" 7 | #define JADE_HASH_sha3_256_amd64_bmi1_ARCH "amd64" 8 | #define JADE_HASH_sha3_256_amd64_bmi1_IMPL "bmi1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_256_amd64_bmi1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/bmi1/sha3-256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __sha3_256_bmi1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (256/8); 9 | trail_byte = 0x6; 10 | rate = (1088/8); 11 | 12 | _keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-256.jinc" 2 | 3 | export fn jade_hash_sha3_256_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_256_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_256_amd64_ref_API_H 2 | #define JADE_HASH_sha3_256_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha3_256_amd64_ref_BYTES 32 5 | 6 | #define JADE_HASH_sha3_256_amd64_ref_ALGNAME "SHA3-256" 7 | #define JADE_HASH_sha3_256_amd64_ref_ARCH "amd64" 8 | #define JADE_HASH_sha3_256_amd64_ref_IMPL "ref" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_256_amd64_ref( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref/sha3-256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __sha3_256_ref(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (256/8); 9 | trail_byte = 0x6; 10 | rate = (1088/8); 11 | 12 | _keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-256.jinc" 2 | 3 | export fn jade_hash_sha3_256_amd64_ref1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_256_ref1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_256_amd64_ref1_API_H 2 | #define JADE_HASH_sha3_256_amd64_ref1_API_H 3 | 4 | #define JADE_HASH_sha3_256_amd64_ref1_BYTES 32 5 | 6 | #define JADE_HASH_sha3_256_amd64_ref1_ALGNAME "SHA3-256" 7 | #define JADE_HASH_sha3_256_amd64_ref1_ARCH "amd64" 8 | #define JADE_HASH_sha3_256_amd64_ref1_IMPL "ref1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_256_amd64_ref1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-256/amd64/ref1/sha3-256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __sha3_256_ref1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (256/8); 9 | trail_byte = 0x6; 10 | rate = (1088/8); 11 | 12 | _keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-384 2 | type: hash 3 | checksumsmall: ead52bf6e6bb65653ce3fe2e1850f8228a6af202392ebd32df5fd94c4c53cbf8 4 | checksumbig: 11d1cf5daaf24ba92b678859ac629c9791bcc51eced61da1e1616f76cce5229e 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | - name: amd64/avx2 16 | version: TODO 17 | supported_platforms: 18 | - architecture: x86_64 19 | operating_systems: 20 | - Linux 21 | - Darwin 22 | required_flags: #FIXME 23 | - avx2 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/avx2/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-384.jinc" 2 | 3 | export fn jade_hash_sha3_384_amd64_avx2(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __sha3_384_avx2(hash, input, input_length, ms); 11 | 12 | ?{}, r = #set0(); 13 | return r; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_384_amd64_avx2_API_H 2 | #define JADE_HASH_sha3_384_amd64_avx2_API_H 3 | 4 | #define JADE_HASH_sha3_384_amd64_avx2_BYTES 48 5 | 6 | #define JADE_HASH_sha3_384_amd64_avx2_ALGNAME "SHA3-384" 7 | #define JADE_HASH_sha3_384_amd64_avx2_ARCH "amd64" 8 | #define JADE_HASH_sha3_384_amd64_avx2_IMPL "avx2" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_384_amd64_avx2( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/avx2/sha3-384.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __sha3_384_avx2(reg u64 out in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (384/8); 9 | trail_byte = 0x6; 10 | rate = (832/8); 11 | 12 | _keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/bmi1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-384.jinc" 2 | 3 | export fn jade_hash_sha3_384_amd64_bmi1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_384_bmi1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_384_amd64_bmi1_API_H 2 | #define JADE_HASH_sha3_384_amd64_bmi1_API_H 3 | 4 | #define JADE_HASH_sha3_384_amd64_bmi1_BYTES 48 5 | 6 | #define JADE_HASH_sha3_384_amd64_bmi1_ALGNAME "SHA3-384" 7 | #define JADE_HASH_sha3_384_amd64_bmi1_ARCH "amd64" 8 | #define JADE_HASH_sha3_384_amd64_bmi1_IMPL "bmi1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_384_amd64_bmi1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/bmi1/sha3-384.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __sha3_384_bmi1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (384/8); 9 | trail_byte = 0x6; 10 | rate = (832/8); 11 | 12 | _keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-384.jinc" 2 | 3 | export fn jade_hash_sha3_384_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_384_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_384_amd64_ref_API_H 2 | #define JADE_HASH_sha3_384_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha3_384_amd64_ref_BYTES 48 5 | 6 | #define JADE_HASH_sha3_384_amd64_ref_ALGNAME "SHA3-384" 7 | #define JADE_HASH_sha3_384_amd64_ref_ARCH "amd64" 8 | #define JADE_HASH_sha3_384_amd64_ref_IMPL "ref" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_384_amd64_ref( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref/sha3-384.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __sha3_384_ref(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (384/8); 9 | trail_byte = 0x6; 10 | rate = (832/8); 11 | 12 | _keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-384.jinc" 2 | 3 | export fn jade_hash_sha3_384_amd64_ref1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_384_ref1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_384_amd64_ref1_API_H 2 | #define JADE_HASH_sha3_384_amd64_ref1_API_H 3 | 4 | #define JADE_HASH_sha3_384_amd64_ref1_BYTES 48 5 | 6 | #define JADE_HASH_sha3_384_amd64_ref1_ALGNAME "SHA3-384" 7 | #define JADE_HASH_sha3_384_amd64_ref1_ARCH "amd64" 8 | #define JADE_HASH_sha3_384_amd64_ref1_IMPL "ref1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_384_amd64_ref1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-384/amd64/ref1/sha3-384.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __sha3_384_ref1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (384/8); 9 | trail_byte = 0x6; 10 | rate = (832/8); 11 | 12 | _keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-512 2 | type: hash 3 | checksumsmall: a2ad202e4c91b2b22a059308182b692a08c63ab839c2c0dbdc6e31fe1a9c14f4 4 | checksumbig: f42dc6f0c1663981a0f059bf08ed1c7d5baf7e461125482ed14bf3aa2ba4d94d 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | - name: amd64/avx2 16 | version: TODO 17 | supported_platforms: 18 | - architecture: x86_64 19 | operating_systems: 20 | - Linux 21 | - Darwin 22 | required_flags: #FIXME 23 | - avx2 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/avx2/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-512.jinc" 2 | 3 | export fn jade_hash_sha3_512_amd64_avx2(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __sha3_512_avx2(hash, input, input_length, ms); 11 | 12 | ?{}, r = #set0(); 13 | return r; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_512_amd64_avx2_API_H 2 | #define JADE_HASH_sha3_512_amd64_avx2_API_H 3 | 4 | #define JADE_HASH_sha3_512_amd64_avx2_BYTES 64 5 | 6 | #define JADE_HASH_sha3_512_amd64_avx2_ALGNAME "SHA3-512" 7 | #define JADE_HASH_sha3_512_amd64_avx2_ARCH "amd64" 8 | #define JADE_HASH_sha3_512_amd64_avx2_IMPL "avx2" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_512_amd64_avx2( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/avx2/sha3-512.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __sha3_512_avx2(reg u64 out in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (512/8); 9 | trail_byte = 0x6; 10 | rate = (576/8); 11 | 12 | _keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/bmi1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-512.jinc" 2 | 3 | export fn jade_hash_sha3_512_amd64_bmi1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_512_bmi1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_512_amd64_bmi1_API_H 2 | #define JADE_HASH_sha3_512_amd64_bmi1_API_H 3 | 4 | #define JADE_HASH_sha3_512_amd64_bmi1_BYTES 64 5 | 6 | #define JADE_HASH_sha3_512_amd64_bmi1_ALGNAME "SHA3-512" 7 | #define JADE_HASH_sha3_512_amd64_bmi1_ARCH "amd64" 8 | #define JADE_HASH_sha3_512_amd64_bmi1_IMPL "bmi1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_512_amd64_bmi1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/bmi1/sha3-512.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __sha3_512_bmi1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (512/8); 9 | trail_byte = 0x6; 10 | rate = (576/8); 11 | 12 | _keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-512.jinc" 2 | 3 | export fn jade_hash_sha3_512_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_512_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_512_amd64_ref_API_H 2 | #define JADE_HASH_sha3_512_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha3_512_amd64_ref_BYTES 64 5 | 6 | #define JADE_HASH_sha3_512_amd64_ref_ALGNAME "SHA3-512" 7 | #define JADE_HASH_sha3_512_amd64_ref_ARCH "amd64" 8 | #define JADE_HASH_sha3_512_amd64_ref_IMPL "ref" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_512_amd64_ref( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref/sha3-512.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __sha3_512_ref(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (512/8); 9 | trail_byte = 0x6; 10 | rate = (576/8); 11 | 12 | _keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref1/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha3-512.jinc" 2 | 3 | export fn jade_hash_sha3_512_amd64_ref1(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha3_512_ref1(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha3_512_amd64_ref1_API_H 2 | #define JADE_HASH_sha3_512_amd64_ref1_API_H 3 | 4 | #define JADE_HASH_sha3_512_amd64_ref1_BYTES 64 5 | 6 | #define JADE_HASH_sha3_512_amd64_ref1_ALGNAME "SHA3-512" 7 | #define JADE_HASH_sha3_512_amd64_ref1_ARCH "amd64" 8 | #define JADE_HASH_sha3_512_amd64_ref1_IMPL "ref1" 9 | 10 | #include 11 | 12 | int jade_hash_sha3_512_amd64_ref1( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha3-512/amd64/ref1/sha3-512.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __sha3_512_ref1(reg u64 out in inlen) 4 | { 5 | reg u64 outlen rate; 6 | reg u8 trail_byte; 7 | 8 | outlen = (512/8); 9 | trail_byte = 0x6; 10 | rate = (576/8); 11 | 12 | _keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha512/META.yml: -------------------------------------------------------------------------------- 1 | name: SHA-512 2 | type: hash 3 | checksumsmall: 8220572f58bd4730be165c9739d8d4b0fd2e0229dbe01e25b4aed23f00f23b70 4 | checksumbig: c1e322b7cbfc941260c5508967ba05bce22eeee94d425e708b7c3301ea1d5e2e 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha512/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := hash.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha512/amd64/ref/hash.jazz: -------------------------------------------------------------------------------- 1 | require "sha512.jinc" 2 | 3 | export fn jade_hash_sha512_amd64_ref(reg u64 hash input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __sha512_ref(hash, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_hash/sha512/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_sha512_amd64_ref_API_H 2 | #define JADE_HASH_sha512_amd64_ref_API_H 3 | 4 | #define JADE_HASH_sha512_amd64_ref_BYTES 64 5 | 6 | #define JADE_HASH_sha512_amd64_ref_ALGNAME "SHA512" 7 | #define JADE_HASH_sha512_amd64_ref_ARCH "amd64" 8 | #define JADE_HASH_sha512_amd64_ref_IMPL "ref" 9 | 10 | #include 11 | 12 | int jade_hash_sha512_amd64_ref( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace_keypair -f namespace_enc -f namespace_dec 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/common/amd64/ref/verify.jinc: -------------------------------------------------------------------------------- 1 | inline 2 | fn __verify(reg u64 ctp, reg ptr u8[KYBER_INDCPA_BYTES] ctpc) -> reg u64 3 | { 4 | reg u64 cnd t64; 5 | reg u8 t1 t2; 6 | inline int i; 7 | 8 | cnd = 0; 9 | 10 | for i=0 to KYBER_INDCPA_BYTES 11 | { 12 | t1 = ctpc.[i]; 13 | t2 = (u8)[ctp + i]; 14 | t1 ^= t2; 15 | t64 = (64u)t1; 16 | cnd |= t64; 17 | } 18 | 19 | cnd = -cnd; 20 | cnd >>= 63; 21 | 22 | return cnd; 23 | } 24 | 25 | inline 26 | fn __cmov(reg ptr u8[KYBER_SYMBYTES] dst, reg u64 src cnd) -> reg ptr u8[KYBER_SYMBYTES] 27 | { 28 | reg u8 t1 t2; 29 | inline int i; 30 | 31 | cnd = -cnd; 32 | 33 | for i=0 to KYBER_SYMBYTES 34 | { 35 | t1 = dst.[i]; 36 | t2 = (u8)[src + i]; 37 | t2 = t2 ^ t1; 38 | t2 = t2 & cnd; 39 | t1 ^= t2; 40 | dst.[u8 i] = t1; 41 | } 42 | 43 | return dst; 44 | } 45 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber512/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := kem.jazz 2 | include ../../../../../Makefile.common 3 | 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber512/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := kem.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber512/hacspec/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/oldsrc-should-delete/crypto_kem/kyber/kyber512/hacspec/empty -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber768/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := kem.jazz 2 | include ../../../../../Makefile.common 3 | 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber768/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SAFETY_FLAGS := -nocheckalignment 2 | SRCS := kem.jazz 3 | include ../../../../../Makefile.common 4 | 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/kyber/kyber768/hacspec/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/oldsrc-should-delete/crypto_kem/kyber/kyber768/hacspec/empty -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/mlkem/mlkem768/META.yml: -------------------------------------------------------------------------------- 1 | name: MLKEM768 2 | type: kem 3 | checksumsmall: 37a3f3e30152b677a3605fbbba9760326a741344edc64df2e9ba23135d745beb 4 | checksumbig: 5f8345a7632ed05c25db5c3400127242dd187cb2c4ada5cc9dcd581f8b3d81de 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/mlkem/mlkem768/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := kem.jazz 2 | include ../../../../../Makefile.common 3 | 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/mlkem/mlkem768/amd64/avx2/fips202_common.jinc: -------------------------------------------------------------------------------- 1 | param int SHAKE128_RATE = 168; 2 | param int SHAKE256_RATE = 136; 3 | param int SHA3_256_RATE = 136; 4 | param int SHA3_512_RATE = 72; 5 | 6 | u64[4] shake_sep = {9223372036854775808, 9223372036854775808, 9223372036854775808, 9223372036854775808}; 7 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/mlkem/mlkem768/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := kem.jazz 2 | include ../../../../../Makefile.common 3 | 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/mlkem/mlkem768/amd64/ref/verify.jinc: -------------------------------------------------------------------------------- 1 | require "params.jinc" 2 | 3 | inline 4 | fn __verify(reg u64 ctp, reg ptr u8[MLKEM_CT_LEN] ctpc) -> reg u64 5 | { 6 | reg u64 cnd t64; 7 | reg u8 t1 t2; 8 | inline int i; 9 | 10 | cnd = 0; 11 | 12 | for i=0 to MLKEM_CT_LEN 13 | { 14 | t1 = ctpc.[i]; 15 | t2 = (u8)[ctp + i]; 16 | t1 ^= t2; 17 | t64 = (64u)t1; 18 | cnd |= t64; 19 | } 20 | 21 | cnd = -cnd; 22 | cnd >>= 63; 23 | 24 | return cnd; 25 | } 26 | 27 | inline 28 | fn __cmov(reg u64 dst, reg ptr u8[MLKEM_SYMBYTES] src, reg u64 cnd) 29 | { 30 | reg u8 t1 t2; 31 | inline int i; 32 | 33 | cnd = -cnd; 34 | 35 | for i=0 to MLKEM_SYMBYTES 36 | { 37 | t2 = (u8)[dst + i]; 38 | t1 = src.[i]; 39 | t2 = t2 ^ t1; 40 | t2 = t2 & cnd; 41 | t1 ^= t2; 42 | (u8)[dst + i] = t1; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/xwing/META.yml: -------------------------------------------------------------------------------- 1 | name: X-Wing 2 | type: kem 3 | checksumsmall: d80f0bfdf6d38a189cfffe48c048973521c02456bde1934475c38e0819c4afae 4 | checksumbig: 607234d1da70d4441c64c8bb3deff3f22728a38942500457c92dbcdaf393d0c0 5 | claimed-nist-level: 3 6 | claimed-security: IND-CCA2 7 | length-public-key: 1216 8 | length-ciphertext: 1120 9 | length-secret-key: 2464 10 | length-shared-secret: 32 11 | principal-submitters: 12 | - TODO 13 | auxiliary-submitters: 14 | - TODO 15 | implementations: 16 | - name: amd64/ref 17 | version: TODO 18 | supported_platforms: 19 | - architecture: x86_64 20 | operating_systems: 21 | - Linux 22 | - Darwin 23 | required_flags: # FIXME 24 | - avx2 25 | - bmi2 26 | - popcnt 27 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/xwing/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SAFETY_FLAGS := -nocheckalignment 2 | SRCS := kem.jazz 3 | include ../../../../Makefile.common -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/xwing/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SAFETY_FLAGS := -nocheckalignment 2 | SRCS := kem.jazz 3 | include ../../../../Makefile.common -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_kem/xwing/amd64/ref/params.jinc: -------------------------------------------------------------------------------- 1 | u8[6] XWING_LABEL = {0x5c,0x2e,0x2f,0x2f,0x5e,0x5c}; 2 | 3 | param int XWING_PUBLICKEYBYTES = MLKEM_PUBLICKEYBYTES + 32; 4 | param int XWING_SECRETKEYBYTES = MLKEM_SECRETKEYBYTES + 64; 5 | param int XWING_CIPHERTEXTBYTES = MLKEM_CIPHERTEXTBYTES + 32; 6 | param int XWING_KEYPAIRCOINBYTES = MLKEM_SYMBYTES*2 + 32; 7 | param int XWING_ENCCOINBYTES = MLKEM_SYMBYTES + 32; 8 | param int XWING_BYTES = 32; 9 | 10 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace -f namespace_verify 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := onetimeauth.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_ONETIMEAUTH_poly1305_amd64_avx_API_H 2 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_API_H 3 | 4 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_BYTES 16 5 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_KEYBYTES 32 6 | 7 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_ALGNAME "Poly1305" 8 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_ARCH "amd64" 9 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx_IMPL "avx" 10 | 11 | #include 12 | 13 | int jade_onetimeauth_poly1305_amd64_avx( 14 | uint8_t *mac, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *key 18 | ); 19 | 20 | int jade_onetimeauth_poly1305_amd64_avx_verify( 21 | const uint8_t *mac, 22 | const uint8_t *input, 23 | uint64_t input_length, 24 | const uint8_t *key 25 | ); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx/onetimeauth.jazz: -------------------------------------------------------------------------------- 1 | require "poly1305.jinc" 2 | 3 | export fn jade_onetimeauth_poly1305_amd64_avx(reg u64 mac input input_length key) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | mac = mac; 8 | input = input; 9 | input_length = input_length; 10 | key = key; 11 | 12 | __poly1305_avx(mac, input, input_length, key); 13 | 14 | ?{}, r = #set0(); 15 | return r; 16 | } 17 | 18 | export fn jade_onetimeauth_poly1305_amd64_avx_verify(reg u64 mac input input_length key) -> reg u64 19 | { 20 | reg u64 r; 21 | 22 | mac = mac; 23 | input = input; 24 | input_length = input_length; 25 | key = key; 26 | 27 | r = __poly1305_verify_avx(mac, input, input_length, key); 28 | 29 | return r; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := onetimeauth.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_ONETIMEAUTH_poly1305_amd64_avx2_API_H 2 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_API_H 3 | 4 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_BYTES 16 5 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_KEYBYTES 32 6 | 7 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_ALGNAME "Poly1305" 8 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_ARCH "amd64" 9 | #define JADE_ONETIMEAUTH_poly1305_amd64_avx2_IMPL "avx2" 10 | 11 | #include 12 | 13 | int jade_onetimeauth_poly1305_amd64_avx2( 14 | uint8_t *mac, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *key 18 | ); 19 | 20 | int jade_onetimeauth_poly1305_amd64_avx2_verify( 21 | const uint8_t *mac, 22 | const uint8_t *input, 23 | uint64_t input_length, 24 | const uint8_t *key 25 | ); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/avx2/onetimeauth.jazz: -------------------------------------------------------------------------------- 1 | require "poly1305.jinc" 2 | 3 | export fn jade_onetimeauth_poly1305_amd64_avx2(reg u64 mac input input_length key) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | mac = mac; 8 | input = input; 9 | input_length = input_length; 10 | key = key; 11 | 12 | __poly1305_avx2(mac, input, input_length, key); 13 | 14 | ?{}, r = #set0(); 15 | return r; 16 | } 17 | 18 | export fn jade_onetimeauth_poly1305_amd64_avx2_verify(reg u64 mac input input_length key) -> reg u64 19 | { 20 | reg u64 r; 21 | 22 | mac = mac; 23 | input = input; 24 | input_length = input_length; 25 | key = key; 26 | 27 | r = __poly1305_verify_avx2(mac, input, input_length, key); 28 | 29 | return r; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := onetimeauth.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_ONETIMEAUTH_poly1305_amd64_ref_API_H 2 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_API_H 3 | 4 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_BYTES 16 5 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_KEYBYTES 32 6 | 7 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_ALGNAME "Poly1305" 8 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_ARCH "amd64" 9 | #define JADE_ONETIMEAUTH_poly1305_amd64_ref_IMPL "ref" 10 | 11 | #include 12 | 13 | int jade_onetimeauth_poly1305_amd64_ref( 14 | uint8_t *mac, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *key 18 | ); 19 | 20 | int jade_onetimeauth_poly1305_amd64_ref_verify( 21 | const uint8_t *mac, 22 | const uint8_t *input, 23 | uint64_t input_length, 24 | const uint8_t *key 25 | ); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_onetimeauth/poly1305/amd64/ref/onetimeauth.jazz: -------------------------------------------------------------------------------- 1 | require "poly1305.jinc" 2 | 3 | export fn jade_onetimeauth_poly1305_amd64_ref(reg u64 mac input input_length key) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | mac = mac; 8 | input = input; 9 | input_length = input_length; 10 | key = key; 11 | 12 | __poly1305_ref(mac, input, input_length, key); 13 | 14 | ?{}, r = #set0(); 15 | return r; 16 | } 17 | 18 | export fn jade_onetimeauth_poly1305_amd64_ref_verify(reg u64 mac input input_length key) -> reg u64 19 | { 20 | reg u64 r; 21 | 22 | mac = mac; 23 | input = input; 24 | input_length = input_length; 25 | key = key; 26 | 27 | r = __poly1305_verify_ref(mac, input, input_length, key); 28 | 29 | return r; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace -f namespace_base 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/META.yml: -------------------------------------------------------------------------------- 1 | name: Curve25519 2 | type: scalarmult 3 | checksumsmall: a541e0997ead1f170fdfdc2bed3acf8cec8994ba57025a9cf51862afd615d53f 4 | checksumbig: d45bd6e4b5fd18187efb2ebf8ce3455f30933c1b4a2aefcadf4b6923b31b86a1 5 | implementations: 6 | - name: amd64/ref4 7 | version: 0.0.1 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | - name: amd64/ref5 14 | version: 0.0.1 15 | supported_platforms: 16 | - architecture: x86_64 17 | operating_systems: 18 | - Linux 19 | - Darwin 20 | - name: amd64/mulx 21 | version: 0.0.1 22 | supported_platforms: 23 | - architecture: x86_64 24 | operating_systems: 25 | - Linux 26 | - Darwin 27 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/mulx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := scalarmult.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/mulx/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SCALARMULT_curve25519_amd64_mulx_API_H 2 | #define JADE_SCALARMULT_curve25519_amd64_mulx_API_H 3 | 4 | #define JADE_SCALARMULT_curve25519_amd64_mulx_BYTES 32 5 | #define JADE_SCALARMULT_curve25519_amd64_mulx_SCALARBYTES 32 6 | 7 | #define JADE_SCALARMULT_curve25519_amd64_mulx_ALGNAME "Curve25519" 8 | #define JADE_SCALARMULT_curve25519_amd64_mulx_ARCH "amd64" 9 | #define JADE_SCALARMULT_curve25519_amd64_mulx_IMPL "mulx" 10 | 11 | #include 12 | 13 | int jade_scalarmult_curve25519_amd64_mulx( 14 | uint8_t *q, 15 | const uint8_t *n, 16 | const uint8_t *p 17 | ); 18 | 19 | int jade_scalarmult_curve25519_amd64_mulx_base( 20 | uint8_t *q, 21 | const uint8_t *n 22 | ); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/ref4/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := scalarmult.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/ref4/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SCALARMULT_curve25519_amd64_ref4_API_H 2 | #define JADE_SCALARMULT_curve25519_amd64_ref4_API_H 3 | 4 | #define JADE_SCALARMULT_curve25519_amd64_ref4_BYTES 32 5 | #define JADE_SCALARMULT_curve25519_amd64_ref4_SCALARBYTES 32 6 | 7 | #define JADE_SCALARMULT_curve25519_amd64_ref4_ALGNAME "Curve25519" 8 | #define JADE_SCALARMULT_curve25519_amd64_ref4_ARCH "amd64" 9 | #define JADE_SCALARMULT_curve25519_amd64_ref4_IMPL "ref4" 10 | 11 | #include 12 | 13 | int jade_scalarmult_curve25519_amd64_ref4( 14 | uint8_t *q, 15 | const uint8_t *n, 16 | const uint8_t *p 17 | ); 18 | 19 | int jade_scalarmult_curve25519_amd64_ref4_base( 20 | uint8_t *q, 21 | const uint8_t *n 22 | ); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/ref5/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := scalarmult.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_scalarmult/curve25519/amd64/ref5/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SCALARMULT_curve25519_amd64_ref5_API_H 2 | #define JADE_SCALARMULT_curve25519_amd64_ref5_API_H 3 | 4 | #define JADE_SCALARMULT_curve25519_amd64_ref5_BYTES 32 5 | #define JADE_SCALARMULT_curve25519_amd64_ref5_SCALARBYTES 32 6 | 7 | #define JADE_SCALARMULT_curve25519_amd64_ref5_ALGNAME "Curve25519" 8 | #define JADE_SCALARMULT_curve25519_amd64_ref5_ARCH "amd64" 9 | #define JADE_SCALARMULT_curve25519_amd64_ref5_IMPL "ref5" 10 | 11 | #include 12 | 13 | int jade_scalarmult_curve25519_amd64_ref5( 14 | uint8_t *q, 15 | const uint8_t *n, 16 | const uint8_t *p 17 | ); 18 | 19 | int jade_scalarmult_curve25519_amd64_ref5_base( 20 | uint8_t *q, 21 | const uint8_t *n 22 | ); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace -f namespace_open 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | SRCS := secretbox.jazz 3 | include ../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx/secretbox.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20poly1305.jinc" 2 | 3 | export fn jade_secretbox_xsalsa20poly1305_amd64_avx(reg u64 ciphertext plaintext plaintext_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | plaintext_length = plaintext_length; 7 | r = __xsalsa20poly1305_avx(ciphertext, plaintext, plaintext_length, nonce, key); 8 | return r; 9 | } 10 | 11 | export fn jade_secretbox_xsalsa20poly1305_amd64_avx_open(reg u64 plaintext ciphertext ciphertext_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | r = __xsalsa20poly1305_avx_open(plaintext, ciphertext, ciphertext_length, nonce, key); 15 | return r; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx/xsalsa20_32D.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "crypto_stream/xsalsa20/amd64/ref/hsalsa20.jinc" 2 | require "salsa20_32D.jinc" 3 | 4 | inline fn __xsalsa20_ref_32( 5 | reg mut ptr u8[32] out, 6 | reg u64 nonce key) 7 | -> 8 | reg ptr u8[32] 9 | { 10 | stack ptr u8[32] out_s; 11 | stack u64 nonce_s key_s; 12 | reg u32[8] subkey; 13 | 14 | out_s = out; 15 | nonce_s = nonce; 16 | key_s = key; 17 | 18 | subkey = __hsalsa20_ref(nonce, key); 19 | 20 | out = out_s; 21 | nonce = nonce_s; 22 | nonce += 16; 23 | out = __salsa20_ref_32(out, nonce, subkey); 24 | 25 | return out; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | SRCS := secretbox.jazz 3 | include ../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx2/secretbox.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20poly1305.jinc" 2 | 3 | export fn jade_secretbox_xsalsa20poly1305_amd64_avx2(reg u64 ciphertext plaintext plaintext_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | plaintext_length = plaintext_length; 7 | r = __xsalsa20poly1305_avx2(ciphertext, plaintext, plaintext_length, nonce, key); 8 | return r; 9 | } 10 | 11 | export fn jade_secretbox_xsalsa20poly1305_amd64_avx2_open(reg u64 plaintext ciphertext ciphertext_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | r = __xsalsa20poly1305_avx2_open(plaintext, ciphertext, ciphertext_length, nonce, key); 15 | return r; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/avx2/xsalsa20_32D.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "crypto_stream/xsalsa20/amd64/ref/hsalsa20.jinc" 2 | require "salsa20_32D.jinc" 3 | 4 | inline fn __xsalsa20_ref_32( 5 | reg mut ptr u8[32] out, 6 | reg u64 nonce key) 7 | -> 8 | reg ptr u8[32] 9 | { 10 | stack ptr u8[32] out_s; 11 | stack u64 nonce_s key_s; 12 | reg u32[8] subkey; 13 | 14 | out_s = out; 15 | nonce_s = nonce; 16 | key_s = key; 17 | 18 | subkey = __hsalsa20_ref(nonce, key); 19 | 20 | out = out_s; 21 | nonce = nonce_s; 22 | nonce += 16; 23 | out = __salsa20_ref_32(out, nonce, subkey); 24 | 25 | return out; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := secretbox.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/ref/secretbox.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20poly1305.jinc" 2 | 3 | export fn jade_secretbox_xsalsa20poly1305_amd64_ref(reg u64 ciphertext plaintext plaintext_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | plaintext_length = plaintext_length; 7 | r = __xsalsa20poly1305_ref(ciphertext, plaintext, plaintext_length, nonce, key); 8 | return r; 9 | } 10 | 11 | export fn jade_secretbox_xsalsa20poly1305_amd64_ref_open(reg u64 plaintext ciphertext ciphertext_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | r = __xsalsa20poly1305_ref_open(plaintext, ciphertext, ciphertext_length, nonce, key); 15 | return r; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_secretbox/xsalsa20poly1305/amd64/ref/xsalsa20_32D.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "crypto_stream/xsalsa20/amd64/ref/hsalsa20.jinc" 2 | require "salsa20_32D.jinc" 3 | 4 | inline fn __xsalsa20_ref_32( 5 | reg mut ptr u8[32] out, 6 | reg u64 nonce key) 7 | -> 8 | reg ptr u8[32] 9 | { 10 | stack ptr u8[32] out_s; 11 | stack u64 nonce_s key_s; 12 | reg u32[8] subkey; 13 | 14 | out_s = out; 15 | nonce_s = nonce; 16 | key_s = key; 17 | 18 | subkey = __hsalsa20_ref(nonce, key); 19 | 20 | out = out_s; 21 | nonce = nonce_s; 22 | nonce += 16; 23 | out = __salsa20_ref_32(out, nonce, subkey); 24 | 25 | return out; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace_keypair -f namespace -f namespace_open 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/dilithium/common/amd64/expandMask_end.jinc: -------------------------------------------------------------------------------- 1 | inline 2 | fn expandMask(reg ptr u8[64] rho_prime, reg u16 nonce) 3 | -> stack u32[Li2_l * Li2_polydeg] 4 | { 5 | stack u32[Li2_l * Li2_polydeg] y; 6 | inline int i; 7 | stack u16 kappa; 8 | reg u16 v; 9 | reg ptr u32[Li2_polydeg] poly; 10 | for i = 0 to Li2_l { 11 | v = nonce; 12 | v *= Li2_l; 13 | v += i; 14 | kappa = v; 15 | poly = y[Li2_polydeg * i : Li2_polydeg]; 16 | poly = expandMask_poly(poly, rho_prime, kappa); 17 | y[Li2_polydeg * i : Li2_polydeg] = poly; 18 | } 19 | return y; 20 | } -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/dilithium/common/amd64/expandS_end.jinc: -------------------------------------------------------------------------------- 1 | 2 | //reminder to self 3 | //param int SHAKE256_RATE = 136; 4 | 5 | inline 6 | fn expandS(stack u8[64] rho_prime) 7 | -> stack u32[Li2_l * Li2_polydeg], stack u32[Li2_k * Li2_polydeg] 8 | { 9 | reg ptr u32[Li2_polydeg] entry; 10 | stack u32[Li2_l * Li2_polydeg] s1; 11 | stack u32[Li2_k * Li2_polydeg] s2; 12 | 13 | inline int i; 14 | 15 | for i = 0 to Li2_l { 16 | entry = s1[Li2_polydeg * i : Li2_polydeg]; 17 | entry = expandS_poly(rho_prime, i, entry); 18 | s1[Li2_polydeg * i : Li2_polydeg] = entry; 19 | } 20 | 21 | for i = 0 to Li2_k { 22 | entry = s2[Li2_polydeg * i : Li2_polydeg]; 23 | entry = expandS_poly(rho_prime, Li2_l + i, entry); 24 | s2[Li2_polydeg * i : Li2_polydeg] = entry; 25 | } 26 | 27 | return s1, s2; 28 | } 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/dilithium/common/amd64/rounding_end.jinc: -------------------------------------------------------------------------------- 1 | fn make_hint(reg u32 a0, reg u32 a1) -> reg u32 { 2 | reg u32 result; 3 | 4 | result = 0; 5 | 6 | if a0 >s Li2_gamma2 { 7 | result = 1; 8 | } else if a0 reg u64 13 | { 14 | reg u64 r; 15 | 16 | r = __jade_sign_falcon_falcon512_amd64_avx2_open( 17 | message, message_length, 18 | signed_message, signed_message_length, 19 | public_key); 20 | 21 | return r; 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/falcon/falcon512/amd64/avx2/verify.jinc: -------------------------------------------------------------------------------- 1 | 2 | from Jade require "crypto_sign/falcon/falcon512/common/params.jinc" 3 | from Jade require "crypto_sign/falcon/falcon512/common/amd64/common.jinc" 4 | 5 | require "polymul.jinc" 6 | 7 | 8 | inline 9 | fn __verify_raw(stack u16[ARRAY_N] c0 s2 h) -> reg u32 { 10 | 11 | stack u16[ARRAY_N] buff1 buff2; 12 | 13 | reg u64 i; 14 | reg u32 res; 15 | 16 | i = 0; 17 | while(i < ARRAY_N){ 18 | buff2[i] = s2[i]; 19 | i += 1; 20 | } 21 | 22 | 23 | buff2 = __NTT_transpose(buff2); 24 | h = __NTT_transpose(h); 25 | 26 | buff1 = __basemul(buff1, buff2, h); 27 | 28 | buff1 = __iNTT_transpose(buff1); 29 | 30 | 31 | buff1 = __sub_canonical(h, buff1, c0); 32 | 33 | res = __is_short(buff1, s2); 34 | 35 | return res; 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_sign/falcon/falcon512/common/params.jinc: -------------------------------------------------------------------------------- 1 | param int LOGN = 9; 2 | param int ARRAY_N = 512; 3 | param int NONCELEN = 40; 4 | param int MODQ_DECODE_BYTES = 896; 5 | param int BOUND = 34034726; 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace -f namespace_xor 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/chacha/common/amd64/avx/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/avx/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_chacha_chacha12_amd64_avx_API_H 2 | #define JADE_STREAM_chacha_chacha12_amd64_avx_API_H 3 | 4 | #define JADE_STREAM_chacha_chacha12_amd64_avx_KEYBYTES 32 5 | #define JADE_STREAM_chacha_chacha12_amd64_avx_NONCEBYTES 8 6 | 7 | #define JADE_STREAM_chacha_chacha12_amd64_avx_ALGNAME "ChaCha12" 8 | #define JADE_STREAM_chacha_chacha12_amd64_avx_ARCH "amd64" 9 | #define JADE_STREAM_chacha_chacha12_amd64_avx_IMPL "avx" 10 | 11 | #include 12 | 13 | int jade_stream_chacha_chacha12_amd64_avx_xor( 14 | uint8_t *output, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *nonce, 18 | const uint8_t *key 19 | ); 20 | 21 | int jade_stream_chacha_chacha12_amd64_avx( 22 | uint8_t *stream, 23 | uint64_t stream_length, 24 | const uint8_t *nonce, 25 | const uint8_t *key 26 | ); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/avx/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/avx/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha12_amd64_avx_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_avx(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha12_amd64_avx(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_avx(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/chacha/common/amd64/avx2/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/avx2/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/avx2/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha12_amd64_avx2_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_avx2(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha12_amd64_avx2(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_avx2(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha12/amd64/ref/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/ref/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha12_amd64_ref_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_ref(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha12_amd64_ref(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_ref(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20-ietf/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f namespace -f namespace_xor -f namespace_ic -f namespace_xor_ic 2 | SRCS := stream.jazz 3 | include ../../../../../crypto_stream/chacha/common/amd64/avx/Flags.mk 4 | include ../../../../../Makefile.common 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20-ietf/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f namespace -f namespace_xor -f namespace_ic -f namespace_xor_ic 2 | SRCS := stream.jazz 3 | include ../../../../../crypto_stream/chacha/common/amd64/avx2/Flags.mk 4 | include ../../../../../Makefile.common 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20-ietf/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f namespace -f namespace_xor -f namespace_ic -f namespace_xor_ic 2 | SRCS := stream.jazz 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/chacha/common/amd64/avx/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/avx/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_chacha_chacha20_amd64_avx_API_H 2 | #define JADE_STREAM_chacha_chacha20_amd64_avx_API_H 3 | 4 | #define JADE_STREAM_chacha_chacha20_amd64_avx_KEYBYTES 32 5 | #define JADE_STREAM_chacha_chacha20_amd64_avx_NONCEBYTES 8 6 | 7 | #define JADE_STREAM_chacha_chacha20_amd64_avx_ALGNAME "ChaCha20" 8 | #define JADE_STREAM_chacha_chacha20_amd64_avx_ARCH "amd64" 9 | #define JADE_STREAM_chacha_chacha20_amd64_avx_IMPL "avx" 10 | 11 | #include 12 | 13 | int jade_stream_chacha_chacha20_amd64_avx_xor( 14 | uint8_t *output, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *nonce, 18 | const uint8_t *key 19 | ); 20 | 21 | int jade_stream_chacha_chacha20_amd64_avx( 22 | uint8_t *stream, 23 | uint64_t stream_length, 24 | const uint8_t *nonce, 25 | const uint8_t *key 26 | ); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/avx/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/avx/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha20_amd64_avx_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_avx(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha20_amd64_avx(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_avx(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/chacha/common/amd64/avx2/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/avx2/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/avx2/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha20_amd64_avx2_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_avx2(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha20_amd64_avx2(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_avx2(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/chacha20/amd64/ref/stream.jazz: -------------------------------------------------------------------------------- 1 | param int CHACHA_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/chacha/common/amd64/ref/chacha.jinc" 4 | 5 | export fn jade_stream_chacha_chacha20_amd64_ref_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __chacha_xor_ref(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_chacha_chacha20_amd64_ref(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __chacha_ref(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/Flags.mk: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/_chacha.jinc: -------------------------------------------------------------------------------- 1 | inline fn __chacha_xor_avx(reg u64 output input len nonce key) 2 | { 3 | if(len < 129) 4 | { __chacha_xor_h_x2_avx(output, input, len, nonce, key); } 5 | else 6 | { __chacha_xor_v_avx(output, input, len, nonce, key); } 7 | } 8 | 9 | inline fn __chacha_avx(reg u64 output len nonce key) 10 | { 11 | if(len < 129) 12 | { __chacha_h_x2_avx(output, len, nonce, key); } 13 | else 14 | { __chacha_v_avx(output, len, nonce, key); } 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/chacha.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_h.jinc" 2 | require "chacha_v.jinc" 3 | require "_chacha.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/chacha_globals.jinc: -------------------------------------------------------------------------------- 1 | u128 CHACHA_SIGMA_H_AVX = (4u32)[0x6b206574, 0x79622d32, 0x3320646e, 0x61707865]; 2 | u128 CHACHA_P01_H_AVX = (2u64)[0,1]; 3 | u128 CHACHA_P02_H_AVX = (2u64)[0,2]; 4 | 5 | u128[4] CHACHA_SIGMA_V_AVX = { 6 | (4u32)[0x61707865,0x61707865,0x61707865,0x61707865], 7 | (4u32)[0x3320646e,0x3320646e,0x3320646e,0x3320646e], 8 | (4u32)[0x79622d32,0x79622d32,0x79622d32,0x79622d32], 9 | (4u32)[0x6b206574,0x6b206574,0x6b206574,0x6b206574]}; 10 | u128 CHACHA_P3210_V_AVX = (4u32)[3,2,1,0]; 11 | u128 CHACHA_P44_V_AVX = (2u64)[4,4]; 12 | 13 | u128 CHACHA_R16_AVX = (16u8)[13,12,15,14, 9,8,11,10, 5,4,7,6, 1,0,3,2]; 14 | u128 CHACHA_R8_AVX = (16u8)[14,13,12,15, 10,9,8,11, 6,5,4,7, 2,1,0,3]; 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/chacha_h.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_state_h.jinc" 2 | require "chacha_store_h.jinc" 3 | require "chacha_core_h.jinc" 4 | require "chacha_entry_h.jinc" 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx/chacha_v.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_state_v.jinc" 2 | require "chacha_store_v.jinc" 3 | require "chacha_core_v.jinc" 4 | require "chacha_entry_v.jinc" 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx2/Flags.mk: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx2/_chacha.jinc: -------------------------------------------------------------------------------- 1 | inline fn __chacha_xor_avx2(reg u64 output input len nonce key) 2 | { 3 | if(len < 257) 4 | { __chacha_xor_h_x2_avx2(output, input, len, nonce, key); } 5 | else 6 | { __chacha_xor_v_avx2(output, input, len, nonce, key); } 7 | } 8 | 9 | inline fn __chacha_avx2(reg u64 output len nonce key) 10 | { 11 | if(len < 257) 12 | { __chacha_h_x2_avx2(output, len, nonce, key); } 13 | else 14 | { __chacha_v_avx2(output, len, nonce, key); } 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx2/chacha.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_h.jinc" 2 | require "chacha_v.jinc" 3 | require "_chacha.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx2/chacha_h.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_state_h.jinc" 2 | require "chacha_store_h.jinc" 3 | require "chacha_core_h.jinc" 4 | require "chacha_entry_h.jinc" 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/avx2/chacha_v.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_state_v.jinc" 2 | require "chacha_store_v.jinc" 3 | require "chacha_core_v.jinc" 4 | require "chacha_entry_v.jinc" 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/chacha/common/amd64/ref/chacha.jinc: -------------------------------------------------------------------------------- 1 | require "chacha_state.jinc" 2 | require "chacha_store.jinc" 3 | require "chacha_core.jinc" 4 | require "chacha_entry.jinc" 5 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx/Flags.mk: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx/_salsa20.jinc: -------------------------------------------------------------------------------- 1 | inline fn __salsa20_xor_avx(reg u64 output input len nonce key) 2 | { 3 | __salsa20_xor_v_avx(output, input, len, nonce, key); 4 | } 5 | 6 | 7 | inline fn __salsa20_xor_1_avx(reg u64 output input len nonce, reg u32[8] key) 8 | { 9 | __salsa20_xor_v_1_avx(output, input, len, nonce, key); 10 | } 11 | 12 | 13 | inline fn __salsa20_avx(reg u64 output len nonce key) 14 | { 15 | __salsa20_v_avx(output, len, nonce, key); 16 | } 17 | 18 | 19 | inline fn __salsa20_1_avx(reg u64 output len nonce, reg u32[8] key) 20 | { 21 | __salsa20_v_1_avx(output, len, nonce, key); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx/salsa20.jinc: -------------------------------------------------------------------------------- 1 | //require "salsa20_h.jinc" 2 | require "salsa20_v.jinc" 3 | require "_salsa20.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx/salsa20_globals.jinc: -------------------------------------------------------------------------------- 1 | u128[4] SALSA20_SIGMA_V_AVX = { 2 | (4u32)[0x61707865,0x61707865,0x61707865,0x61707865], 3 | (4u32)[0x3320646e,0x3320646e,0x3320646e,0x3320646e], 4 | (4u32)[0x79622d32,0x79622d32,0x79622d32,0x79622d32], 5 | (4u32)[0x6b206574,0x6b206574,0x6b206574,0x6b206574]}; 6 | 7 | u128 SALSA20_P3210_V_AVX = (4u32)[3,2,1,0]; 8 | u128 SALSA20_P44_V_AVX = (2u64)[4,4]; 9 | 10 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx/salsa20_v.jinc: -------------------------------------------------------------------------------- 1 | require "salsa20_state_v.jinc" 2 | from Jade require "crypto_stream/chacha/common/amd64/avx/chacha_store_v.jinc" 3 | require "salsa20_core_v.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx2/Flags.mk: -------------------------------------------------------------------------------- 1 | override JFLAGS += -lazy-regalloc 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx2/_salsa20.jinc: -------------------------------------------------------------------------------- 1 | inline fn __salsa20_xor_avx2(reg u64 output input len nonce key) 2 | { 3 | __salsa20_xor_v_avx2(output, input, len, nonce, key); 4 | } 5 | 6 | inline fn __salsa20_xor_1_avx2(reg u64 output input len nonce, reg u32[8] key) 7 | { 8 | __salsa20_xor_v_1_avx2(output, input, len, nonce, key); 9 | } 10 | 11 | inline fn __salsa20_avx2(reg u64 output len nonce key) 12 | { 13 | __salsa20_v_avx2(output, len, nonce, key); 14 | } 15 | 16 | inline fn __salsa20_1_avx2(reg u64 output len nonce, reg u32[8] key) 17 | { 18 | __salsa20_v_1_avx2(output, len, nonce, key); 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx2/salsa20.jinc: -------------------------------------------------------------------------------- 1 | //require "salsa20_h.jinc" 2 | require "salsa20_v.jinc" 3 | require "_salsa20.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx2/salsa20_globals.jinc: -------------------------------------------------------------------------------- 1 | u256[4] SALSA20_SIGMA_V_AVX2 = { 2 | (8u32)[0x61707865,0x61707865,0x61707865,0x61707865, 3 | 0x61707865,0x61707865,0x61707865,0x61707865], 4 | (8u32)[0x3320646e,0x3320646e,0x3320646e,0x3320646e, 5 | 0x3320646e,0x3320646e,0x3320646e,0x3320646e], 6 | (8u32)[0x79622d32,0x79622d32,0x79622d32,0x79622d32, 7 | 0x79622d32,0x79622d32,0x79622d32,0x79622d32], 8 | (8u32)[0x6b206574,0x6b206574,0x6b206574,0x6b206574, 9 | 0x6b206574,0x6b206574,0x6b206574,0x6b206574]}; 10 | 11 | u256 SALSA20_P76543210_V_AVX2 = (8u32)[7,6,5,4,3,2,1,0]; 12 | u256 SALSA20_P8888_V_AVX2 = (4u64)[8,8,8,8]; 13 | 14 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/avx2/salsa20_v.jinc: -------------------------------------------------------------------------------- 1 | require "salsa20_state_v.jinc" 2 | from Jade require "crypto_stream/chacha/common/amd64/avx2/chacha_store_v.jinc" 3 | require "salsa20_core_v.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/common/amd64/ref/salsa20.jinc: -------------------------------------------------------------------------------- 1 | require "salsa20_state.jinc" 2 | from Jade require "crypto_stream/chacha/common/amd64/ref/chacha_store.jinc" 3 | require "salsa20_core.jinc" 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/avx/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/avx/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa20_amd64_avx_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_avx(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_salsa20_salsa20_amd64_avx(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __salsa20_avx(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/salsa20/common/amd64/avx2/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/avx2/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/avx2/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa20_amd64_avx2_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_avx2(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_salsa20_salsa20_amd64_avx2(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __salsa20_avx2(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa20/amd64/ref/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=20; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/ref/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa20_amd64_ref_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_ref(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_salsa20_salsa20_amd64_ref(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __salsa20_ref(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/avx/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/avx/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa2012_amd64_avx_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_avx(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | 14 | export fn jade_stream_salsa20_salsa2012_amd64_avx(reg u64 stream stream_length nonce key) -> reg u64 15 | { 16 | reg u64 r; 17 | __salsa20_avx(stream, stream_length, nonce, key); 18 | ?{}, r = #set0(); 19 | return r; 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../crypto_stream/salsa20/common/amd64/avx2/Flags.mk 3 | include ../../../../../Makefile.common 4 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/avx2/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/avx2/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa2012_amd64_avx2_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_avx2(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_salsa20_salsa2012_amd64_avx2(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __salsa20_avx2(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/salsa20/salsa2012/amd64/ref/stream.jazz: -------------------------------------------------------------------------------- 1 | param int SALSA20_ROUNDS=12; 2 | 3 | from Jade require "crypto_stream/salsa20/common/amd64/ref/salsa20.jinc" 4 | 5 | export fn jade_stream_salsa20_salsa2012_amd64_ref_xor(reg u64 output input input_length nonce key) -> reg u64 6 | { 7 | reg u64 r; 8 | __salsa20_xor_ref(output, input, input_length, nonce, key); 9 | ?{}, r = #set0(); 10 | return r; 11 | } 12 | 13 | export fn jade_stream_salsa20_salsa2012_amd64_ref(reg u64 stream stream_length nonce key) -> reg u64 14 | { 15 | reg u64 r; 16 | __salsa20_ref(stream, stream_length, nonce, key); 17 | ?{}, r = #set0(); 18 | return r; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_xsalsa20_amd64_avx_API_H 2 | #define JADE_STREAM_xsalsa20_amd64_avx_API_H 3 | 4 | #define JADE_STREAM_xsalsa20_amd64_avx_KEYBYTES 32 5 | #define JADE_STREAM_xsalsa20_amd64_avx_NONCEBYTES 24 6 | 7 | #define JADE_STREAM_xsalsa20_amd64_avx_ALGNAME "XSalsa20/20" 8 | #define JADE_STREAM_xsalsa20_amd64_avx_ARCH "amd64" 9 | #define JADE_STREAM_xsalsa20_amd64_avx_IMPL "avx" 10 | 11 | #include 12 | 13 | int jade_stream_xsalsa20_amd64_avx_xor( 14 | uint8_t *output, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *nonce, 18 | const uint8_t *key 19 | ); 20 | 21 | int jade_stream_xsalsa20_amd64_avx( 22 | uint8_t *stream, 23 | uint64_t stream_length, 24 | const uint8_t *nonce, 25 | const uint8_t *key 26 | ); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx/stream.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20.jinc" 2 | 3 | export fn jade_stream_xsalsa20_amd64_avx_xor(reg u64 output input input_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | __xsalsa20_xor_avx(output, input, input_length, nonce, key); 7 | ?{}, r = #set0(); 8 | return r; 9 | } 10 | 11 | export fn jade_stream_xsalsa20_amd64_avx(reg u64 stream stream_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | __xsalsa20_avx(stream, stream_length, nonce, key); 15 | ?{}, r = #set0(); 16 | return r; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_xsalsa20_amd64_avx2_API_H 2 | #define JADE_STREAM_xsalsa20_amd64_avx2_API_H 3 | 4 | #define JADE_STREAM_xsalsa20_amd64_avx2_KEYBYTES 32 5 | #define JADE_STREAM_xsalsa20_amd64_avx2_NONCEBYTES 24 6 | 7 | #define JADE_STREAM_xsalsa20_amd64_avx2_ALGNAME "XSalsa20/20" 8 | #define JADE_STREAM_xsalsa20_amd64_avx2_ARCH "amd64" 9 | #define JADE_STREAM_xsalsa20_amd64_avx2_IMPL "avx2" 10 | 11 | #include 12 | 13 | int jade_stream_xsalsa20_amd64_avx2_xor( 14 | uint8_t *output, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *nonce, 18 | const uint8_t *key 19 | ); 20 | 21 | int jade_stream_xsalsa20_amd64_avx2( 22 | uint8_t *stream, 23 | uint64_t stream_length, 24 | const uint8_t *nonce, 25 | const uint8_t *key 26 | ); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/avx2/stream.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20.jinc" 2 | 3 | export fn jade_stream_xsalsa20_amd64_avx2_xor(reg u64 output input input_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | __xsalsa20_xor_avx2(output, input, input_length, nonce, key); 7 | ?{}, r = #set0(); 8 | return r; 9 | } 10 | 11 | export fn jade_stream_xsalsa20_amd64_avx2(reg u64 stream stream_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | __xsalsa20_avx2(stream, stream_length, nonce, key); 15 | ?{}, r = #set0(); 16 | return r; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := stream.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_xsalsa20_amd64_ref_API_H 2 | #define JADE_STREAM_xsalsa20_amd64_ref_API_H 3 | 4 | #define JADE_STREAM_xsalsa20_amd64_ref_KEYBYTES 32 5 | #define JADE_STREAM_xsalsa20_amd64_ref_NONCEBYTES 24 6 | 7 | #define JADE_STREAM_xsalsa20_amd64_ref_ALGNAME "XSalsa20/20" 8 | #define JADE_STREAM_xsalsa20_amd64_ref_ARCH "amd64" 9 | #define JADE_STREAM_xsalsa20_amd64_ref_IMPL "ref" 10 | 11 | #include 12 | 13 | int jade_stream_xsalsa20_amd64_ref_xor( 14 | uint8_t *output, 15 | const uint8_t *input, 16 | uint64_t input_length, 17 | const uint8_t *nonce, 18 | const uint8_t *key 19 | ); 20 | 21 | int jade_stream_xsalsa20_amd64_ref( 22 | uint8_t *stream, 23 | uint64_t stream_length, 24 | const uint8_t *nonce, 25 | const uint8_t *key 26 | ); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_stream/xsalsa20/amd64/ref/stream.jazz: -------------------------------------------------------------------------------- 1 | require "xsalsa20.jinc" 2 | 3 | export fn jade_stream_xsalsa20_amd64_ref_xor(reg u64 output input input_length nonce key) -> reg u64 4 | { 5 | reg u64 r; 6 | __xsalsa20_xor_ref(output, input, input_length, nonce, key); 7 | ?{}, r = #set0(); 8 | return r; 9 | } 10 | 11 | export fn jade_stream_xsalsa20_amd64_ref(reg u64 stream stream_length nonce key) -> reg u64 12 | { 13 | reg u64 r; 14 | __xsalsa20_ref(stream, stream_length, nonce, key); 15 | ?{}, r = #set0(); 16 | return r; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_verify/16/amd64/common/Makefile: -------------------------------------------------------------------------------- 1 | ECFN := -f __crypto_verify_p_u8x16_r_u64x2 2 | JEXT := jinc 3 | SRCS := crypto_verify_16.jinc 4 | entry: extract 5 | include ../../../../Makefile.common 6 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_verify/16/amd64/common/crypto_verify_16.jinc: -------------------------------------------------------------------------------- 1 | inline fn __crypto_verify_p_u8x16_r_u64x2(reg u64 _h, reg u64[2] h) -> reg u64 2 | { 3 | reg bool cf; 4 | reg u64 t r; 5 | 6 | // r = ([_h + 0] ^ h[0]) | ([_h + 8] ^ h[1]) 7 | r = h[0]; 8 | r ^= [_h + 0]; 9 | t = h[1]; 10 | t ^= [_h + 8]; 11 | r |= t; 12 | 13 | // check if r has any bit set 14 | _,_,_,_,_,t = #set0(); 15 | cf, r -= 1; 16 | _, t += 0 + cf; 17 | t -= 1; 18 | 19 | return t; 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_verify/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/EcFlags.mk: -------------------------------------------------------------------------------- 1 | ECFN ?= -f namespace 2 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/META.yml: -------------------------------------------------------------------------------- 1 | name: SHAKE128 2 | type: xof 3 | checksumsmall: 8b58328d502a3fc2d9eab9b13303a983ed7599449a00f0308531b6ca2aee82e4 4 | checksumbig: 9c868497badea35040a1c8b2c37f686f878bbb7a5b32dbee2507fe6a7404add7 5 | implementations: 6 | - name: amd64/ref 7 | version: TODO 8 | supported_platforms: 9 | - architecture: x86_64 10 | operating_systems: 11 | - Linux 12 | - Darwin 13 | required_flags: # FIXME 14 | - popcnt 15 | - name: amd64/avx2 16 | version: TODO 17 | supported_platforms: 18 | - architecture: x86_64 19 | operating_systems: 20 | - Linux 21 | - Darwin 22 | required_flags: #FIXME 23 | - avx2 24 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake128_amd64_avx2_API_H 2 | #define JADE_XOF_shake128_amd64_avx2_API_H 3 | 4 | #define JADE_XOF_shake128_amd64_avx2_ALGNAME "SHAKE128" 5 | #define JADE_XOF_shake128_amd64_avx2_ARCH "amd64" 6 | #define JADE_XOF_shake128_amd64_avx2_IMPL "avx2" 7 | 8 | #include 9 | 10 | int jade_xof_shake128_amd64_avx2( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/avx2/shake128.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __shake128_avx2(reg u64 out outlen in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1344/8); 10 | 11 | __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/avx2/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake128.jinc" 2 | 3 | export fn jade_xof_shake128_amd64_avx2(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __shake128_avx2(output, output_length, input, input_length, ms); 11 | ?{}, r = #set0(); 12 | return r; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake128_amd64_bmi1_API_H 2 | #define JADE_XOF_shake128_amd64_bmi1_API_H 3 | 4 | #define JADE_XOF_shake128_amd64_bmi1_ALGNAME "SHAKE128" 5 | #define JADE_XOF_shake128_amd64_bmi1_ARCH "amd64" 6 | #define JADE_XOF_shake128_amd64_bmi1_IMPL "bmi1" 7 | 8 | #include 9 | 10 | int jade_xof_shake128_amd64_bmi1( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/bmi1/shake128.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __shake128_bmi1(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1344/8); 10 | 11 | __keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/bmi1/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake128.jinc" 2 | 3 | export fn jade_xof_shake128_amd64_bmi1(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake128_bmi1(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake128_amd64_ref_API_H 2 | #define JADE_XOF_shake128_amd64_ref_API_H 3 | 4 | #define JADE_XOF_shake128_amd64_ref_ALGNAME "SHAKE128" 5 | #define JADE_XOF_shake128_amd64_ref_ARCH "amd64" 6 | #define JADE_XOF_shake128_amd64_ref_IMPL "ref" 7 | 8 | #include 9 | 10 | int jade_xof_shake128_amd64_ref( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref/shake128.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __shake128_ref(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1344/8); 10 | 11 | __keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake128.jinc" 2 | 3 | export fn jade_xof_shake128_amd64_ref(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake128_ref(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake128_amd64_ref1_API_H 2 | #define JADE_XOF_shake128_amd64_ref1_API_H 3 | 4 | #define JADE_XOF_shake128_amd64_ref1_ALGNAME "SHAKE128" 5 | #define JADE_XOF_shake128_amd64_ref1_ARCH "amd64" 6 | #define JADE_XOF_shake128_amd64_ref1_IMPL "ref1" 7 | 8 | #include 9 | 10 | int jade_xof_shake128_amd64_ref1( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref1/shake128.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __shake128_ref1(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1344/8); 10 | 11 | __keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake128/amd64/ref1/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake128.jinc" 2 | 3 | export fn jade_xof_shake128_amd64_ref1(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake128_ref1(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/avx2/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake256_amd64_avx2_API_H 2 | #define JADE_XOF_shake256_amd64_avx2_API_H 3 | 4 | #define JADE_XOF_shake256_amd64_avx2_ALGNAME "SHAKE256" 5 | #define JADE_XOF_shake256_amd64_avx2_ARCH "amd64" 6 | #define JADE_XOF_shake256_amd64_avx2_IMPL "avx2" 7 | 8 | #include 9 | 10 | int jade_xof_shake256_amd64_avx2( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/avx2/shake256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/avx2/keccak1600.jinc" 2 | 3 | inline fn __shake256_avx2(reg u64 out outlen in inlen, #msf reg u64 ms) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1088/8); 10 | 11 | __keccak1600_avx2(out, outlen, in, inlen, trail_byte, rate, ms); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/avx2/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake256.jinc" 2 | 3 | export fn jade_xof_shake256_amd64_avx2(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | #msf reg u64 ms; 7 | 8 | ms = #init_msf(); 9 | 10 | __shake256_avx2(output, output_length, input, input_length, ms); 11 | 12 | ?{}, r = #set0(); 13 | return r; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/bmi1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/bmi1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake256_amd64_bmi1_API_H 2 | #define JADE_XOF_shake256_amd64_bmi1_API_H 3 | 4 | #define JADE_XOF_shake256_amd64_bmi1_ALGNAME "SHAKE256" 5 | #define JADE_XOF_shake256_amd64_bmi1_ARCH "amd64" 6 | #define JADE_XOF_shake256_amd64_bmi1_IMPL "bmi1" 7 | 8 | #include 9 | 10 | int jade_xof_shake256_amd64_bmi1( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/bmi1/shake256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/bmi1/keccak1600.jinc" 2 | 3 | inline fn __shake256_bmi1(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1088/8); 10 | 11 | _keccak1600_bmi1(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/bmi1/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake256.jinc" 2 | 3 | export fn jade_xof_shake256_amd64_bmi1(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake256_bmi1(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake256_amd64_ref_API_H 2 | #define JADE_XOF_shake256_amd64_ref_API_H 3 | 4 | #define JADE_XOF_shake256_amd64_ref_ALGNAME "SHAKE256" 5 | #define JADE_XOF_shake256_amd64_ref_ARCH "amd64" 6 | #define JADE_XOF_shake256_amd64_ref_IMPL "ref" 7 | 8 | #include 9 | 10 | int jade_xof_shake256_amd64_ref( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref/shake256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref/keccak1600.jinc" 2 | 3 | inline fn __shake256_ref(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1088/8); 10 | 11 | __keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake256.jinc" 2 | 3 | export fn jade_xof_shake256_amd64_ref(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake256_ref(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref1/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref1/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake256_amd64_ref1_API_H 2 | #define JADE_XOF_shake256_amd64_ref1_API_H 3 | 4 | #define JADE_XOF_shake256_amd64_ref1_ALGNAME "SHAKE256" 5 | #define JADE_XOF_shake256_amd64_ref1_ARCH "amd64" 6 | #define JADE_XOF_shake256_amd64_ref1_IMPL "ref1" 7 | 8 | #include 9 | 10 | int jade_xof_shake256_amd64_ref1( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref1/shake256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/ref1/keccak1600.jinc" 2 | 3 | inline fn __shake256_ref1(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1088/8); 10 | 11 | _keccak1600_ref1(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/ref1/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake256.jinc" 2 | 3 | export fn jade_xof_shake256_amd64_ref1(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake256_ref1(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/spec/Makefile: -------------------------------------------------------------------------------- 1 | SRCS := xof.jazz 2 | include ../../../../Makefile.common 3 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/spec/include/api.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_shake256_amd64_spec_API_H 2 | #define JADE_XOF_shake256_amd64_spec_API_H 3 | 4 | #define JADE_XOF_shake256_amd64_spec_ALGNAME "SHAKE256" 5 | #define JADE_XOF_shake256_amd64_spec_ARCH "amd64" 6 | #define JADE_XOF_shake256_amd64_spec_IMPL "spec" 7 | 8 | #include 9 | 10 | int jade_xof_shake256_amd64_spec( 11 | uint8_t *output, 12 | uint64_t output_length, 13 | const uint8_t *input, 14 | uint64_t input_length 15 | ); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/spec/shake256.jinc: -------------------------------------------------------------------------------- 1 | from Jade require "common/keccak/keccak1600/amd64/spec/keccak1600.jinc" 2 | 3 | inline fn __shake256_spec(reg u64 out outlen in inlen) 4 | { 5 | reg u64 rate; 6 | reg u8 trail_byte; 7 | 8 | trail_byte = 0x1F; 9 | rate = (1088/8); 10 | 11 | __keccak1600_spec(out, outlen, in, inlen, trail_byte, rate); 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /oldsrc-should-delete/crypto_xof/shake256/amd64/spec/xof.jazz: -------------------------------------------------------------------------------- 1 | require "shake256.jinc" 2 | 3 | export fn jade_xof_shake256_amd64_spec(reg u64 output output_length input input_length) -> reg u64 4 | { 5 | reg u64 r; 6 | 7 | _ = #init_msf(); 8 | 9 | __shake256_spec(output, output_length, input, input_length); 10 | ?{}, r = #set0(); 11 | return r; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /proof/.gitignore: -------------------------------------------------------------------------------- 1 | *.eco 2 | *_s.ec 3 | *_ct.ec 4 | *.ec.out 5 | *Array*.ec 6 | arrays/ 7 | -------------------------------------------------------------------------------- /proof/common/keccak/keccak1600/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/common/keccak/keccak1600/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/common/keccak/keccak1600/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/common/keccak/keccak1600/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/common/keccak/keccak1600/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/common/keccak/keccak1600/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/common/keccak/keccak1600/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/common/keccak/keccak1600/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto-specs: -------------------------------------------------------------------------------- 1 | ../submodules/crypto-specs/ -------------------------------------------------------------------------------- /proof/crypto_hash/sha256/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha256/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha256/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha256_amd64_ref_ct : 4 | M.jade_hash_sha256_amd64_ref ~ M.jade_hash_sha256_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-224/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_224_amd64_avx2_ct : 4 | M.jade_hash_sha3_224_amd64_avx2 ~ M.jade_hash_sha3_224_amd64_avx2 : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-224/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-224/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_224_amd64_ref_ct : 4 | M.jade_hash_sha3_224_amd64_ref ~ M.jade_hash_sha3_224_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-224/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-224/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-256/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_256_amd64_avx2_ct : 4 | M.jade_hash_sha3_256_amd64_avx2 ~ M.jade_hash_sha3_256_amd64_avx2 : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-256/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-256/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_256_amd64_ref_ct : 4 | M.jade_hash_sha3_256_amd64_ref ~ M.jade_hash_sha3_256_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-256/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-256/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-384/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_384_amd64_avx2_ct : 4 | M.jade_hash_sha3_384_amd64_avx2 ~ M.jade_hash_sha3_384_amd64_avx2 : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-384/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-384/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_384_amd64_ref_ct : 4 | M.jade_hash_sha3_384_amd64_ref ~ M.jade_hash_sha3_384_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-384/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-384/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-512/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_512_amd64_avx2_ct : 4 | M.jade_hash_sha3_512_amd64_avx2 ~ M.jade_hash_sha3_512_amd64_avx2 : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-512/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-512/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha3_512_amd64_ref_ct : 4 | M.jade_hash_sha3_512_amd64_ref ~ M.jade_hash_sha3_512_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_hash/sha3-512/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha3-512/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha512/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_hash/sha512/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_hash/sha512/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_hash_sha512_amd64_ref_ct : 4 | M.jade_hash_sha512_amd64_ref ~ M.jade_hash_sha512_amd64_ref : 5 | ={hash, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_kem/kyber/kyber512/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_kem/kyber/kyber512/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_kem/kyber/kyber512/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_kem/kyber/kyber512/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_kem/kyber/kyber768/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_kem/kyber/kyber768/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_kem/kyber/kyber768/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_kem/kyber/kyber768/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_kem/xwing/amd64/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_kem/xwing/amd64/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_onetimeauth/poly1305/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_onetimeauth_poly1305_amd64_avx_ct : 4 | M.jade_onetimeauth_poly1305_amd64_avx ~ M.jade_onetimeauth_poly1305_amd64_avx : 5 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_onetimeauth_poly1305_amd64_avx_verify_ct : 11 | M.jade_onetimeauth_poly1305_amd64_avx_verify ~ M.jade_onetimeauth_poly1305_amd64_avx_verify : 12 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_onetimeauth/poly1305/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_onetimeauth_poly1305_amd64_avx2_ct : 4 | M.jade_onetimeauth_poly1305_amd64_avx2 ~ M.jade_onetimeauth_poly1305_amd64_avx2 : 5 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_onetimeauth_poly1305_amd64_avx2_verify_ct : 11 | M.jade_onetimeauth_poly1305_amd64_avx2_verify ~ M.jade_onetimeauth_poly1305_amd64_avx2_verify : 12 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_onetimeauth/poly1305/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_onetimeauth/poly1305/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_onetimeauth_poly1305_amd64_ref_ct : 4 | M.jade_onetimeauth_poly1305_amd64_ref ~ M.jade_onetimeauth_poly1305_amd64_ref : 5 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_onetimeauth_poly1305_amd64_ref_verify_ct : 11 | M.jade_onetimeauth_poly1305_amd64_ref_verify ~ M.jade_onetimeauth_poly1305_amd64_ref_verify : 12 | ={mac, input, input_length, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/mulx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_scalarmult/curve25519/amd64/mulx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/mulx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv jade_scalarmult_curve25519_amd64_mulx : 4 | M.jade_scalarmult_curve25519_amd64_mulx ~ M.jade_scalarmult_curve25519_amd64_mulx : 5 | ={qp, np, pp, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv jade_scalarmult_curve25519_amd64_mulx_base : 11 | M.jade_scalarmult_curve25519_amd64_mulx_base ~ M.jade_scalarmult_curve25519_amd64_mulx_base : 12 | ={qp, np, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | 17 | -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/ref4/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_scalarmult/curve25519/amd64/ref4/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/ref4/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv jade_scalarmult_curve25519_amd64_ref4 : 4 | M.jade_scalarmult_curve25519_amd64_ref4 ~ M.jade_scalarmult_curve25519_amd64_ref4 : 5 | ={qp, np, pp, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv jade_scalarmult_curve25519_amd64_ref4_base : 11 | M.jade_scalarmult_curve25519_amd64_ref4_base ~ M.jade_scalarmult_curve25519_amd64_ref4_base : 12 | ={qp, np, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | 17 | -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/ref5/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_scalarmult/curve25519/amd64/ref5/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_scalarmult/curve25519/amd64/ref5/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv jade_scalarmult_curve25519_amd64_ref5 : 4 | M.jade_scalarmult_curve25519_amd64_ref5 ~ M.jade_scalarmult_curve25519_amd64_ref5 : 5 | ={qp, np, pp, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv jade_scalarmult_curve25519_amd64_ref5_base : 11 | M.jade_scalarmult_curve25519_amd64_ref5_base ~ M.jade_scalarmult_curve25519_amd64_ref5_base : 12 | ={qp, np, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | 17 | -------------------------------------------------------------------------------- /proof/crypto_secretbox/xsalsa20poly1305/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_secretbox/xsalsa20poly1305/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_secretbox/xsalsa20poly1305/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_secretbox/xsalsa20poly1305/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_secretbox/xsalsa20poly1305/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_secretbox/xsalsa20poly1305/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium2/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium2/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium2/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium2/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium3/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium3/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium3/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium3/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium5/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium5/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/dilithium/dilithium5/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/dilithium/dilithium5/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_sign/falcon/falcon512/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_sign/falcon/falcon512/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha12/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha12_amd64_avx_xor_ct : 4 | M.jade_stream_chacha_chacha12_amd64_avx_xor ~ M.jade_stream_chacha_chacha12_amd64_avx_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha12_amd64_avx_ct : 11 | M.jade_stream_chacha_chacha12_amd64_avx ~ M.jade_stream_chacha_chacha12_amd64_avx : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha12/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha12_amd64_avx2_xor_ct : 4 | M.jade_stream_chacha_chacha12_amd64_avx2_xor ~ M.jade_stream_chacha_chacha12_amd64_avx2_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha12_amd64_avx2_ct : 11 | M.jade_stream_chacha_chacha12_amd64_avx2 ~ M.jade_stream_chacha_chacha12_amd64_avx2 : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha12/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha12/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha12_amd64_ref_xor_ct : 4 | M.jade_stream_chacha_chacha12_amd64_ref_xor ~ M.jade_stream_chacha_chacha12_amd64_ref_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha12_amd64_ref_ct : 11 | M.jade_stream_chacha_chacha12_amd64_ref ~ M.jade_stream_chacha_chacha12_amd64_ref : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20-ietf/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20-ietf/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20-ietf/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20-ietf/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20-ietf/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20-ietf/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha20_amd64_avx_xor_ct : 4 | M.jade_stream_chacha_chacha20_amd64_avx_xor ~ M.jade_stream_chacha_chacha20_amd64_avx_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha20_amd64_avx_ct : 11 | M.jade_stream_chacha_chacha20_amd64_avx ~ M.jade_stream_chacha_chacha20_amd64_avx : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha20_amd64_avx2_xor_ct : 4 | M.jade_stream_chacha_chacha20_amd64_avx2_xor ~ M.jade_stream_chacha_chacha20_amd64_avx2_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha20_amd64_avx2_ct : 11 | M.jade_stream_chacha_chacha20_amd64_avx2 ~ M.jade_stream_chacha_chacha20_amd64_avx2 : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/chacha20/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/chacha20/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_chacha_chacha20_amd64_ref_xor_ct : 4 | M.jade_stream_chacha_chacha20_amd64_ref_xor ~ M.jade_stream_chacha_chacha20_amd64_ref_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_chacha_chacha20_amd64_ref_ct : 11 | M.jade_stream_chacha_chacha20_amd64_ref ~ M.jade_stream_chacha_chacha20_amd64_ref : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/common/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/common/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/common/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/common/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/chacha/common/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/chacha/common/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa20/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa20_amd64_avx_xor_ct : 4 | M.jade_stream_salsa20_salsa20_amd64_avx_xor ~ M.jade_stream_salsa20_salsa20_amd64_avx_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa20_amd64_avx_ct : 11 | M.jade_stream_salsa20_salsa20_amd64_avx ~ M.jade_stream_salsa20_salsa20_amd64_avx : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa20/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa20_amd64_avx2_xor_ct : 4 | M.jade_stream_salsa20_salsa20_amd64_avx2_xor ~ M.jade_stream_salsa20_salsa20_amd64_avx2_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa20_amd64_avx2_ct : 11 | M.jade_stream_salsa20_salsa20_amd64_avx2 ~ M.jade_stream_salsa20_salsa20_amd64_avx2 : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa20/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa20/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa20_amd64_ref_xor_ct : 4 | M.jade_stream_salsa20_salsa20_amd64_ref_xor ~ M.jade_stream_salsa20_salsa20_amd64_ref_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa20_amd64_ref_ct : 11 | M.jade_stream_salsa20_salsa20_amd64_ref ~ M.jade_stream_salsa20_salsa20_amd64_ref : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa2012/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa2012_amd64_avx_xor_ct : 4 | M.jade_stream_salsa20_salsa2012_amd64_avx_xor ~ M.jade_stream_salsa20_salsa2012_amd64_avx_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa2012_amd64_avx_ct : 11 | M.jade_stream_salsa20_salsa2012_amd64_avx ~ M.jade_stream_salsa20_salsa2012_amd64_avx : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa2012/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa2012_amd64_avx2_xor_ct : 4 | M.jade_stream_salsa20_salsa2012_amd64_avx2_xor ~ M.jade_stream_salsa20_salsa2012_amd64_avx2_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa2012_amd64_avx2_ct : 11 | M.jade_stream_salsa20_salsa2012_amd64_avx2 ~ M.jade_stream_salsa20_salsa2012_amd64_avx2 : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/salsa20/salsa2012/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/salsa20/salsa2012/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_salsa20_salsa2012_amd64_ref_xor_ct : 4 | M.jade_stream_salsa20_salsa2012_amd64_ref_xor ~ M.jade_stream_salsa20_salsa2012_amd64_ref_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_salsa20_salsa2012_amd64_ref_ct : 11 | M.jade_stream_salsa20_salsa2012_amd64_ref ~ M.jade_stream_salsa20_salsa2012_amd64_ref : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/avx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/xsalsa20/amd64/avx/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/avx/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_xsalsa20_amd64_avx_xor_ct : 4 | M.jade_stream_xsalsa20_amd64_avx_xor ~ M.jade_stream_xsalsa20_amd64_avx_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_xsalsa20_amd64_avx_ct : 11 | M.jade_stream_xsalsa20_amd64_avx ~ M.jade_stream_xsalsa20_amd64_avx : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/xsalsa20/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_xsalsa20_amd64_avx2_xor_ct : 4 | M.jade_stream_xsalsa20_amd64_avx2_xor ~ M.jade_stream_xsalsa20_amd64_avx2_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_xsalsa20_amd64_avx2_ct : 11 | M.jade_stream_xsalsa20_amd64_avx2 ~ M.jade_stream_xsalsa20_amd64_avx2 : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_stream/xsalsa20/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_stream/xsalsa20/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_stream_xsalsa20_amd64_ref_xor_ct : 4 | M.jade_stream_xsalsa20_amd64_ref_xor ~ M.jade_stream_xsalsa20_amd64_ref_xor : 5 | ={output, input, input_length, nonce, key, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | 10 | equiv eq_jade_stream_xsalsa20_amd64_ref_ct : 11 | M.jade_stream_xsalsa20_amd64_ref ~ M.jade_stream_xsalsa20_amd64_ref : 12 | ={stream, stream_length, nonce, key, M.leakages} ==> ={M.leakages}. 13 | proof. 14 | proc; inline *; sim => />. 15 | qed. 16 | -------------------------------------------------------------------------------- /proof/crypto_verify/16/amd64/common/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_verify/16/amd64/common/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake128/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake128_amd64_avx2_ct : 4 | M.jade_xof_shake128_amd64_avx2 ~ M.jade_xof_shake128_amd64_avx2 : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake128/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake128/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake128_amd64_ref_ct : 4 | M.jade_xof_shake128_amd64_ref ~ M.jade_xof_shake128_amd64_ref : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_xof/shake128/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake128/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/avx2/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake256/amd64/avx2/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/avx2/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake256_amd64_avx2_ct : 4 | M.jade_xof_shake256_amd64_avx2 ~ M.jade_xof_shake256_amd64_avx2 : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/bmi1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake256/amd64/bmi1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/ref/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake256/amd64/ref/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/ref/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake256_amd64_ref_ct : 4 | M.jade_xof_shake256_amd64_ref ~ M.jade_xof_shake256_amd64_ref : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/ref1/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake256/amd64/ref1/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/ref1/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake256_amd64_ref1_ct : 4 | M.jade_xof_shake256_amd64_ref1 ~ M.jade_xof_shake256_amd64_ref1 : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/spec/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/formosa-crypto/libjade/e8b300393a16d9364ec3496c6ac8503e74f74307/proof/crypto_xof/shake256/amd64/spec/.gitkeep -------------------------------------------------------------------------------- /proof/crypto_xof/shake256/amd64/spec/extracted_ct_proof.ec: -------------------------------------------------------------------------------- 1 | require import Extracted_ct. 2 | 3 | equiv eq_jade_xof_shake256_amd64_spec_ct : 4 | M.jade_xof_shake256_amd64_spec ~ M.jade_xof_shake256_amd64_spec : 5 | ={output, output_length, input, input_length, M.leakages} ==> ={M.leakages}. 6 | proof. 7 | proc; inline *; sim => />. 8 | qed. 9 | -------------------------------------------------------------------------------- /proof/tests.config: -------------------------------------------------------------------------------- 1 | [default] 2 | bin = easycrypt 3 | args = -timeout 30 -max-provers 2 -p Z3 -p Alt-Ergo 4 | 5 | [test-all] 6 | okdirs = !common !crypto_hash !crypto_kem !crypto_onetimeauth !crypto_scalarmult !crypto_secretbox !crypto_sign !crypto_stream !crypto_verify !crypto_xof 7 | file_exclude = */WArray*.ec */Array*.ec 8 | -------------------------------------------------------------------------------- /scripts/ci/config/easycrypt: -------------------------------------------------------------------------------- 1 | 2b3bbadffa084466fd3450f367b2102e032c1301 2 | -------------------------------------------------------------------------------- /scripts/ci/config/jasmin: -------------------------------------------------------------------------------- 1 | e4640e7dcdb01d1ba63617a5d78456e1209d699c 2 | -------------------------------------------------------------------------------- /scripts/ci/jbcmp0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # how to use jcmp0: 5 | # $ scripts/ci/jcmp baseline.csv input.csv output.csv 6 | # 7 | 8 | baseline="$1" 9 | input="$2" 10 | output="$3" 11 | 12 | paste -d' ' \ 13 | <(cat $baseline) \ 14 | <(cat $input) \ 15 | | awk '{printf "%ld,%ld,%.03f\n", $1, $2, (($2*100.0/$1)-100.0)}' > $output 16 | 17 | cat $output | \ 18 | awk 'BEGIN { FS = ","; sum = 0; } ; { sum+=$3; } ; END { print sum / NR }' > ${output/.csv/.avg} 19 | -------------------------------------------------------------------------------- /scripts/ci/jbcmp1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # how to use jcmp1: 5 | # $ scripts/ci/jcmp baseline.csv input.csv output.csv 6 | # 7 | 8 | baseline="$1" 9 | input="$2" 10 | output="$3" 11 | filter="$4" 12 | 13 | paste -d' ' \ 14 | <(cat $baseline | cut -d',' -f1 | sed -e 's/^ //') \ 15 | <(cat $baseline | cut -d',' -f2 | sed -e 's/^ //') \ 16 | <(cat $input | cut -d',' -f2 | sed -e 's/^ //') \ 17 | | awk '{printf "%ld,%ld,%ld,%.02f\n", $1, $2, $3, (($3*100/$2)-100)}' | grep -E ${filter} > $output 18 | 19 | cat $output | \ 20 | awk 'BEGIN { FS = ","; sum = 0; } ; { sum+=$4; } ; END { print sum / NR }' > ${output/.csv/.avg} 21 | -------------------------------------------------------------------------------- /scripts/ci/jbcmp2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # how to use jcmp2: 5 | # $ scripts/ci/jcmp baseline.csv input.csv output.csv 6 | # 7 | 8 | baseline="$1" 9 | input="$2" 10 | output="$3" 11 | filter="$4" 12 | 13 | paste -d' ' \ 14 | <(cat $baseline | cut -d',' -f1 | sed -e 's/^ //') \ 15 | <(cat $baseline | cut -d',' -f2 | sed -e 's/^ //') \ 16 | <(cat $baseline | cut -d',' -f3 | sed -e 's/^ //') \ 17 | <(cat $input | cut -d',' -f3 | sed -e 's/^ //') \ 18 | | awk '{printf "%ld,%ld,%ld,%ld,%.02f\n", $1, $2, $3, $4, (($4*100/$3)-100)}' | grep -E ${filter} > $output 19 | 20 | cat $output | \ 21 | awk 'BEGIN { FS = ","; sum = 0; } ; { sum+=$5; } ; END { print sum / NR }' > ${output/.csv/.avg} 22 | -------------------------------------------------------------------------------- /scripts/ci/jbench: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #set -x #verbose 4 | 5 | top=$(cd "$(dirname "$0")/../../" ; pwd -P) 6 | src=$top/src 7 | bench=$top/bench/bin 8 | op=$1 9 | tag1=$2 10 | 11 | if [ "$op" = "store" ] 12 | then 13 | csv=$(find $bench -type f -name "*.csv") 14 | for f in $csv; do 15 | fd=$(dirname $f) 16 | fn=$(basename $f .csv) 17 | mv $f $fd/$fn.$tag1.csv 18 | done 19 | exit 0; 20 | fi 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /scripts/ci/jproof: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd "$(dirname "$0")" && sh jlog "*.ec" 4 | -------------------------------------------------------------------------------- /scripts/ci/jsrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd "$(dirname "$0")" && sh jlog "*.s" 4 | -------------------------------------------------------------------------------- /scripts/ci/jtiming: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # how to use jtiming: 4 | # $ scripts/ci/jtiming 5 | # 6 | # $ or... 7 | # 8 | # $ cd src; (export JASMIN=__PATH_TO_THE_JASMIN_COMPILER__ && ./../scripts/ci/jtiming) 9 | 10 | top=$(cd "$(dirname "$0")/../../" ; pwd -P) 11 | tmp=$(mktemp) 12 | TIME="${TIME:-"/usr/bin/time"}" 13 | 14 | find $top/src -name "*.jazz" -printf "%h\n" | sort -u | \ 15 | while read dir; 16 | do 17 | echo -n "$dir,"; 18 | cd $dir; 19 | make clean CI=1; 20 | ($TIME --quiet -f'%U' sh -c "make CI=1 2> /dev/null" 2> $tmp) || (echo "NaN" > $tmp); 21 | cat $tmp; 22 | done 23 | 24 | -------------------------------------------------------------------------------- /scripts/ci/misc/jasmin-build-instructions0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git clone https://github.com/jasmin-lang/jasmin.git 4 | cd jasmin/ 5 | git fetch -a 6 | git checkout main 7 | nix-channel --update 8 | nix-shell --command "cd compiler && make CIL" 9 | cd compiler/ 10 | nix-shell --command "NIX_CFLAGS_COMPILE=\"$NIX_CFLAGS_COMPILE --sysroot=/\" && make" 11 | ./jasminc -help 12 | -------------------------------------------------------------------------------- /scripts/ci/misc/jasmin-build-instructions1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | git clone https://gitlab.com/jasmin-lang/jasmin-compiler.git 4 | cd jasmin-compiler/compiler 5 | git fetch -a 6 | git checkout main 7 | nix-channel --update 8 | nix-shell --command "NIX_CFLAGS_COMPILE=\"$NIX_CFLAGS_COMPILE --sysroot=/\"; make" 9 | ./jasminc -help 10 | -------------------------------------------------------------------------------- /scripts/ci/releaser/jdist-proof: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | name=libjade-dist-proof 4 | 5 | top=$(cd "$(dirname "$0")/../../../" ; pwd -P) 6 | proof=$top/proof 7 | dist=$top/$name; 8 | jade=$dist/jade 9 | 10 | # create distribution directory 11 | rm -fr $dist 12 | mkdir -p $jade; 13 | 14 | # copy ec files 15 | find $proof -name "*.ec" -exec dirname {} \; | sort -u | \ 16 | while read ecdir; 17 | do 18 | decdir=${ecdir/$proof/$jade}; 19 | mkdir -p $decdir; 20 | cp $ecdir/* $decdir; 21 | done 22 | 23 | # copy tests.config 24 | cp $proof/tests.config $jade/ 25 | 26 | # rm hidden files, compress, and delete dist directory 27 | find $dist -type f -name ".*" -exec rm {} \; 28 | (cd $top/ && tar -zcvf $name.tar.gz $name/) 29 | rm -fr $dist 30 | 31 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | __pycache__ 3 | -------------------------------------------------------------------------------- /test/common/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | // 5 | 6 | #ifndef MININBYTES 7 | #define MININBYTES 0 8 | #endif 9 | 10 | #ifndef MAXINBYTES 11 | #define MAXINBYTES 4196 12 | #endif 13 | 14 | #ifndef MINOUTBYTES 15 | #define MINOUTBYTES 0 16 | #endif 17 | 18 | #ifndef MAXOUTBYTES 19 | #define MAXOUTBYTES 128 20 | #endif 21 | 22 | // 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /test/common/namespace.h: -------------------------------------------------------------------------------- 1 | 2 | // https://stackoverflow.com/a/1489985/1711232 3 | #define PASTER(x, y) x##_##y 4 | #define EVALUATOR(x, y) PASTER(x, y) 5 | #define NAMESPACE(fun) EVALUATOR(JADE_NAMESPACE, fun) 6 | #define NAMESPACE_LC(fun) EVALUATOR(JADE_NAMESPACE_LC, fun) 7 | 8 | // https://stackoverflow.com/a/55243651/248065 9 | #define MY_TRUTHY_VALUE_X 1 10 | #define CAT(x,y) CAT_(x,y) 11 | #define CAT_(x,y) x##y 12 | #define HAS_NAMESPACE(x) CAT(CAT(MY_TRUTHY_VALUE_,CAT(JADE_NAMESPACE,CAT(_,x))),X) 13 | 14 | #if !HAS_NAMESPACE(API_H) 15 | #error "namespace not properly defined for header guard" 16 | #endif 17 | -------------------------------------------------------------------------------- /test/common/print.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_COMMON_PRINT_H 2 | #define TEST_COMMON_PRINT_H 3 | 4 | #include 5 | 6 | void print_info(const char *algname, const char *arch, const char *impl); 7 | void print_u8(const uint8_t *a, size_t l); 8 | void print_u8s(const uint8_t *a, size_t l); 9 | void print_str_u8(const char *str, const uint8_t *a, size_t l); 10 | void print_str_c_u8(const char *str, uint64_t c, const uint8_t *a, size_t l); 11 | void print_str_c_c_u8(const char *str, uint64_t c1, uint64_t c2, const uint8_t *a, size_t l); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /test/common/print_dist.c: -------------------------------------------------------------------------------- 1 | static void print_info(const char *algname, const char *arch, const char *impl) 2 | { 3 | printf("// {\"%s\" : { architecture : \"%s\", implementation : \"%s\"} }", 4 | algname, arch, impl); 5 | printf("\n"); 6 | } 7 | 8 | static void print_u8(const uint8_t *a, size_t l) 9 | { 10 | size_t i; 11 | 12 | if(l == 0) 13 | { return; } 14 | 15 | printf("{\n "); 16 | for(i=0; i<(l-1); i++) 17 | { printf("0x%02" PRIx8 ", ", a[i]); 18 | if((i+1)%16 == 0) 19 | { printf("\n "); } 20 | } 21 | 22 | printf("0x%02" PRIx8 "\n};\n", a[i]); 23 | return; 24 | } 25 | 26 | static void print_str_u8(const char *str, const uint8_t *a, size_t l) 27 | { 28 | if( l == 0 ) 29 | { printf("uint8_t *%s = NULL;\n", str); 30 | return; 31 | } 32 | 33 | printf("uint8_t %s[%zu] = ",str, l); 34 | print_u8(a, l); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /test/common/randombytes.h: -------------------------------------------------------------------------------- 1 | #ifndef NOTRANDOMBYTES_H 2 | #define NOTRANDOMBYTES_H 3 | 4 | #include 5 | 6 | void resetrandombytes(void); 7 | void randombytes(uint8_t* x, uint64_t xlen); 8 | 9 | void resetrandombytes1(void); 10 | void randombytes1(uint8_t* x, uint64_t xlen); 11 | 12 | // 13 | 14 | uint8_t* __jasmin_syscall_randombytes__(uint8_t* _x, uint64_t xlen) __asm__("__jasmin_syscall_randombytes__"); 15 | 16 | 17 | #endif 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/common/try-anything.h: -------------------------------------------------------------------------------- 1 | #ifndef TRY_ANYTHING 2 | #define TRY_ANYTHING 3 | 4 | uint8_t* alignedcalloc(void**, uint64_t); 5 | unsigned long long myrandom(void); 6 | void double_canary(uint8_t*, uint8_t*, uint64_t); 7 | void input_prepare(uint8_t*, uint8_t*, uint64_t); 8 | void output_prepare(uint8_t*, uint8_t*, uint64_t); 9 | void output_compare(const uint8_t*, const uint8_t*, uint64_t, const char*); 10 | void input_compare(const uint8_t*, const uint8_t*, uint64_t, const char *); 11 | void fail(const char *); 12 | void checksum(uint8_t*, uint8_t*, uint64_t); 13 | int try_anything_main(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /test/crypto_hash/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_hash/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_hash/functest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "api.h" 8 | 9 | #include "jade_hash.h" 10 | #include "print.h" 11 | 12 | int main(void) 13 | { 14 | int r; 15 | uint8_t hash[JADE_HASH_BYTES]; 16 | uint8_t input[] = {0x61, 0x62, 0x63}; 17 | 18 | // 19 | r = jade_hash(hash, input, sizeof(input)); 20 | assert(r == 0); 21 | 22 | print_info(JADE_HASH_ALGNAME, JADE_HASH_ARCH, JADE_HASH_IMPL); 23 | print_str_u8("input", input, sizeof(input)); 24 | print_str_u8("hash", hash, JADE_HASH_BYTES); 25 | 26 | return 0; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /test/crypto_hash/memory.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "api.h" 7 | #include "namespace.h" 8 | #include "jade_hash.h" 9 | #include "config.h" 10 | 11 | /* 12 | int jade_hash( 13 | uint8_t *hash, 14 | const uint8_t *input, 15 | uint64_t input_length 16 | ); 17 | */ 18 | 19 | 20 | int main(void) 21 | { 22 | uint8_t *hash; 23 | uint8_t *input; 24 | uint64_t input_length; 25 | 26 | hash = malloc(sizeof(uint8_t) * JADE_HASH_BYTES); 27 | 28 | for (input_length = MININBYTES; input_length <= MAXINBYTES; input_length++) 29 | { 30 | input = malloc(sizeof(uint8_t) * input_length); 31 | memset(input, 0, sizeof(uint8_t) * input_length); 32 | 33 | jade_hash(hash, input, input_length); 34 | 35 | free(input); 36 | input = NULL; 37 | } 38 | 39 | free(hash); 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /test/crypto_hash/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_hash.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_HASH_ALGNAME\": \"%s\",\n", JADE_HASH_ALGNAME); 11 | printf(" \"JADE_HASH_ARCH\": \"%s\",\n", JADE_HASH_ARCH); 12 | printf(" \"JADE_HASH_IMPL\": \"%s\"", JADE_HASH_IMPL); 13 | 14 | printf(" \"JADE_HASH_BYTES\": %u,\n", JADE_HASH_BYTES); 15 | 16 | printf("\n}\n"); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/crypto_hash/safetyparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "files.c" 5 | 6 | #include "api.h" 7 | #include "jade_hash.h" 8 | 9 | /* 10 | int jade_hash( 11 | uint8_t *hash, 12 | const uint8_t *input, 13 | uint64_t input_length 14 | ); 15 | */ 16 | 17 | int main(void) 18 | { 19 | char *functions[1] = {xstr(jade_hash,)}; 20 | 21 | char *filenames[2] 22 | = { "hash.safetyparam", 23 | xstr(jade_hash,.safetyparam) 24 | }; 25 | 26 | FILE *files[2]; 27 | 28 | f_map_fopen_write(files, filenames, 2); 29 | 30 | // 31 | f_fprintf2(files[0], files[1], "-safetyparam \""); 32 | 33 | f_fprintf2(files[0], files[1], "%s>hash,input;%zu,input_length", 34 | functions[0], (size_t)JADE_HASH_BYTES); 35 | 36 | f_fprintf2(files[0], files[1], "\""); 37 | 38 | f_map_fclose(files, 2); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /test/crypto_kem/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_kem/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_kem/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_kem.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_KEM_ALGNAME\": \"%s\",\n", JADE_KEM_ALGNAME); 11 | printf(" \"JADE_KEM_ARCH\": \"%s\",\n", JADE_KEM_ARCH); 12 | printf(" \"JADE_KEM_IMPL\": \"%s\",\n", JADE_KEM_IMPL); 13 | 14 | printf(" \"JADE_KEM_SECRETKEYBYTES\": %u,\n", JADE_KEM_SECRETKEYBYTES); 15 | printf(" \"JADE_KEM_PUBLICKEYBYTES\": %u,\n", JADE_KEM_PUBLICKEYBYTES); 16 | printf(" \"JADE_KEM_CIPHERTEXTBYTES\": %u,\n", JADE_KEM_CIPHERTEXTBYTES); 17 | 18 | printf(" \"JADE_KEM_KEYPAIRCOINBYTES\": %u,\n", JADE_KEM_KEYPAIRCOINBYTES); 19 | printf(" \"JADE_KEM_ENCCOINBYTES\": %u,\n", JADE_KEM_ENCCOINBYTES); 20 | 21 | printf(" \"JADE_KEM_BYTES\": %u", JADE_KEM_BYTES); 22 | 23 | printf("\n}\n"); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /test/crypto_onetimeauth/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_onetimeauth/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_onetimeauth/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_onetimeauth.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_ONETIMEAUTH_ALGNAME\": \"%s\",\n", JADE_ONETIMEAUTH_ALGNAME); 11 | printf(" \"JADE_ONETIMEAUTH_ARCH\": \"%s\",\n", JADE_ONETIMEAUTH_ARCH); 12 | printf(" \"JADE_ONETIMEAUTH_IMPL\": \"%s\"", JADE_ONETIMEAUTH_IMPL); 13 | 14 | printf(" \"JADE_ONETIMEAUTH_BYTES\": %u,\n", JADE_ONETIMEAUTH_BYTES); 15 | printf(" \"JADE_ONETIMEAUTH_KEYBYTES\": %u,\n", JADE_ONETIMEAUTH_KEYBYTES); 16 | 17 | printf("\n}\n"); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/crypto_scalarmult/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_scalarmult/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_scalarmult/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_scalarmult.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_SCALARMULT_ALGNAME\": \"%s\",\n", JADE_SCALARMULT_ALGNAME); 11 | printf(" \"JADE_SCALARMULT_ARCH\": \"%s\",\n", JADE_SCALARMULT_ARCH); 12 | printf(" \"JADE_SCALARMULT_IMPL\": \"%s\"", JADE_SCALARMULT_IMPL); 13 | 14 | printf(" \"JADE_SCALARMULT_BYTES\": %u,\n", JADE_SCALARMULT_BYTES); 15 | printf(" \"JADE_SCALARMULT_SCALARBYTES\": %u,\n", JADE_SCALARMULT_SCALARBYTES); 16 | 17 | printf("\n}\n"); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/crypto_secretbox/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_secretbox/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_secretbox/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_secretbox.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_SECRETBOX_ALGNAME\": \"%s\",\n", JADE_SECRETBOX_ALGNAME); 11 | printf(" \"JADE_SECRETBOX_ARCH\": \"%s\",\n", JADE_SECRETBOX_ARCH); 12 | printf(" \"JADE_SECRETBOX_IMPL\": \"%s\"", JADE_SECRETBOX_IMPL); 13 | 14 | printf(" \"JADE_SECRETBOX_NONCEBYTES\": %u,\n", JADE_SECRETBOX_NONCEBYTES); 15 | printf(" \"JADE_SECRETBOX_KEYBYTES\": %u,\n", JADE_SECRETBOX_KEYBYTES); 16 | printf(" \"JADE_SECRETBOX_ZEROBYTES\": %u,\n", JADE_SECRETBOX_ZEROBYTES); 17 | printf(" \"JADE_SECRETBOX_BOXZEROBYTES\": %u,\n", JADE_SECRETBOX_BOXZEROBYTES); 18 | 19 | printf("\n}\n"); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /test/crypto_sign/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_sign/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_sign/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_sign.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_SIGN_ALGNAME\": \"%s\",\n", JADE_SIGN_ALGNAME); 11 | printf(" \"JADE_SIGN_ARCH\": \"%s\",\n", JADE_SIGN_ARCH); 12 | printf(" \"JADE_SIGN_IMPL\": \"%s\"", JADE_SIGN_IMPL); 13 | 14 | printf(" \"JADE_SIGN_SECRETKEYBYTES\": %u,\n", JADE_SIGN_SECRETKEYBYTES); 15 | printf(" \"JADE_SIGN_PUBLICKEYBYTES\": %u,\n", JADE_SIGN_PUBLICKEYBYTES); 16 | printf(" \"JADE_SIGN_BYTES\": %u,\n", JADE_SIGN_BYTES); 17 | 18 | printf("\n}\n"); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test/crypto_stream/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_stream/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_stream/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_stream.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_STREAM_ALGNAME\": \"%s\",\n", JADE_STREAM_ALGNAME); 11 | printf(" \"JADE_STREAM_ARCH\": \"%s\",\n", JADE_STREAM_ARCH); 12 | printf(" \"JADE_STREAM_IMPL\": \"%s\"", JADE_STREAM_IMPL); 13 | 14 | printf(" \"JADE_STREAM_NONCEBYTES\": %u,\n", JADE_STREAM_NONCEBYTES); 15 | printf(" \"JADE_STREAM_KEYBYTES\": %u,\n", JADE_STREAM_KEYBYTES); 16 | 17 | printf("\n}\n"); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /test/crypto_xof/checksumbig.c: -------------------------------------------------------------------------------- 1 | #include "checksums.c" 2 | -------------------------------------------------------------------------------- /test/crypto_xof/checksumsmall.c: -------------------------------------------------------------------------------- 1 | #define SMALL 2 | #include "checksums.c" 3 | -------------------------------------------------------------------------------- /test/crypto_xof/functest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "api.h" 8 | 9 | #include "jade_xof.h" 10 | #include "print.h" 11 | 12 | int main(void) 13 | { 14 | int r; 15 | 16 | #define INPUT_LENGTH 3 17 | #define OUTPUT_LENGTH 12 18 | uint8_t input[INPUT_LENGTH] = {0x61, 0x62, 0x63}; 19 | uint8_t output[OUTPUT_LENGTH]; 20 | 21 | // 22 | r = jade_xof(output, OUTPUT_LENGTH, input, INPUT_LENGTH); 23 | assert(r == 0); 24 | 25 | print_info(JADE_XOF_ALGNAME, JADE_XOF_ARCH, JADE_XOF_IMPL); 26 | print_str_u8("input", input, INPUT_LENGTH); 27 | print_str_u8("output", output, OUTPUT_LENGTH); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /test/crypto_xof/printparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "api.h" 4 | #include "jade_xof.h" 5 | 6 | int main(void) 7 | { 8 | printf("{\n"); 9 | 10 | printf(" \"JADE_XOF_ALGNAME\": \"%s\",\n", JADE_XOF_ALGNAME); 11 | printf(" \"JADE_XOF_ARCH\": \"%s\",\n", JADE_XOF_ARCH); 12 | printf(" \"JADE_XOF_IMPL\": \"%s\"", JADE_XOF_IMPL); 13 | 14 | printf("\n}\n"); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/crypto_xof/safetyparams.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "files.c" 4 | 5 | #include "api.h" 6 | #include "jade_xof.h" 7 | 8 | /* 9 | int jade_xof( 10 | uint8_t *output, 11 | uint64_t output_length, 12 | const uint8_t *input, 13 | uint64_t input_length 14 | ); 15 | */ 16 | 17 | int main(void) 18 | { 19 | char *functions[1] = {xstr(jade_xof,)}; 20 | 21 | char *filenames[2] 22 | = { "xof.safetyparam", 23 | xstr(jade_xof,.safetyparam) 24 | }; 25 | 26 | FILE *files[2]; 27 | 28 | f_map_fopen_write(files, filenames, 2); 29 | 30 | // 31 | f_fprintf2(files[0], files[1], "-safetyparam \""); 32 | 33 | f_fprintf2(files[0], files[1], "%s>output,input;output_length,input_length", 34 | functions[0]); 35 | 36 | f_fprintf2(files[0], files[1], "\""); 37 | 38 | f_map_fclose(files, 2); 39 | 40 | return 0; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /test/external/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | -------------------------------------------------------------------------------- /test/external/crypto_sign/falcon/falcon512/amd64/avx2/Makefile: -------------------------------------------------------------------------------- 1 | CC ?= clang 2 | CFLAGS = -mtune=native -march=native -O3 -mavx2 3 | CFLAGS += -Wall -Wextra -Wpedantic -Wredundant-decls \ 4 | -Wshadow -Wpointer-arith -fomit-frame-pointer 5 | 6 | 7 | HEADERs := api.h fpr.h inner.h 8 | SOURCEs := codec.c common.c fft.c fpr.c keygen.c nist.c rng.c shake.c sign.c vrfy.c 9 | OBJs := $(SOURCEs:%.c=%.o) 10 | 11 | LIB := external_crypto_sign_falcon_falcon512_amd64_avx2.a 12 | 13 | #-- 14 | default: $(LIB) 15 | 16 | %.o: %.c 17 | $(CC) $(CFLAGS) -c -o $@ $< 18 | 19 | $(LIB): $(OBJs) 20 | ar -rc $@ $(OBJs) 21 | ranlib $@ 22 | 23 | .PHONY: clean 24 | clean: 25 | rm -rf $(OBJs) 26 | rm -rf $(LIB) 27 | -------------------------------------------------------------------------------- /test/external/crypto_sign/falcon/falcon512/amd64/avx2/api.h: -------------------------------------------------------------------------------- 1 | #define CRYPTO_SECRETKEYBYTES 1281 2 | #define CRYPTO_PUBLICKEYBYTES 897 3 | #define CRYPTO_BYTES 690 4 | -------------------------------------------------------------------------------- /test/include/jade_hash.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_HASH_API_H 2 | #define JADE_HASH_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_HASH_BYTES NAMESPACE(BYTES) 7 | 8 | #define jade_hash JADE_NAMESPACE_LC 9 | 10 | #define JADE_HASH_ALGNAME NAMESPACE(ALGNAME) 11 | #define JADE_HASH_ARCH NAMESPACE(ARCH) 12 | #define JADE_HASH_IMPL NAMESPACE(IMPL) 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /test/include/jade_kem.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_KEM_API_H 2 | #define JADE_KEM_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_KEM_SECRETKEYBYTES NAMESPACE(SECRETKEYBYTES) 7 | #define JADE_KEM_PUBLICKEYBYTES NAMESPACE(PUBLICKEYBYTES) 8 | #define JADE_KEM_CIPHERTEXTBYTES NAMESPACE(CIPHERTEXTBYTES) 9 | #define JADE_KEM_KEYPAIRCOINBYTES NAMESPACE(KEYPAIRCOINBYTES) 10 | #define JADE_KEM_ENCCOINBYTES NAMESPACE(ENCCOINBYTES) 11 | #define JADE_KEM_BYTES NAMESPACE(BYTES) 12 | 13 | #define jade_kem_keypair NAMESPACE_LC(keypair) 14 | #define jade_kem_enc NAMESPACE_LC(enc) 15 | #define jade_kem_dec NAMESPACE_LC(dec) 16 | 17 | #define jade_kem_keypair_derand NAMESPACE_LC(keypair_derand) 18 | #define jade_kem_enc_derand NAMESPACE_LC(enc_derand) 19 | 20 | #define JADE_KEM_ALGNAME NAMESPACE(ALGNAME) 21 | #define JADE_KEM_ARCH NAMESPACE(ARCH) 22 | #define JADE_KEM_IMPL NAMESPACE(IMPL) 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /test/include/jade_onetimeauth.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_ONETIMEAUTH_API_H 2 | #define JADE_ONETIMEAUTH_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_ONETIMEAUTH_BYTES NAMESPACE(BYTES) 7 | #define JADE_ONETIMEAUTH_KEYBYTES NAMESPACE(KEYBYTES) 8 | 9 | #define jade_onetimeauth_verify NAMESPACE_LC(verify) 10 | #define jade_onetimeauth JADE_NAMESPACE_LC 11 | 12 | #define JADE_ONETIMEAUTH_ALGNAME NAMESPACE(ALGNAME) 13 | #define JADE_ONETIMEAUTH_ARCH NAMESPACE(ARCH) 14 | #define JADE_ONETIMEAUTH_IMPL NAMESPACE(IMPL) 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /test/include/jade_scalarmult.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SCALARMULT_API_H 2 | #define JADE_SCALARMULT_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_SCALARMULT_BYTES NAMESPACE(BYTES) 7 | #define JADE_SCALARMULT_SCALARBYTES NAMESPACE(SCALARBYTES) 8 | 9 | #define jade_scalarmult JADE_NAMESPACE_LC 10 | #define jade_scalarmult_base NAMESPACE_LC(base) 11 | 12 | #define JADE_SCALARMULT_ALGNAME NAMESPACE(ALGNAME) 13 | #define JADE_SCALARMULT_ARCH NAMESPACE(ARCH) 14 | #define JADE_SCALARMULT_IMPL NAMESPACE(IMPL) 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /test/include/jade_secretbox.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SECRETBOX_API_H 2 | #define JADE_SECRETBOX_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_SECRETBOX_KEYBYTES NAMESPACE(KEYBYTES) 7 | #define JADE_SECRETBOX_NONCEBYTES NAMESPACE(NONCEBYTES) 8 | #define JADE_SECRETBOX_ZEROBYTES NAMESPACE(ZEROBYTES) 9 | #define JADE_SECRETBOX_BOXZEROBYTES NAMESPACE(BOXZEROBYTES) 10 | 11 | #define jade_secretbox_open NAMESPACE_LC(open) 12 | #define jade_secretbox JADE_NAMESPACE_LC 13 | 14 | #define JADE_SECRETBOX_ALGNAME NAMESPACE(ALGNAME) 15 | #define JADE_SECRETBOX_ARCH NAMESPACE(ARCH) 16 | #define JADE_SECRETBOX_IMPL NAMESPACE(IMPL) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /test/include/jade_sign.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_SIGN_API_H 2 | #define JADE_SIGN_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_SIGN_PUBLICKEYBYTES NAMESPACE(PUBLICKEYBYTES) 7 | #define JADE_SIGN_SECRETKEYBYTES NAMESPACE(SECRETKEYBYTES) 8 | #define JADE_SIGN_BYTES NAMESPACE(BYTES) 9 | #define JADE_SIGN_DETERMINISTIC NAMESPACE(DETERMINISTIC) 10 | 11 | #define jade_sign_keypair NAMESPACE_LC(keypair) 12 | #define jade_sign JADE_NAMESPACE_LC 13 | #define jade_sign_open NAMESPACE_LC(open) 14 | 15 | #define JADE_SIGN_ALGNAME NAMESPACE(ALGNAME) 16 | #define JADE_SIGN_ARCH NAMESPACE(ARCH) 17 | #define JADE_SIGN_IMPL NAMESPACE(IMPL) 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /test/include/jade_stream.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_STREAM_API_H 2 | #define JADE_STREAM_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define JADE_STREAM_KEYBYTES NAMESPACE(KEYBYTES) 7 | #define JADE_STREAM_NONCEBYTES NAMESPACE(NONCEBYTES) 8 | 9 | #define jade_stream_xor NAMESPACE_LC(xor) 10 | #define jade_stream JADE_NAMESPACE_LC 11 | 12 | #define JADE_STREAM_ALGNAME NAMESPACE(ALGNAME) 13 | #define JADE_STREAM_ARCH NAMESPACE(ARCH) 14 | #define JADE_STREAM_IMPL NAMESPACE(IMPL) 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /test/include/jade_xof.h: -------------------------------------------------------------------------------- 1 | #ifndef JADE_XOF_API_H 2 | #define JADE_XOF_API_H 3 | 4 | #include "namespace.h" 5 | 6 | #define jade_xof JADE_NAMESPACE_LC 7 | 8 | #define JADE_XOF_ALGNAME NAMESPACE(ALGNAME) 9 | #define JADE_XOF_ARCH NAMESPACE(ARCH) 10 | #define JADE_XOF_IMPL NAMESPACE(IMPL) 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /test/include/namespace.h: -------------------------------------------------------------------------------- 1 | #define PASTER(x, y) x##_##y 2 | #define EVALUATOR(x, y) PASTER(x, y) 3 | #define NAMESPACE(fun) EVALUATOR(JADE_NAMESPACE, fun) 4 | #define NAMESPACE_LC(fun) EVALUATOR(JADE_NAMESPACE_LC, fun) 5 | 6 | #define MY_TRUTHY_VALUE_X 1 7 | #define CAT(x,y) CAT_(x,y) 8 | #define CAT_(x,y) x##y 9 | #define HAS_NAMESPACE(x) CAT(CAT(MY_TRUTHY_VALUE_,CAT(JADE_NAMESPACE,CAT(_,x))),X) 10 | 11 | #if !HAS_NAMESPACE(API_H) 12 | #error "namespace not properly defined for header guard" 13 | #endif 14 | 15 | #define xstr(s,e) str(s)#e 16 | #define str(s) #s 17 | -------------------------------------------------------------------------------- /test/include/namespace_dist.h: -------------------------------------------------------------------------------- 1 | #define PASTER(x, y) x##_##y 2 | #define EVALUATOR(x, y) PASTER(x, y) 3 | #define NAMESPACE(fun) EVALUATOR(JADE_NAMESPACE, fun) 4 | #define NAMESPACE_LC(fun) EVALUATOR(JADE_NAMESPACE_LC, fun) 5 | --------------------------------------------------------------------------------