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

Merging main and addressing last comments before merging back #714

Merged
merged 64 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
20fb301
update boring flow
franziskuskiefer Nov 15, 2024
15eb9a1
Create CODEOWNERS
franziskuskiefer Nov 15, 2024
b125026
Update CODEOWNERS
franziskuskiefer Nov 15, 2024
f323dee
Remove Cargo.lock
Nadrieril Nov 15, 2024
32959ac
Make the flake work without a `Cargo.lock` tracked by git
Nadrieril Nov 15, 2024
ff2b3f8
Add files via upload
franziskuskiefer Nov 17, 2024
e4a1424
Bump DeterminateSystems/nix-installer-action from 13 to 16
dependabot[bot] Nov 18, 2024
f7bc6f2
Delete Cargo.lock
franziskuskiefer Nov 18, 2024
e72d25c
Merge pull request #682 from cryspen/franziskus/mlkem-report
franziskuskiefer Nov 18, 2024
0b6d0e0
Export fixed-size versions of HPKE
keks Nov 18, 2024
4f9ecfc
Move trait to crate root
keks Nov 18, 2024
5bbff9a
Add doc comment to mode structs
keks Nov 18, 2024
1a7d043
Fix ML-KEM benchmarks
jschneider-bensch Nov 19, 2024
ed6cb80
Merge branch 'main' into jonas/mlkem-bench-fix
jschneider-bensch Nov 19, 2024
b5df41d
Update CODEOWNERS
franziskuskiefer Nov 20, 2024
2b0c30d
Merge pull request #693 from cryspen/franziskus/code-owners
franziskuskiefer Nov 20, 2024
60005e9
Fix X25519Kyber768Draft00 build error
jschneider-bensch Nov 21, 2024
47a8242
Swap order of ML-KEM and X25519 parts in `MlKem768Draft00` hybrid KEM
jschneider-bensch Nov 21, 2024
694cce4
Merge pull request #689 from cryspen/franziskus/drop-cargo-lock
franziskuskiefer Nov 21, 2024
49efbc8
Public Key Encoding
jschneider-bensch Nov 21, 2024
beaad0b
Private Key encoding
jschneider-bensch Nov 21, 2024
e11adfb
fixup hpke mlkem
franziskuskiefer Nov 22, 2024
40c1e1a
Merge branch 'main' into jonas/mlkem-hybrid-swap
franziskuskiefer Nov 22, 2024
24f3157
Fix ciphertext encoding
jschneider-bensch Nov 22, 2024
c19ab7f
Replace manual ciphertext decoding
jschneider-bensch Nov 22, 2024
b3886ea
Merge branch 'jonas/mlkem-hybrid-swap' of github.com:cryspen/libcrux …
jschneider-bensch Nov 22, 2024
6266629
Merge pull request #694 from cryspen/jonas/mlkem-hybrid-swap
franziskuskiefer Nov 22, 2024
3c0dffb
Merge pull request #692 from cryspen/jonas/mlkem-bench-fix
franziskuskiefer Nov 22, 2024
d7bfa9e
Merge branch 'main' into franziskus/cg-update
jschneider-bensch Nov 22, 2024
4994c62
Merge pull request #681 from cryspen/franziskus/cg-update
franziskuskiefer Nov 22, 2024
c4c86de
Improve docs, slightly simplify module hierarchy
keks Nov 25, 2024
9aa622d
Merge branch 'main' into keks/hpke-fixed-size-419
jschneider-bensch Nov 25, 2024
b33f153
Merge pull request #690 from cryspen/keks/hpke-fixed-size-419
jschneider-bensch Nov 25, 2024
fc242d8
make most crates no_std
keks Nov 25, 2024
0a10583
make hkdf no_std
keks Nov 25, 2024
df3e271
make traits crate and sys traits no_std (except lib25519)
keks Nov 25, 2024
ff1d984
don't make sys/hacl no_std (because it fails)
keks Nov 26, 2024
638c9b9
fix imports of alloc in hkdf-hacl
keks Nov 26, 2024
d93ef5c
Merge branch 'main' into remove-cargo-lock
W95Psp Nov 26, 2024
6e56754
Merge pull request #691 from Nadrieril/remove-cargo-lock
W95Psp Nov 27, 2024
d5e4a0f
Merge pull request #697 from cryspen/keks/no-std-1
jschneider-bensch Nov 27, 2024
6b2e326
Drop inlining on `sample_four_ring_elements`
jschneider-bensch Nov 28, 2024
80b38dc
Always use portable `shake128::XofX4` in `sample_four_ring_elements`
jschneider-bensch Nov 28, 2024
5b34e65
Use `opt-level=1` for Debug builds of ML-DSA
jschneider-bensch Nov 28, 2024
25c610c
Remove obsolete generic
jschneider-bensch Nov 28, 2024
f9097bb
Missed obsolete generic in tests
jschneider-bensch Nov 28, 2024
77e9464
Merge pull request #699 from cryspen/jonas/ml-dsa-crutch
franziskuskiefer Nov 28, 2024
de946d7
feat(ci/hax): allow manual workflows to specify hax version
W95Psp Nov 28, 2024
6ede996
Merge pull request #700 from cryspen/ci-custom-hax-branches
franziskuskiefer Nov 28, 2024
6946b9a
fewer mldsa benchmark iterations
franziskuskiefer Nov 30, 2024
b43867a
inline for ml-dsa hash_functions.rs
franziskuskiefer Nov 30, 2024
f673e93
separate s1 ntt for locality
franziskuskiefer Nov 30, 2024
b2b9c4e
Merge pull request #701 from cryspen/franziskus/mldsa-hash-inline
franziskuskiefer Dec 2, 2024
d972def
First changes for ML-DSA C extraction
franziskuskiefer Nov 29, 2024
ebd9959
udpate hax extraction
franziskuskiefer Dec 3, 2024
de44bdb
Merge pull request #683 from cryspen/dependabot/github_actions/Determ…
franziskuskiefer Dec 4, 2024
91cec19
Merge branch 'main' into franziskus/mldsa-c1
franziskuskiefer Dec 5, 2024
8b1d6b6
Update bindgen requirement from 0.69 to 0.71
dependabot[bot] Dec 9, 2024
116d987
Merge pull request #709 from cryspen/dependabot/cargo/bindgen-0.71
franziskuskiefer Dec 9, 2024
548be57
address review comments
franziskuskiefer Dec 9, 2024
1214cd7
Merge branch 'main' of github.com:cryspen/libcrux into franziskus/mld…
franziskuskiefer Dec 9, 2024
767c2a7
Merge pull request #707 from cryspen/franziskus/mldsa-c1
franziskuskiefer Dec 10, 2024
a51b250
c cg fstar refresh
karthikbhargavan Dec 16, 2024
2ce6936
addressed comments
karthikbhargavan Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flake-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: DeterminateSystems/nix-installer-action@v13
- uses: DeterminateSystems/nix-installer-action@v16
- name: update `flake.lock`
run: nix flake update
- name: commit
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/hax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- cron: "0 0 * * *"

workflow_dispatch:
inputs:
hax_rev:
description: 'The hax revision you want this job to use'
default: 'main'
merge_group:

env:
Expand Down Expand Up @@ -42,6 +46,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: hacspec/hax
ref: ${{ github.event.inputs.hax_rev || 'main' }}
path: hax

- name: ⤵ Install & confiure Cachix
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
nix:
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@v13
- uses: DeterminateSystems/nix-installer-action@v16
- uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Install & configure Cachix
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__
kyber-crate/
*.llbc
.cargo/
Cargo.lock

# When using sed
*.bak
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @cryspen/libcrux
73 changes: 4 additions & 69 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ lto = "fat"
codegen-units = 1
panic = "abort"

[profile.dev.package."libcrux-ml-dsa"]
opt-level = 1

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(hax)',
Expand Down
2 changes: 2 additions & 0 deletions curve25519/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![no_std]

#[cfg(feature = "hacl")]
pub use libcrux_hacl_rs::curve25519_51 as hacl;

Expand Down
4 changes: 1 addition & 3 deletions ed25519/src/hacl/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

use libcrux_macros as krml;

use libcrux_hacl_rs::bignum;
use libcrux_hacl_rs::fstar;
use libcrux_hacl_rs::lowstar;
use libcrux_hacl_rs::prelude::*;

#[inline]
fn fsum(out: &mut [u64], a: &[u64], b: &[u64]) {
Expand Down
2 changes: 2 additions & 0 deletions ed25519/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![no_std]

#[cfg(feature = "hacl")]
pub mod hacl {
//! This module contains generated hacl code.
Expand Down
32 changes: 23 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,17 @@
FSTAR_REV = inputs.fstar.rev;
};

craneLib = inputs.crane.mkLib pkgs;

ml-kem = pkgs.callPackage
({ pkgs
, lib
({ lib
, clang-tools
, cmake
, mold-wrapped
, ninja
, python3
, runCommand
, crane
, craneLib
, hax
, googletest
, benchmark
Expand All @@ -80,7 +81,6 @@
, runBenchmarks ? true
}:
let
craneLib = crane.mkLib pkgs;
src = runCommand "libcrux-src" { } ''
cp -r ${./.} $out
chmod u+w $out
Expand Down Expand Up @@ -134,8 +134,7 @@
{
inherit
googletest benchmark json
tools-environment;
crane = inputs.crane;
craneLib tools-environment;
hax =
inputs.hax.packages.${system}.default;
};
Expand All @@ -144,15 +143,30 @@
packages = {
inherit ml-kem;
};
devShells.default = pkgs.mkShell (tools-environment // {
devShells.default = craneLib.devShell (tools-environment // {
packages = [
pkgs.clang
inputs.fstar.packages.${system}.default
];

inputsFrom = [
packages.ml-kem
# Can't use `inputsFrom` because the `Cargo.lock` is not tracked by git on first evaluation.
buildInputs = [
pkgs.clang-tools
pkgs.cmake
pkgs.mold-wrapped
pkgs.ninja
pkgs.python3
inputs.hax.packages.${system}.default
];

shellHook = ''
# `Cargo.lock` need to be known to git for the flake to find it.
# Note: run `cargo generate-lockfile` to generate a real
# `Cargo.lock`. Without that nix builds will error.
touch Cargo.lock
${pkgs.git}/bin/git add --intent-to-add --force Cargo.lock
${pkgs.git}/bin/git update-index --assume-unchanged Cargo.lock
'';
});
}
);
Expand Down
6 changes: 2 additions & 4 deletions hacl-rs/src/bignum/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use libcrux_macros as krml;
use crate::prelude::*;

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use libcrux_macros as krml;

pub(crate) fn bn_karatsuba_mul_uint32(
aLen: u32,
Expand Down
6 changes: 2 additions & 4 deletions hacl-rs/src/bignum/bignum256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use libcrux_macros as krml;
use crate::prelude::*;

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use libcrux_macros as krml;

/**
Write `a + b mod 2^256` in `res`.
Expand Down
6 changes: 2 additions & 4 deletions hacl-rs/src/bignum/bignum256_32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use libcrux_macros as krml;
use crate::prelude::*;

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use libcrux_macros as krml;

/**
Write `a + b mod 2^256` in `res`.
Expand Down
4 changes: 1 addition & 3 deletions hacl-rs/src/bignum/bignum32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use crate::prelude::*;

pub type pbn_mont_ctx_u32<'a> = &'a [super::base::bn_mont_ctx_u32];

Expand Down
6 changes: 2 additions & 4 deletions hacl-rs/src/bignum/bignum4096.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use libcrux_macros as krml;
use crate::prelude::*;

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use libcrux_macros as krml;

/**
Write `a + b mod 2^4096` in `res`.
Expand Down
6 changes: 2 additions & 4 deletions hacl-rs/src/bignum/bignum4096_32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use libcrux_macros as krml;
use crate::prelude::*;

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use libcrux_macros as krml;

/**
Write `a + b mod 2^4096` in `res`.
Expand Down
4 changes: 1 addition & 3 deletions hacl-rs/src/bignum/bignum64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use crate::prelude::*;

pub type pbn_mont_ctx_u64<'a> = &'a [super::base::bn_mont_ctx_u64];

Expand Down
4 changes: 1 addition & 3 deletions hacl-rs/src/bignum/bignum_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]

use crate::fstar;
use crate::lowstar;
use crate::util as lib;
use crate::prelude::*;

#[inline]
pub(crate) fn mul_wide_add2_u32(a: u32, b: u32, c_in: u32, out: &mut [u32]) -> u32 {
Expand Down
Loading
Loading