Skip to content

Commit 79a5c46

Browse files
committed
CI: get jasminc & eclib from the same repo ; check correctness proof using easycrypt runtest
1 parent 2f5bba7 commit 79a5c46

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ LABEL maintainer="[email protected]"
55

66
ARG USER="xmss-user"
77

8-
ARG ECLIB_COMMIT=14d8b2e2b2a3b4ccdb6366781d371afd0ac49bde
98
ARG EASYCRYPT_RELEASE=r2025.02
9+
10+
# We dont use a Jasmin release because it doesnt't have jasmin2ec
1011
ARG JASMIN_COMMIT=4ab734290304bf832095a3939032678169f114d8
1112

1213
SHELL ["/bin/bash", "-c"]
@@ -58,20 +59,15 @@ RUN eval $(opam env) && \
5859
opam depext easycrypt && \
5960
opam install easycrypt && \
6061
easycrypt why3config
61-
62-
# Download ECLib
63-
RUN git clone https://github.com/jasmin-lang/jasmin.git jasmin-eclib && \
64-
cd jasmin-eclib && \
65-
git checkout ${ECLIB_COMMIT} && \
66-
echo -e "[general]\nidirs = Jasmin:$(pwd)/eclib" > ~/.config/easycrypt/easycrypt.conf
6762

68-
# Install Jasmin
63+
# Install Jasmin & set ECLib
6964
RUN git clone https://gitlab.com/jasmin-lang/jasmin-compiler.git jasmin-compiler && \
7065
cd jasmin-compiler && git checkout ${JASMIN_COMMIT} && \
7166
USER=$USER source /home/$USER/.nix-profile/etc/profile.d/nix.sh && \
7267
nix-channel --update && \
7368
cd compiler/ && nix-shell --command "make" && \
74-
sudo install -D jasmin* /usr/local/bin/
69+
sudo install -D jasmin* /usr/local/bin/ && \
70+
cd - && echo -e "[general]\nidirs = Jasmin:$(pwd)/eclib" > ~/.config/easycrypt/easycrypt.conf
7571

7672
COPY --chown=$USER:$USER . /home/$USER/xmss-jasmin
7773
WORKDIR /home/$USER/xmss-jasmin

proof/Makefile

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ EC_FLAGS ?= -timeout 20 ${ECADDFLAGS}
66

77
JASMIN2EC ?= jasmin2ec
88
JASMIN2EC_FLAGS ?= --array-model=old
9-
10-
JPP := ../submodules/jasmin-preprocessor/jpp
11-
PREPROCESSOR := ../submodules/jasmin-preprocessor/preprocessor
9+
JPATH := JASMINPATH="XMSS=../ref-jasmin:Stdlib=../ref-jasmin/stdlib"
1210

1311
# --------------------------------------------------------------------------------------------------
1412

@@ -26,8 +24,11 @@ extract: extraction/XMSS_IMPL.ec
2624
common/Array8.ec: | common/
2725
printf "from Jasmin require import JArray.\n\nclone export PolyArray as Array8 with op size <- 8.\n" > $@
2826

29-
extraction/XMSS_IMPL.ec: extraction/XMSS_IMPL.jazz | common/
30-
$(JASMIN2EC) $(JASMIN2EC_FLAGS) $< -o $@
27+
extraction/XMSS_IMPL.ec: ../ref-jasmin/xmss/xmss.jinc | common/
28+
printf "from XMSS require \"params/params-xmssmt-sha2_20_2_256.jinc\"" > tmp
29+
cat $< >> tmp
30+
$(JPATH) $(JASMIN2EC) $(JASMIN2EC_FLAGS) tmp -o $@
31+
-$(RM) tmp
3132
mv extraction/WArray* common/
3233
mv extraction/Array* common/
3334

@@ -53,17 +54,8 @@ check_extraction: extraction/XMSS_IMPL.ec
5354

5455
################################### correctness proof ##############################################
5556

56-
# The targets check_c_* are used to check the correctness proof files
57-
# FIXME: Why are these individual jobs rather than a single runtest scenario?
58-
# TODO: After checking for Chesterton's fence, replace this entire section with
59-
# check_correctness_proof: extraction/XMSS_IMPL.ec
60-
# $(ECRUNTEST) config/tests.config correctness
61-
check_c_%: extraction/XMSS_IMPL.ec
62-
$(EASYCRYPT) $(EC_FLAGS) correctness/$*.ec
63-
64-
CORRECTNESS_PROOF_FILES := $(addprefix check_c_, $(notdir $(basename $(wildcard correctness/*.ec))))
65-
66-
check_correctness_proof: extraction/XMSS_IMPL.ec $(CORRECTNESS_PROOF_FILES)
57+
check_correctness_proof: extraction/XMSS_IMPL.ec
58+
$(ECRUNTEST) config/tests.config correctness
6759

6860
####################################################################################################
6961

0 commit comments

Comments
 (0)