diff --git a/README.md b/README.md index f7e26147..81bde937 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,8 @@ following assume that `jasminc` is available in a directory that is in `$PATH`. ## API documentation + ## Future plans diff --git a/doc/release/README.md b/doc/release/README.md index bb969447..783e1017 100644 --- a/doc/release/README.md +++ b/doc/release/README.md @@ -6,7 +6,7 @@ In folder `libjade` you can find the compiled (AT&T assembly syntax) Jasmin implementations of [libjade](https://github.com/formosa-crypto/libjade) for the amd64 architecture and System V ABI (Linux, macOS, or Unix in general). -We also provide quick-to-use examples that should be easy to compile, inspect, and change to explore the API if you want to. Next, we briefly overview the contents of this distribution package. Later we detail the API of the available Jasmin cryptographic operations in libjade. +We also provide quick-to-use examples that should be easy to compile, inspect, and change to explore the API if you want to. Next, we briefly overview the contents of this distribution package. Implementations are organized by cryptographic operations. For instance, in folder `libjade/crypto_kem/` you can find Kyber implementations and in `libjade/crypto_sign` Dilithium implementations. @@ -22,7 +22,7 @@ As an example, in `libjade/crypto_kem/kyber` you can find the following 3 files: * `kyber768_amd64_avx2.s` * `kyber768_amd64_avx2.h` -`kyber768_amd64_avx2.jazz` contains an implementation of Kyber768. `kyber768_amd64_avx2.s` is the result of compiling `kyber768_amd64_avx2.jazz` with the Jasmin compiler version 2022.09.0 — for more information about installing the Jasmin compiler to compile the Jasmin files yourself check section [Compiling Jasmin code yourself](#compiling-jasmin-code-yourself). `kyber768_amd64_avx2.h` defines the functions prototypes and macros that specify, for instance, the length in bytes of public and secret keys: +`kyber768_amd64_avx2.jazz` contains an implementation of Kyber768. `kyber768_amd64_avx2.s` is the result of compiling `kyber768_amd64_avx2.jazz` with the latest Jasmin compiler version from main— for more information about installing the Jasmin compiler to compile the Jasmin files yourself check section [Compiling Jasmin code yourself](#compiling-jasmin-code-yourself). `kyber768_amd64_avx2.h` defines the functions prototypes and macros that specify, for instance, the length in bytes of public and secret keys: ``` #ifndef JADE_KEM_KYBER_KYBER768_AMD64_AVX2_API_H @@ -79,11 +79,11 @@ $ ./jade_hash_sha256_amd64_ref $ echo -n "abc" | sha256sum ``` -Feel free to perform your own experiments and provide feedback. +Feel free to perform your own experiments and provide [feedback](https://github.com/formosa-crypto/libjade/issues). ## Compiling Jasmin code yourself. -We release single-file-Jasmin-implementations for users who wish to (quickly) recompile the assembly files and/or get acquainted with Jasmin programming language and/or want to do some experiments. If you visit the [libjade](https://github.com/formosa-crypto/libjade/) GitHub repository, you may find that the source code is organized differently, mainly to promote code reusability. In this context, we are interested in easy reproducibility. +We release single-file-Jasmin-implementations for users who wish to (quickly) recompile the assembly files and/or get acquainted with the Jasmin programming language and/or want to do some experiments. If you visit the [libjade](https://github.com/formosa-crypto/libjade/) GitHub repository, you may find that the source code is organized differently, mainly to promote code reusability. In this context, we are interested in easy reproducibility. To compile the available Jasmin files (`.jazz`), you need to get the Jasmin compiler (jasminc should be available in your PATH, or you can set a variable named JASMIN with the path to your compiler). @@ -91,12 +91,12 @@ To get Jasmin, you can check the following instructions: * https://github.com/jasmin-lang/jasmin/wiki/Installation-instructions * https://github.com/formosa-crypto/libjade/blob/main/README.md#obtaining-and-building-the-jasmin-compiler -To recompile Kyber768 AVX2 implementation, run the following: +As an example, to recompile Kyber768 AVX2 implementation, run the following commands: ``` $ cd libjade/crypto_kem/kyber $ touch kyber768_amd64_avx2.jazz $ make kyber768_amd64_avx2.s ``` -The `touch` might be needed to avoid `make: 'kyber768_amd64_avx2.s' is up to date.`. +The `touch` might be needed to avoid `make: 'kyber768_amd64_avx2.s' is up to date.`. Alternatively, you can run `make clean && make all` to recompile all implementations under `libjade/crypto_kem/kyber`. diff --git a/scripts/ci/releaser/jdist-src b/scripts/ci/releaser/jdist-src index 8f2b0bc1..7ca1d647 100755 --- a/scripts/ci/releaser/jdist-src +++ b/scripts/ci/releaser/jdist-src @@ -25,7 +25,7 @@ cp $top/LICENSE $dist/LICENSE # --------------------------------------------------------- # copy assembly, header, and preprocessed files; -find $src -name "*.s" | \ +find $src -name "*.s" | sort | \ while read asm do dir=$(dirname $asm) @@ -60,7 +60,9 @@ do if ! [ -f $makefile ]; then echo "JASMIN ?= jasminc" > $makefile - echo -e "JFLAGS ?=\n" >> $makefile + echo -e "override JFLAGS += -nowarning\n" >> $makefile + echo -e "default: all\n" >> $makefile + fi echo "$(basename $dasm): $(basename $djazz)" >> $makefile @@ -72,14 +74,13 @@ done while read makefile do mkdir=$(dirname $makefile) - target_list=$(find $mkdir -maxdepth 1 -name "*.s" | while read file; do echo $(basename $file); done | xargs); + target_list=$(find $mkdir -maxdepth 1 -name "*.s" | while read file; do echo $(basename $file); done | sort | xargs); cat <> $makefile ALL := $target_list -.PHONY: \$(ALL) clean - all: \$(ALL) +.PHONY: clean clean: rm -f \$(ALL) END @@ -152,6 +153,8 @@ cat <> $makefile INCLUDE := -I$relative/examples/include -I$relative/examples/common -I$relative/libjade/ DEPENDENCIES := $relative/ext/randombytes/randombytes.o $relative/examples/common/print.c +default: all + $relative/ext/randombytes/randombytes.o: $relative/ext/randombytes/randombytes.c make -C $relative/ext/randombytes/