Skip to content

Commit

Permalink
preparing for release 2022 12
Browse files Browse the repository at this point in the history
  • Loading branch information
tfaoliveira committed Dec 5, 2022
1 parent 6181b30 commit 68c01b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ following assume that `jasminc` is available in a directory that is in `$PATH`.

## API documentation

<!--
Note: we address the following security guarantees in future releases;
## Security guarantees
### Properties guaranteed by jasmin
Expand All @@ -103,6 +105,7 @@ following assume that `jasminc` is available in a directory that is in `$PATH`.
TODO: write this.
Explain how to read what has been proven for each scheme
-->

## Future plans

Expand Down
12 changes: 6 additions & 6 deletions doc/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 &mdash; 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&mdash; 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
Expand Down Expand Up @@ -79,24 +79,24 @@ $ ./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).

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`.

13 changes: 8 additions & 5 deletions scripts/ci/releaser/jdist-src
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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 <<END >> $makefile
ALL := $target_list
.PHONY: \$(ALL) clean
all: \$(ALL)
.PHONY: clean
clean:
rm -f \$(ALL)
END
Expand Down Expand Up @@ -152,6 +153,8 @@ cat <<END >> $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/
Expand Down

0 comments on commit 68c01b9

Please sign in to comment.