Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting proofs for ML-DSA Arithmetic #594

Draft
wants to merge 229 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
f5c500c
Fix typo
jschneider-bensch Jul 23, 2024
5237bff
CAVP crate Readme
jschneider-bensch Jul 23, 2024
6042f03
Rename CAVP Readme to conform to workspace
jschneider-bensch Jul 29, 2024
db8fa55
Basic ECDH Readme
jschneider-bensch Jul 29, 2024
cbf91a4
Add verification status to KEM crate Readme
jschneider-bensch Jul 29, 2024
0a53841
Add verification status to PSQ crate Readme
jschneider-bensch Jul 29, 2024
f1cb0de
HMAC crate basic Readme
jschneider-bensch Jul 29, 2024
b5aa98d
HKDF crate basic Readme
jschneider-bensch Jul 29, 2024
b4baef2
Add verification status to ML-KEM crate
jschneider-bensch Jul 29, 2024
fb28a67
Add verification status to ML-DSA crate
jschneider-bensch Jul 29, 2024
de72e52
Add explanation of verification badges to main readme
jschneider-bensch Jul 29, 2024
eb70731
Merge branch 'main' into jonas/readmes
jschneider-bensch Jul 29, 2024
f34493b
wip; not working like this
franziskuskiefer Jul 22, 2024
3c81d14
more wip
franziskuskiefer Jul 22, 2024
24306c5
wip
franziskuskiefer Jul 29, 2024
470fc60
working, dirty
franziskuskiefer Jul 29, 2024
dcb7944
started cleanup
franziskuskiefer Jul 29, 2024
27c3955
no more vecs in mldsa
franziskuskiefer Jul 29, 2024
1d09b71
drop comment in cavp
franziskuskiefer Jul 29, 2024
c69b0f8
more cleanup
franziskuskiefer Jul 29, 2024
cac35f2
Restore AVX2 build
jschneider-bensch Jul 30, 2024
4044c78
Remove warnings about unused function parameters
jschneider-bensch Jul 31, 2024
3339f71
Change naming: `RATE` is what the standard uses for `BLOCK(_)SIZE`
jschneider-bensch Jul 31, 2024
e75875f
Repair C extraction
jschneider-bensch Aug 1, 2024
4ea7835
Update C code
jschneider-bensch Aug 1, 2024
3114668
cargo fmt
jschneider-bensch Aug 1, 2024
747aec4
Update header-only C
jschneider-bensch Aug 1, 2024
4e595b9
Distinguish between Absorb and Squeeze states in XOF API
jschneider-bensch Aug 1, 2024
7dedcf0
Type aliases for incremental SHAKE128/256
jschneider-bensch Aug 1, 2024
b2314d1
Offer SHAKE128/256 as implementations of sealed XOF traits
jschneider-bensch Aug 1, 2024
e7ba6d3
Update C code
jschneider-bensch Aug 1, 2024
ce64b27
Merge branch 'main' into jonas/cleanup-sha3-xof
jschneider-bensch Aug 1, 2024
3840267
Slight improvement to rejection sampling.
xvzcf Aug 6, 2024
74354fd
Unroll expand_to_A.
xvzcf Aug 7, 2024
9f921f1
Slightly refactored sample.rs tests
xvzcf Aug 8, 2024
9307ab9
Leverage latest code quality improvements in Eurydice etc.
msprotz Aug 8, 2024
ac6b1ad
Unroll sample_error_vector.
xvzcf Aug 9, 2024
d6bc5ff
cargo fmt
xvzcf Aug 9, 2024
8b22983
Fix test build failure.
xvzcf Aug 9, 2024
aefa51f
Merge pull request #473 from cryspen/goutam/ml-dsa-avx2-part-7
franziskuskiefer Aug 10, 2024
541bf67
re-extract cg
franziskuskiefer Aug 10, 2024
23fd749
Merge branch 'main' of github.com:cryspen/libcrux into protz_cosmetic
franziskuskiefer Aug 10, 2024
d50e2a0
Get rid of `unused` warnings
jschneider-bensch Aug 12, 2024
c52405e
wip
msprotz Aug 12, 2024
8afc909
Merge branch 'main' into jonas/cleanup-sha3-xof
jschneider-bensch Aug 13, 2024
5b5b44c
Remove feature gated import
jschneider-bensch Aug 13, 2024
2254679
Re-extract C code
jschneider-bensch Aug 13, 2024
06b02e7
Regenerate headerless
jschneider-bensch Aug 13, 2024
3230f59
Fix C extraction
jschneider-bensch Aug 13, 2024
66c395b
Expose key generation and signing randomness requirement constants
jschneider-bensch Aug 13, 2024
5624b74
Add manual benchmarks for ML-DSA variants
jschneider-bensch Aug 13, 2024
6196054
Merge pull request #451 from cryspen/jonas/cleanup-sha3-xof
franziskuskiefer Aug 13, 2024
d10b4fc
Merge branch 'main' into jonas/ml-dsa-manual-benches
jschneider-bensch Aug 13, 2024
e388218
Remove obsolete comments
jschneider-bensch Aug 13, 2024
16124b8
Merge branch 'jonas/ml-dsa-manual-benches' of github.com:cryspen/libc…
jschneider-bensch Aug 13, 2024
4e53a82
Merge pull request #486 from cryspen/jonas/ml-dsa-manual-benches
jschneider-bensch Aug 13, 2024
6832d78
Separate parameter set benchmarks
jschneider-bensch Aug 13, 2024
d5574e8
With latest Eurydice changes
msprotz Aug 13, 2024
0b811da
WIP
msprotz Aug 13, 2024
90358e0
Regenerate on Intel
msprotz Aug 13, 2024
37727e2
Embrace shorter names, for readability
msprotz Aug 13, 2024
97db7bc
Formatting + recognize builtin slice operations and give them better …
msprotz Aug 13, 2024
490a866
More cosmetic changes for core_slice -- align convention with other m…
msprotz Aug 13, 2024
0356783
fix(mlkem/fstar): fix regression introduced by hacspec/hax#864
W95Psp Aug 14, 2024
e19a760
Benchmark pqclean
jschneider-bensch Aug 14, 2024
7af24bf
More meaningful constants
jschneider-bensch Aug 14, 2024
bf283a0
Merge pull request #489 from cryspen/lf-fix-regression-hax-pr-846
franziskuskiefer Aug 14, 2024
ff3da9d
Merge branch 'main' into jonas/ml-dsa-manual-benches
jschneider-bensch Aug 14, 2024
af83d1d
Remove unnecessary attributes
jschneider-bensch Aug 14, 2024
bce2d9d
Merge branch 'jonas/ml-dsa-manual-benches' of github.com:cryspen/libc…
jschneider-bensch Aug 14, 2024
b1d4135
Merge pull request #490 from cryspen/jonas/ml-dsa-manual-benches
jschneider-bensch Aug 14, 2024
0c66762
code update
franziskuskiefer Aug 14, 2024
05f346c
More code quality
msprotz Aug 14, 2024
63adbfb
fixes for ml-kem C
franziskuskiefer Aug 18, 2024
a62ef07
Merge branch 'main' of github.com:cryspen/libcrux into protz_cosmetic
franziskuskiefer Aug 18, 2024
0ca73e5
update C extraction
franziskuskiefer Aug 18, 2024
c5406ba
inline ind_cpa encrypt for stack
franziskuskiefer Aug 18, 2024
322297a
sha3 benchmarks
franziskuskiefer Aug 18, 2024
573b064
update mlkem c extraction
franziskuskiefer Aug 18, 2024
c85c0f9
Merge pull request #472 from cryspen/protz_cosmetic
franziskuskiefer Aug 18, 2024
501f771
Add LICENSE-MIT
franziskuskiefer Aug 19, 2024
80d195d
Merge pull request #516 from cryspen/franziskus/mit-license
jschneider-bensch Aug 19, 2024
0d34246
Update test vectors to include domain separation for key generation
jschneider-bensch Aug 19, 2024
6eaba8c
WIP domain separation for keygen seed
jschneider-bensch Aug 19, 2024
3b56cb3
Merge branch 'main' into jonas/ml-kem-final-diffs
jschneider-bensch Aug 19, 2024
f844291
Test actual Kyber on CI
jschneider-bensch Aug 19, 2024
6b71b5f
Test verified version of ML-KEM IPD using the right vectors
jschneider-bensch Aug 19, 2024
5c476f4
IPD test vectors only for the old IPD implementation
jschneider-bensch Aug 19, 2024
fd117a0
Update C test vectors
jschneider-bensch Aug 19, 2024
cddeebe
Update C extraction
jschneider-bensch Aug 19, 2024
cd20a27
update Cargo.lock
franziskuskiefer Aug 20, 2024
ea9e21b
Merge pull request #519 from cryspen/franziskus/update-cargo-lock
jschneider-bensch Aug 20, 2024
6de20c4
Merge branch 'main' into jonas/ml-kem-final-diffs
jschneider-bensch Aug 20, 2024
5ca2e45
Merge pull request #517 from cryspen/jonas/ml-kem-final-diffs
jschneider-bensch Aug 20, 2024
8a4b786
PSQ registration protocol
jschneider-bensch Aug 20, 2024
86d7ef7
Update documentation
jschneider-bensch Aug 20, 2024
f6c4464
Clippy
jschneider-bensch Aug 20, 2024
0385208
Merge branch 'main' into jonas/psq-registration
jschneider-bensch Aug 20, 2024
72ab012
put the ml-kem unpacked API behind a feature
franziskuskiefer Aug 21, 2024
9a130a8
docrs fixes for mlkem
franziskuskiefer Aug 21, 2024
c49daa8
extract C code without unpacked API
franziskuskiefer Aug 21, 2024
4c340d5
enable unpacked features on docs.rs
franziskuskiefer Aug 21, 2024
7d3aa4d
update mlkem F* extraction
franziskuskiefer Aug 21, 2024
7dec44a
update cg extraction
franziskuskiefer Aug 21, 2024
6a879b9
Merge pull request #522 from cryspen/franziskus/unpacked-feature
franziskuskiefer Aug 21, 2024
ad45801
mldsa feature detection
franziskuskiefer Aug 22, 2024
dc056fd
sign 44 example bench
franziskuskiefer Aug 22, 2024
a39501e
ml-dsa multiplexing
franziskuskiefer Aug 22, 2024
61a77d5
fixup ml-dsa multiplexing for mldsa
franziskuskiefer Aug 22, 2024
79a8afc
prepare merge queues
Aug 22, 2024
11629c3
undo hpke
Aug 22, 2024
9ddfa5e
run tests in merge queue :face_palm:
Aug 22, 2024
36c6b05
Create stale.yml
franziskuskiefer Aug 23, 2024
4873df7
Merge pull request #529 from cryspen/franziskus/stale-job
franziskuskiefer Aug 23, 2024
6d67494
Bump serde from 1.0.208 to 1.0.209
dependabot[bot] Aug 26, 2024
bb3cd58
Bump serde_json from 1.0.125 to 1.0.127
dependabot[bot] Aug 26, 2024
190bfd4
build gc before trying to bench it
Aug 26, 2024
e995f6a
disable libtest for benches in ./benchmarks/
Aug 26, 2024
802eccd
bench = false in the rest of the benchmarked rust packages
Aug 26, 2024
b4e38dd
disable c bench for windows
Aug 26, 2024
13aa81f
steps towards getting wasm to work, but disable it for now because it…
Aug 26, 2024
c3e4c58
final touches on benchmarks
Aug 26, 2024
e580006
Merge branch 'main' into keks/towards-merge-queue-and-bench-graphs
keks Aug 26, 2024
30af7dd
split up benchmarks and fix git issue
Aug 26, 2024
496c9d3
fix more benchmark workflows
Aug 27, 2024
6108ada
figure out which files need to be reset
Aug 27, 2024
264dbfd
Add private key validation function
franziskuskiefer Aug 27, 2024
1def0c1
Update C extraction
franziskuskiefer Aug 27, 2024
3388672
fix ml-kem.rs test for old implementation
franziskuskiefer Aug 27, 2024
f90dff2
Update README.md
jiep Aug 28, 2024
4ad532b
add a single kat for dk validation
franziskuskiefer Aug 28, 2024
62e1ec3
update tools and licenses
franziskuskiefer Aug 29, 2024
0c50e0d
disable benchmarks on CI :(
Aug 29, 2024
fdfb18e
Merge pull request #540 from cryspen/franziskus/ml-kem-dk-validation
franziskuskiefer Aug 29, 2024
7ac6ace
Merge branch 'main' into keks/towards-merge-queue-and-bench-graphs
franziskuskiefer Aug 29, 2024
9915bee
Merge pull request #525 from cryspen/keks/towards-merge-queue-and-ben…
keks Aug 29, 2024
59dc8ea
Merge pull request #532 from cryspen/dependabot/cargo/serde_json-1.0.127
franziskuskiefer Aug 29, 2024
84c5d87
Merge pull request #531 from cryspen/dependabot/cargo/serde-1.0.209
franziskuskiefer Aug 29, 2024
b0786ec
add randomized APIs to ml-kem
franziskuskiefer Aug 29, 2024
ebf3e09
drop commented code
franziskuskiefer Aug 30, 2024
4dccc28
Merge branch 'main' of github.com:cryspen/libcrux into franziskus/ml-…
franziskuskiefer Aug 30, 2024
109e1aa
Merge branch 'main' of github.com:cryspen/libcrux into franziskus/ml-…
franziskuskiefer Aug 30, 2024
2c597d9
update cargo.lock
franziskuskiefer Aug 30, 2024
baac801
Merge branch 'main' into patch-1
franziskuskiefer Aug 30, 2024
d8644b0
Merge pull request #542 from jiep/patch-1
franziskuskiefer Aug 30, 2024
28d0e15
fix non-rand build
franziskuskiefer Aug 30, 2024
870d72f
Merge branch 'main' of github.com:cryspen/libcrux into franziskus/ml-…
franziskuskiefer Aug 30, 2024
056e28a
Refresh C
msprotz Aug 30, 2024
6ff01fb
Merge remote-tracking branch 'origin/main'
msprotz Aug 30, 2024
3676fd5
Refresh C
msprotz Aug 30, 2024
6196b7a
update cg and docker
franziskuskiefer Aug 30, 2024
9633017
more feature guards
franziskuskiefer Aug 30, 2024
75ca451
basic fuzzing for C extraction of ML-KEM768
djmdjm Sep 2, 2024
a39bda0
update docker
franziskuskiefer Sep 2, 2024
3fc1eab
Apply suggestions from code review
franziskuskiefer Sep 2, 2024
ea41a38
Include hidden files in extraction upload
jschneider-bensch Sep 3, 2024
6d74c9d
Remove unsafe code from include to avoid being rejected by hax.
maximebuyse Sep 3, 2024
e988d2d
Merge branch 'jonas/fix-extraction-action' into fix-rejected-unsafe
jschneider-bensch Sep 3, 2024
bc44752
Merge pull request #556 from cryspen/fix-rejected-unsafe
jschneider-bensch Sep 3, 2024
9680093
Merge pull request #555 from cryspen/jonas/fix-extraction-action
franziskuskiefer Sep 3, 2024
08491c7
Merge branch 'main' into franziskus/ml-kem-rand
jschneider-bensch Sep 3, 2024
482620d
Merge pull request #546 from cryspen/franziskus/ml-kem-rand
franziskuskiefer Sep 3, 2024
643ca60
hax-compatibility: Cast match scrutinees
jschneider-bensch Sep 3, 2024
7e674c6
hax-compatibility: Change `loop` to a bounded iteration
jschneider-bensch Sep 3, 2024
dbfe23f
Remove comment
jschneider-bensch Sep 4, 2024
de93274
Merge branch 'main' into jonas/psq-registration
jschneider-bensch Sep 4, 2024
b8e3435
Merge branch 'jonas/psq-registration' of github.com:cryspen/libcrux i…
jschneider-bensch Sep 4, 2024
8daadb7
Merge pull request #521 from cryspen/jonas/psq-registration
jschneider-bensch Sep 4, 2024
43e55c4
hax-compatibility: `RefMut` workaround
jschneider-bensch Sep 5, 2024
bcb6e09
hax-compatibility: Rewrite early returns
jschneider-bensch Sep 5, 2024
c18a8c1
Remove unused import
jschneider-bensch Sep 5, 2024
5e67fa7
Add ML-DSA extraction to hax CI workflow
jschneider-bensch Sep 5, 2024
138797b
Merge branch 'main' into jonas/ml-dsa-hax-fixes
jschneider-bensch Sep 5, 2024
b45c9e8
update F*
franziskuskiefer Sep 6, 2024
409d847
Merge branch 'main' into protz_refresh_c
franziskuskiefer Sep 6, 2024
b1c4c44
Merge pull request #547 from cryspen/protz_refresh_c
franziskuskiefer Sep 6, 2024
3204a98
Merge branch 'main' into franziskus/ml-dsa-boilerplate
franziskuskiefer Sep 6, 2024
c184c2d
Merge branch 'main' into jonas/ml-dsa-hax-fixes
jschneider-bensch Sep 9, 2024
99498ee
Apply suggestions from code review
franziskuskiefer Sep 9, 2024
717b165
update extracted C code
franziskuskiefer Sep 9, 2024
4a129c7
Merge pull request #524 from cryspen/franziskus/ml-dsa-boilerplate
franziskuskiefer Sep 9, 2024
76a08da
wip
franziskuskiefer Sep 10, 2024
538513f
Merge branch 'main' into jonas/readmes
jschneider-bensch Sep 10, 2024
787584d
Dont `unwrap()` or `expect()` in examples
jschneider-bensch Sep 10, 2024
6aa31a6
Use constant for rejection sample loop bound
jschneider-bensch Sep 10, 2024
bffb482
Merge branch 'main' into jonas/ml-dsa-hax-fixes
jschneider-bensch Sep 10, 2024
df48c90
Update intrinsics interfaces
jschneider-bensch Sep 10, 2024
9bdda4c
hax-compatibility: cast match scrutinees
jschneider-bensch Sep 10, 2024
17566f6
Merge pull request #558 from cryspen/jonas/ml-dsa-hax-fixes
franziskuskiefer Sep 10, 2024
08a3cad
updated unpacked api
franziskuskiefer Sep 10, 2024
060e27d
Merge branch 'main' into jonas/readmes
jschneider-bensch Sep 11, 2024
16c5cbb
serialize functions for unpacked keys
franziskuskiefer Sep 11, 2024
e992824
serialize functions for unpacked and C
franziskuskiefer Sep 11, 2024
263b880
Fix benchmarks
jschneider-bensch Sep 11, 2024
6ba6263
Format
jschneider-bensch Sep 11, 2024
a452304
Build benchmarks (without running) on CI
jschneider-bensch Sep 11, 2024
833e904
Merge pull request #573 from cryspen/jonas/fix-mldsa-bench
franziskuskiefer Sep 11, 2024
0ff44ac
Merge pull request #448 from cryspen/jonas/readmes
franziskuskiefer Sep 11, 2024
f484e75
Use the right SIMD unit for AVX2
jschneider-bensch Sep 12, 2024
8209178
Extend multiplexing
jschneider-bensch Sep 12, 2024
bae489b
Merge pull request #574 from cryspen/jonas/ml-dsa-extend-multiplexing
franziskuskiefer Sep 12, 2024
28acae7
minor tweak
msprotz Sep 12, 2024
f4cf47e
wip
msprotz Sep 12, 2024
f07d78f
wip
msprotz Sep 12, 2024
e889dcc
updated cg.yaml
franziskuskiefer Sep 13, 2024
af73d01
unpacked API for cg
franziskuskiefer Sep 15, 2024
1187505
drop unpacked feature
franziskuskiefer Sep 16, 2024
1e523e8
update C code
franziskuskiefer Sep 16, 2024
4072680
update F*
franziskuskiefer Sep 16, 2024
422ff05
Merge branch 'main' into franziskus/mlkem-usable-unpacked
franziskuskiefer Sep 16, 2024
866aace
remove unpacked job from ci
franziskuskiefer Sep 16, 2024
f06414b
work around hax issues
franziskuskiefer Sep 16, 2024
521b98d
update docker image for C extraction
franziskuskiefer Sep 16, 2024
97f7cef
fix kyber
franziskuskiefer Sep 16, 2024
65d06b7
update C extraction
franziskuskiefer Sep 16, 2024
89b109d
update C clang-format
franziskuskiefer Sep 16, 2024
30f0fb3
remove commented code in self.rs
franziskuskiefer Sep 17, 2024
6a8770c
Merge pull request #586 from cryspen/franziskus/mlkem-usable-unpacked
franziskuskiefer Sep 17, 2024
0c464d9
format and clang-18
franziskuskiefer Sep 19, 2024
9b25aeb
git ignore fuzz build artifacts
franziskuskiefer Sep 19, 2024
1afc751
Merge branch 'main' of github.com:cryspen/libcrux into fuzz
franziskuskiefer Sep 19, 2024
e2639a9
formatting and eurydice_glue warning fix
franziskuskiefer Sep 19, 2024
72563a3
try to get eurydice_glue formatting right
franziskuskiefer Sep 19, 2024
8f23a83
maybe make clang-format happy
franziskuskiefer Sep 19, 2024
41072c6
Merge pull request #554 from djmdjm/fuzz
franziskuskiefer Sep 19, 2024
0f5121e
verified
karthikbhargavan Sep 22, 2024
37d35d8
c code refresh
karthikbhargavan Sep 22, 2024
2cc5d08
boring C not working
karthikbhargavan Sep 22, 2024
4db4adc
fstar extraction for ml-dsa
karthikbhargavan Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .docker/c/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ COPY --chown=$USER:$USER . $HOME/$USER
# Setup & install.
ADD install.sh /tmp/install.sh
RUN bash /tmp/install.sh
ADD ext-tools.sh /tmp/ext-tools.sh
RUN bash /tmp/ext-tools.sh

ENV FSTAR_HOME=$HOME/fstar
ENV HACL_HOME=$HOME/hacl-star
Expand Down
47 changes: 47 additions & 0 deletions .docker/c/ext-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

set -v -e -x

source $HOME/.profile

curl -L https://github.com/AeneasVerif/charon/archive/28d543bfacc902ba9cc2a734b76baae9583892a4.zip \
--output charon.zip
unzip charon.zip
rm -rf charon.zip
mv charon-28d543bfacc902ba9cc2a734b76baae9583892a4/ charon

curl -L https://github.com/FStarLang/karamel/archive/15d4bce74a2d43e34a64f48f8311b7d9bcb0e152.zip \
--output karamel.zip
unzip karamel.zip
rm -rf karamel.zip
mv karamel-15d4bce74a2d43e34a64f48f8311b7d9bcb0e152/ karamel

curl -L https://github.com/AeneasVerif/eurydice/archive/1a65dbf3758fe310833718c645a64266294a29ac.zip \
--output eurydice.zip
unzip eurydice.zip
rm -rf eurydice.zip
mv eurydice-1a65dbf3758fe310833718c645a64266294a29ac/ eurydice

echo "export KRML_HOME=$HOME/karamel" >>$HOME/.profile
echo "export EURYDICE_HOME=$HOME/eurydice" >>$HOME/.profile
echo "export CHARON_HOME=$HOME/charon" >>$HOME/.profile

source $HOME/.profile

# Build everything
cd karamel
make -j
cd -

cd charon
make -j
cd -

cd eurydice/lib
rm -f charon
ln -s $CHARON_HOME/charon-ml charon
rm -f krml
ln -s $KRML_HOME/lib krml
cd ../
make -j
cd ../
42 changes: 1 addition & 41 deletions .docker/c/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ opam init --bare --disable-sandboxing --shell-setup --yes
opam switch create 4.14.1

# Get F*, HACL*, Charon, Karamel, Eurydice for running proofs and extraction
curl -L https://github.com/FStarLang/FStar/releases/download/v2024.01.13/fstar_2024.01.13_Linux_x86_64.tar.gz \
curl -L https://github.com/FStarLang/FStar/releases/download/v2024.09.05/fstar_2024.09.05_Linux_x86_64.tar.gz \
--output Fstar.tar.gz
tar --extract --file Fstar.tar.gz
rm -f Fstar.tar.gz
Expand All @@ -25,52 +25,12 @@ unzip hacl-star.zip
rm -rf hacl-star.zip
mv hacl-star-2a8b61343a1a7232611cb763b0dc3e4dff84d656/ hacl-star

curl -L https://github.com/AeneasVerif/charon/archive/3f6d1c304e0e5bef1e9e2ea65aec703661b05f39.zip \
--output charon.zip
unzip charon.zip
rm -rf charon.zip
mv charon-3f6d1c304e0e5bef1e9e2ea65aec703661b05f39/ charon


curl -L https://github.com/FStarLang/karamel/archive/fc56fce6a58754766809845f88fc62063b2c6b92.zip \
--output karamel.zip
unzip karamel.zip
rm -rf karamel.zip
mv karamel-fc56fce6a58754766809845f88fc62063b2c6b92/ karamel

curl -L https://github.com/AeneasVerif/eurydice/archive/392674166bac86e60f5fffa861181a398fdc3896.zip \
--output eurydice.zip
unzip eurydice.zip
rm -rf eurydice.zip
mv eurydice-392674166bac86e60f5fffa861181a398fdc3896/ eurydice

echo "export FSTAR_HOME=$HOME/fstar" >>$HOME/.profile
echo "export HACL_HOME=$HOME/hacl-star" >>$HOME/.profile
echo "export KRML_HOME=$HOME/karamel" >>$HOME/.profile
echo "export EURYDICE_HOME=$HOME/eurydice" >>$HOME/.profile
echo "export CHARON_HOME=$HOME/charon" >>$HOME/.profile
echo "export HAX_HOME=$HOME/hax" >>$HOME/.profile
echo "export PATH=\"${PATH}:$HOME/fstar/bin:$HOME/z3/bin\"" >>$HOME/.profile
echo "[[ ! -r /home/$USER/.opam/opam-init/init.sh ]] || source /home/$USER/.opam/opam-init/init.sh > /dev/null 2> /dev/null" >>$HOME/.profile

source $HOME/.profile
opam install --yes ocamlfind visitors menhir ppx_deriving_yojson core_unix sedlex wasm fix process pprint zarith yaml easy_logging terminal
eval $(opam env)

# Build everything
cd karamel
make -j
cd -

cd charon
make -j
cd -

cd eurydice/lib
rm -f charon
ln -s $CHARON_HOME/charon-ml charon
rm -f krml
ln -s $KRML_HOME/lib krml
cd ../
make -j
cd ../
4 changes: 4 additions & 0 deletions .github/workflows/hax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ jobs:
HAX_HOME=${{ github.workspace }}/hax \
PATH="${PATH}:${{ github.workspace }}/fstar/bin" \
./hax.py prove --admit

- name: 🏃 Extract ML-DSA crate
working-directory: libcrux-ml-dsa
run: cargo hax into fstar
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Cryspen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ libcrux uses the following configurations for its hardware abstractions
libcrux provides a DRBG implementation that can be used standalone (`drbg::Drbg`)
or through the `Rng` traits.

## Verification status

As a quick indicator of overall verification status, subcrates in this workspace include the following badges:

- ![pre-verification] to indicate that most (or all) of the code that is contained in default features of that crate is not (yet) verified.
- ![verified] to indicate that most (or all) of the code that is contained in the default feature set is verified.

In both cases, please refer to the more detailed notes on verification in each
sub-crate to learn more about what has (or has not) been verified in the
particular case.

[architecture]: ./Architecture.md
[hacspec]: https://hacspec.org
[formal verification]: ./formal_verification

[verified]: https://img.shields.io/badge/verified-brightgreen.svg?style=for-the-badge&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik05IDEyTDExIDE0TDE1IDkuOTk5OTlNMjAgMTJDMjAgMTYuNDYxMSAxNC41NCAxOS42OTM3IDEyLjY0MTQgMjAuNjgzQzEyLjQzNjEgMjAuNzkgMTIuMzMzNCAyMC44NDM1IDEyLjE5MSAyMC44NzEyQzEyLjA4IDIwLjg5MjggMTEuOTIgMjAuODkyOCAxMS44MDkgMjAuODcxMkMxMS42NjY2IDIwLjg0MzUgMTEuNTYzOSAyMC43OSAxMS4zNTg2IDIwLjY4M0M5LjQ1OTk2IDE5LjY5MzcgNCAxNi40NjExIDQgMTJWOC4yMTc1OUM0IDcuNDE4MDggNCA3LjAxODMzIDQuMTMwNzYgNi42NzQ3QzQuMjQ2MjcgNi4zNzExMyA0LjQzMzk4IDYuMTAwMjcgNC42Nzc2NiA1Ljg4NTUyQzQuOTUzNSA1LjY0MjQzIDUuMzI3OCA1LjUwMjA3IDYuMDc2NCA1LjIyMTM0TDExLjQzODIgMy4yMTA2N0MxMS42NDYxIDMuMTMyNzEgMTEuNzUgMy4wOTM3MyAxMS44NTcgMy4wNzgyN0MxMS45NTE4IDMuMDY0NTcgMTIuMDQ4MiAzLjA2NDU3IDEyLjE0MyAzLjA3ODI3QzEyLjI1IDMuMDkzNzMgMTIuMzUzOSAzLjEzMjcxIDEyLjU2MTggMy4yMTA2N0wxNy45MjM2IDUuMjIxMzRDMTguNjcyMiA1LjUwMjA3IDE5LjA0NjUgNS42NDI0MyAxOS4zMjIzIDUuODg1NTJDMTkuNTY2IDYuMTAwMjcgMTkuNzUzNyA2LjM3MTEzIDE5Ljg2OTIgNi42NzQ3QzIwIDcuMDE4MzMgMjAgNy40MTgwOCAyMCA4LjIxNzU5VjEyWiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPC9zdmc+
[pre-verification]: https://img.shields.io/badge/pre_verification-orange.svg?style=for-the-badge&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik05IDEySDE1TTIwIDEyQzIwIDE2LjQ2MTEgMTQuNTQgMTkuNjkzNyAxMi42NDE0IDIwLjY4M0MxMi40MzYxIDIwLjc5IDEyLjMzMzQgMjAuODQzNSAxMi4xOTEgMjAuODcxMkMxMi4wOCAyMC44OTI4IDExLjkyIDIwLjg5MjggMTEuODA5IDIwLjg3MTJDMTEuNjY2NiAyMC44NDM1IDExLjU2MzkgMjAuNzkgMTEuMzU4NiAyMC42ODNDOS40NTk5NiAxOS42OTM3IDQgMTYuNDYxMSA0IDEyVjguMjE3NTlDNCA3LjQxODA4IDQgNy4wMTgzMyA0LjEzMDc2IDYuNjc0N0M0LjI0NjI3IDYuMzcxMTMgNC40MzM5OCA2LjEwMDI3IDQuNjc3NjYgNS44ODU1MkM0Ljk1MzUgNS42NDI0MyA1LjMyNzggNS41MDIwNyA2LjA3NjQgNS4yMjEzNEwxMS40MzgyIDMuMjEwNjdDMTEuNjQ2MSAzLjEzMjcxIDExLjc1IDMuMDkzNzMgMTEuODU3IDMuMDc4MjdDMTEuOTUxOCAzLjA2NDU3IDEyLjA0ODIgMy4wNjQ1NyAxMi4xNDMgMy4wNzgyN0MxMi4yNSAzLjA5MzczIDEyLjM1MzkgMy4xMzI3MSAxMi41NjE4IDMuMjEwNjdMMTcuOTIzNiA1LjIyMTM0QzE4LjY3MjIgNS41MDIwNyAxOS4wNDY1IDUuNjQyNDMgMTkuMzIyMyA1Ljg4NTUyQzE5LjU2NiA2LjEwMDI3IDE5Ljc1MzcgNi4zNzExMyAxOS44NjkyIDYuNjc0N0MyMCA3LjAxODMzIDIwIDcuNDE4MDggMjAgOC4yMTc1OVYxMloiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg==
5 changes: 4 additions & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ repository.workspace = true
readme.workspace = true
publish = false

[lib]
bench = false # so libtest doesn't eat the arguments for criterion

[dependencies]
rand = { version = "0.8" }

[dev-dependencies]
libcrux = { path = "../", features = ["rand", "tests"] }
libcrux-kem = { path = "../libcrux-kem", features = ["tests"] }
libcrux-ml-kem = { path = "../libcrux-ml-kem" }
rand = { version = "0.8" }
rand_core = { version = "0.6" }
# Benchmarking "RustCrypto"
chacha20poly1305 = "0.10"
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benches/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ use chacha20poly1305::{AeadCore, AeadInPlace, KeyInit};
use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput};
use libcrux::{aead::*, digest, drbg};

mod util;
use benchmarks::util::*;
use rand_core::OsRng;
use ring::aead::UnboundKey;
use util::*;

// Comparing libcrux performance for different payload sizes and other implementations.
fn comparisons_encrypt(c: &mut Criterion) {
Expand Down
1 change: 0 additions & 1 deletion benchmarks/benches/p256.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use libcrux::ecdh;

mod util;
use rand_core::OsRng;

fn derive(c: &mut Criterion) {
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benches/sha2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criteri

use libcrux::digest::{self, *};

mod util;
use util::*;
use benchmarks::util::*;

macro_rules! impl_comp {
($fun:ident, $libcrux:expr, $ring:expr, $rust_crypto:ty, $openssl:expr) => {
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benches/sha3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criteri

use libcrux::digest::{self, *};

mod util;
use util::*;
use benchmarks::util::*;

macro_rules! impl_comp {
($fun:ident, $libcrux:expr, $rust_crypto:ty, $openssl:expr) => {
Expand Down
16 changes: 0 additions & 16 deletions benchmarks/benches/util.rs

This file was deleted.

3 changes: 1 addition & 2 deletions benchmarks/benches/x25519.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use libcrux::ecdh;

mod util;
use benchmarks::util::*;
use rand::RngCore;
use util::*;

fn derive(c: &mut Criterion) {
// Comparing libcrux performance for different payload sizes and other implementations.
Expand Down
15 changes: 15 additions & 0 deletions benchmarks/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
pub mod util {
pub fn randombytes(n: usize) -> Vec<u8> {
use rand::rngs::OsRng;
use rand::RngCore;

let mut bytes = vec![0u8; n];
OsRng.fill_bytes(&mut bytes);
bytes
}

pub fn fmt(x: usize) -> String {
let base = (x as f64).log(1024f64).floor() as usize;
let suffix = ["", "KB", "MB", "GB"];
format!("{} {}", x >> (10 * base), suffix[base])
}
}
9 changes: 9 additions & 0 deletions cavp/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Libcrux CAVP Utilities

> The NIST Cryptographic Algorithm Validation Program (CAVP) provides validation testing of Approved (i.e., FIPS-approved and NIST-recommended) cryptographic algorithms and their individual components.

- [NIST: Cryptographic Algorithm Validation
Program](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program)

This crate provides tooling around parsing and handling of CAVP test
vectors for `libcrux` crates.
2 changes: 1 addition & 1 deletion formal_verification/vale-crypto/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vale Crypto in libcrux

##Vale: Verified Assembly Language for Everest
## Vale: Verified Assembly Language for Everest

Vale is a tool for constructing formally verified high-performance assembly language code, with an emphasis on cryptographic code. It uses existing verification frameworks, such as Dafny and F*, for formal verification. It supports multiple architectures, such as x86, x64, and ARM, and multiple platforms, such as Windows, Mac, and Linux. Additional architectures and platforms can be supported with no changes to the Vale tool.
Each assembly implementation in Vale is verified for:
Expand Down
3 changes: 3 additions & 0 deletions libcrux-ecdh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ hex = { version = "0.4.3", features = ["serde"] }
serde_json = { version = "1.0" }
serde = { version = "1.0", features = ["derive"] }
pretty_env_logger = "0.5"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(adx)', 'cfg(bmi2)'] }
Loading
Loading