Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
bad8015
Remove generics from hash functions
jschneider-bensch May 5, 2025
67be0e6
WIP `&mut` style
jschneider-bensch May 5, 2025
1126d17
More WIP
jschneider-bensch Aug 7, 2025
4c99559
Inline `transpose_a`
jschneider-bensch Feb 27, 2025
cb686ab
WIP `&mut` Vector ops
jschneider-bensch Aug 7, 2025
503cd5a
WIP remaining `&mut Operations` changes for Portable
jschneider-bensch May 5, 2025
a976209
Flatten matrix A
jschneider-bensch Aug 7, 2025
45f43cb
Fix merge
jschneider-bensch Aug 7, 2025
e69c099
mlkem: mutable style for neon
jschneider-bensch Aug 7, 2025
28d198f
wip: bugy c2
jschneider-bensch Aug 7, 2025
98a0e93
mlkem: fixup avx2
jschneider-bensch Aug 7, 2025
f7ebdea
mlkem: cleanup
franziskuskiefer May 8, 2025
2b431a7
added intrinsic for hax extraction;
karthikbhargavan May 11, 2025
8e86e04
fixed extraction and lax-checking for hash_functions.rs
karthikbhargavan May 11, 2025
b155e83
fixed PRFxN spec
karthikbhargavan May 11, 2025
ba2d03d
Restore F* extraction for `vector::portable::arithmetic`
jschneider-bensch May 14, 2025
8bc850f
Restore F* extraction for `vector::avx2::arithmetic`
jschneider-bensch May 14, 2025
578ade1
Restore F* extraction for `vector::portable`
jschneider-bensch Aug 7, 2025
9561937
Restore F* extraction for `vector::portable::vector_type`
jschneider-bensch Aug 7, 2025
467739e
Restore F* extraction for `vector::portable::ntt`
jschneider-bensch Aug 6, 2025
fdf9b4e
Restore F* extraction for `vector::portable::compress`
jschneider-bensch Aug 6, 2025
4f9b7df
Restore F* extraction for `vector::avx2`
jschneider-bensch Aug 6, 2025
7d200ce
Restore F* extraction for `vector::avx2::serialize`
jschneider-bensch Aug 6, 2025
59711d4
Restore F* extraction for `vector::avx2::compress`
jschneider-bensch Aug 6, 2025
8ab9e8c
Restore F* extraction for `vector::neon::vector_type`
jschneider-bensch Aug 6, 2025
f4e9b7a
Restore F* extraction for `vector::traits`
jschneider-bensch Aug 7, 2025
717f18a
Restore F* extraction for `variant`
jschneider-bensch Aug 6, 2025
87350d4
Restore F* extraction for `serialize`
jschneider-bensch Aug 6, 2025
5ca19eb
Restore F* extraction for `sampling`
jschneider-bensch Aug 6, 2025
db07bb9
Restore F* extraction for `polynomial`
jschneider-bensch Aug 6, 2025
8253b40
Restore F* extraction for `matrix`
jschneider-bensch Aug 6, 2025
a8f5baf
Restore F* extraction for `ind_cpa`
jschneider-bensch Aug 6, 2025
b22d77a
Fix type errors
jschneider-bensch Aug 6, 2025
7ce0ca8
Fix build errors
jschneider-bensch Aug 7, 2025
075968c
Truncate dummy outputs to correct length for AVX2 PRFxN
jschneider-bensch Aug 7, 2025
7dd6458
Replace `matrix::entry_mut` by direct access
jschneider-bensch Aug 7, 2025
1e660b1
Remove duplicate `requires`
jschneider-bensch Aug 7, 2025
80c5229
Squash some `DirectAndMut` errors
jschneider-bensch Aug 7, 2025
2dc30f8
Avoid mutable aliases in invNTT
jschneider-bensch Aug 7, 2025
b77072a
Avoid mutable aliases in NTT
jschneider-bensch Aug 7, 2025
20b196d
Truncate dummy output length for NEON PRFxN
jschneider-bensch Aug 7, 2025
bc38673
Reduce number of function arguments
jschneider-bensch Aug 7, 2025
4d5badd
Avoid mutable aliases in `serialize`
jschneider-bensch Aug 7, 2025
8efa4ae
Truncate dummy output length for NEON
jschneider-bensch Aug 7, 2025
2a59630
mlkem: fix to_i16_array
franziskuskiefer Aug 7, 2025
347a2df
Specify correct PRF output size
jschneider-bensch Aug 11, 2025
46a6497
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Aug 11, 2025
d3cc004
NEON: Fix `store_block` output length
jschneider-bensch Aug 11, 2025
9a2ab19
Update Kyber, incremental APIs
jschneider-bensch Aug 11, 2025
e533c41
Merge branch 'main' into franziskus/mlkem-mut
karthikbhargavan Aug 13, 2025
c4ed2cf
fixes for extraction
karthikbhargavan Aug 13, 2025
f5117f9
progress on annotations
karthikbhargavan Aug 14, 2025
8072224
fixes
karthikbhargavan Aug 19, 2025
11275c8
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Sep 22, 2025
c5cd4c5
Remove warning during extraction
jschneider-bensch Sep 23, 2025
1498ec1
Add missing core models for ML-DSA & SHA-3 extraction
jschneider-bensch Sep 24, 2025
26d39e4
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Sep 24, 2025
368567e
Use wrapper types in AVX2 when annotations expect it
jschneider-bensch Sep 24, 2025
40651e5
fixing hax extraction for aarch64
karthikbhargavan Sep 26, 2025
a279079
laxing
karthikbhargavan Sep 26, 2025
45ac17b
Merge branch 'main' into franziskus/mlkem-mut
karthikbhargavan Sep 26, 2025
b45dc3c
fmt
karthikbhargavan Sep 26, 2025
6d12eb2
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Sep 29, 2025
8d7cf1a
Drop `.clone()` for Eurydice
jschneider-bensch Sep 29, 2025
88bb93f
Eurydice change
jschneider-bensch Sep 29, 2025
88407b6
Don't expose verbose `unreachable!` to Eurydice
jschneider-bensch Sep 29, 2025
f6cd908
Workaround Eurydice matrix indexing bug
franziskuskiefer Sep 29, 2025
d7975e9
Add missing intrinsic
franziskuskiefer Sep 29, 2025
38d4d0d
C code update
jschneider-bensch Sep 29, 2025
6a756e9
Add hax-compatible version of `sample_from_uniform_distribution_next`
jschneider-bensch Sep 30, 2025
a837664
fixed two proofs
karthikbhargavan Oct 3, 2025
30a99ff
progress on propagating annotations
karthikbhargavan Oct 3, 2025
fa8752c
progress on propagation
karthikbhargavan Oct 6, 2025
cd3681e
fixed some interfaces
karthikbhargavan Oct 6, 2025
fa47d7d
Merge branch 'main' into franziskus/mlkem-mut
karthikbhargavan Oct 6, 2025
2f2ef80
fixed all fsti files, some fsts still do not typecheck
karthikbhargavan Oct 6, 2025
5b8c491
a couple more modules fixed
karthikbhargavan Oct 7, 2025
d8f4269
avx2 module
karthikbhargavan Oct 7, 2025
6a7cd14
one more module
karthikbhargavan Oct 7, 2025
e0d1484
serialize fixed
karthikbhargavan Oct 8, 2025
bdff039
updated spec
karthikbhargavan Oct 8, 2025
7015798
updated spec
karthikbhargavan Oct 8, 2025
e568fd2
fixes to ind-cca instantiations
karthikbhargavan Oct 9, 2025
2b5ee92
wip
karthikbhargavan Oct 9, 2025
2416533
fixed multiplexing
karthikbhargavan Oct 9, 2025
b99588e
portable arithmetic fix
karthikbhargavan Oct 9, 2025
db67fbf
Merge branch 'main' into franziskus/mlkem-mut
karthikbhargavan Oct 14, 2025
17675bf
Fix AVX2 build
jschneider-bensch Oct 15, 2025
9c2a5d6
Align Kyber APIs to ML-KEM APIs
jschneider-bensch Oct 20, 2025
2469cec
Cleanup
jschneider-bensch Oct 20, 2025
b5d7db8
Negation is implemented on secret integers now
jschneider-bensch Oct 20, 2025
f62b85f
Repair KEM-API secret independence
jschneider-bensch Oct 20, 2025
c0508f1
Refresh C extraction
jschneider-bensch Oct 20, 2025
b090806
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Oct 20, 2025
606268f
Formatting
jschneider-bensch Oct 20, 2025
d0f3b2f
Fix clippy warnings & make clones explicit
jschneider-bensch Oct 21, 2025
61a2cc1
Fix
jschneider-bensch Oct 21, 2025
bccb526
Revert explicit copies
jschneider-bensch Oct 22, 2025
fcc7bff
Update C extraction
jschneider-bensch Oct 22, 2025
4c59b3f
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Oct 22, 2025
bf73a8a
Use copies to initialize `PolynomialRing<Vector>` and `Vector` arrays
jschneider-bensch Oct 22, 2025
b1e8dce
Update C extractions
jschneider-bensch Oct 22, 2025
0e6f3cd
disable proofs for some modules
karthikbhargavan Nov 3, 2025
8d6c5f2
updated verification status
karthikbhargavan Nov 3, 2025
c3da530
Merge branch 'main' into franziskus/mlkem-mut
jschneider-bensch Nov 11, 2025
c79ebe0
Update verification claims
jschneider-bensch Nov 11, 2025
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
12 changes: 12 additions & 0 deletions fstar-helpers/core-models/src/core_arch/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ pub mod avx {
pub fn _mm256_set1_epi16(_: i16) -> __m256i {
unimplemented!()
}

/// [Intel Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_set1_epi8)
#[hax_lib::opaque]
pub fn _mm256_set1_epi8(_: i8) -> __m256i {
unimplemented!()
}
}
pub use avx2::*;
pub mod avx2 {
Expand Down Expand Up @@ -547,6 +553,12 @@ pub mod avx2 {
unimplemented!()
}

/// [Intel Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_sign_epi16)
#[hax_lib::opaque]
pub fn _mm256_sign_epi16(_: __m256i, _: __m256i) -> __m256i {
unimplemented!()
}

/// [Intel Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_mullo_epi32)
#[hax_lib::opaque]
pub fn _mm256_mullo_epi32(_: __m256i, _: __m256i) -> __m256i {
Expand Down
5 changes: 5 additions & 0 deletions libcrux-intrinsics/src/arm64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ pub fn _vsubq_s16(lhs: int16x8_t, rhs: int16x8_t) -> int16x8_t {
unsafe { vsubq_s16(lhs, rhs) }
}

#[inline(always)]
pub fn _vnegq_s16(vec: int16x8_t) -> int16x8_t {
unsafe { vnegq_s16(vec) }
}

#[inline(always)]
pub fn _vmulq_n_s16(v: int16x8_t, c: i16) -> int16x8_t {
unsafe { vmulq_n_s16(v, c) }
Expand Down
5 changes: 5 additions & 0 deletions libcrux-intrinsics/src/arm64_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ pub fn _vsubq_s16(lhs: _int16x8_t, rhs: _int16x8_t) -> _int16x8_t {
unimplemented!()
}

#[inline(always)]
pub fn _vnegq_s16(vec: _int16x8_t) -> _int16x8_t {
unimplemented!()
}

#[inline(always)]
pub fn _vmulq_n_s16(v: _int16x8_t, c: i16) -> _int16x8_t {
unimplemented!()
Expand Down
12 changes: 12 additions & 0 deletions libcrux-intrinsics/src/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ pub fn mm256_set1_epi16(constant: i16) -> Vec256 {
unsafe { _mm256_set1_epi16(constant) }
}

#[hax_lib::opaque]
#[inline(always)]
pub fn mm256_set1_epi8(constant: i8) -> Vec256 {
unsafe { _mm256_set1_epi8(constant) }
}

#[inline(always)]
#[hax_lib::fstar::before(r#"[@@ "opaque_to_smt"]"#)]
pub fn mm256_set_epi16(
Expand Down Expand Up @@ -369,6 +375,12 @@ pub fn mm256_sign_epi32(a: Vec256, b: Vec256) -> Vec256 {
unsafe { _mm256_sign_epi32(a, b) }
}

#[inline(always)]
#[hax_lib::fstar::before(r#"[@@ "opaque_to_smt"]"#)]
pub fn mm256_sign_epi16(a: Vec256, b: Vec256) -> Vec256 {
unsafe { _mm256_sign_epi16(a, b) }
}

#[inline(always)]
#[hax_lib::fstar::before(r#"[@@ "opaque_to_smt"]"#)]
pub fn mm256_castsi256_ps(a: Vec256) -> Vec256Float {
Expand Down
5 changes: 5 additions & 0 deletions libcrux-intrinsics/src/avx2_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ pub fn mm256_sign_epi32(a: Vec256, b: Vec256) -> Vec256 {
unimplemented!()
}

#[inline(always)]
pub fn mm256_sign_epi16(a: Vec256, b: Vec256) -> Vec256 {
unimplemented!()
}

#[inline(always)]
pub fn mm256_castsi256_ps(a: Vec256) -> Vec256Float {
unimplemented!()
Expand Down
9 changes: 6 additions & 3 deletions libcrux-ml-kem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ This crate implements all three ML-KEM ([FIPS 203](https://csrc.nist.gov/pubs/fi
For each algorithm, it inlcudes a portable Rust implementation, as well as SIMD implementations for Intel AVX2 and AArch64 Neon platforms.

## Verification
![verified]
![pre-verification]

The portable and AVX2 code for field arithmetic, NTT polynomial arithmetic, serialization, and the generic code for high-level algorithms
For [release `0.0.4`](https://crates.io/crates/libcrux-ml-kem/0.0.4) of this crate, the portable and AVX2 code for field arithmetic, NTT polynomial arithmetic, serialization, and the generic code for high-level algorithms
is formally verified using [hax](https://cryspen.com/hax) and [F*](https://fstar-lang.org).

Please refer to [this file](proofs/verification_status.md) for detail on the verification of this crate.
⚠️ In comparison, this current, *unreleased*, version of the crate (`HEAD` of branch `main`) introduces a number of open proof obligations, which we aim to resolve before the next release.

Please refer to [this file](proofs/verification_status.md) for details on the current verification of this crate and comparison to the `0.0.4` release.

[verified]: https://img.shields.io/badge/verified-brightgreen.svg?style=for-the-badge&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik05IDEyTDExIDE0TDE1IDkuOTk5OTlNMjAgMTJDMjAgMTYuNDYxMSAxNC41NCAxOS42OTM3IDEyLjY0MTQgMjAuNjgzQzEyLjQzNjEgMjAuNzkgMTIuMzMzNCAyMC44NDM1IDEyLjE5MSAyMC44NzEyQzEyLjA4IDIwLjg5MjggMTEuOTIgMjAuODkyOCAxMS44MDkgMjAuODcxMkMxMS42NjY2IDIwLjg0MzUgMTEuNTYzOSAyMC43OSAxMS4zNTg2IDIwLjY4M0M5LjQ1OTk2IDE5LjY5MzcgNCAxNi40NjExIDQgMTJWOC4yM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ml-kem/extracts/c/generated/code_gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ This code was generated with the following revisions:
Charon: 667d2fc98984ff7f3df989c2367e6c1fa4a000e7
Eurydice: 2381cbc416ef2ad0b561c362c500bc84f36b6785
Karamel: 80f5435f2fc505973c469a4afcc8d875cddd0d8b
F*: 71d8221589d4d438af3706d89cb653cf53e18aab
Libcrux: 68dfed5a4a9e40277f62828471c029afed1ecdcc
F*: unset
Libcrux: bf73a8a7a0f119e66b105a3462265b4a2a3af63b
4 changes: 2 additions & 2 deletions libcrux-ml-kem/extracts/c/generated/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
* Charon: 667d2fc98984ff7f3df989c2367e6c1fa4a000e7
* Eurydice: 2381cbc416ef2ad0b561c362c500bc84f36b6785
* Karamel: 80f5435f2fc505973c469a4afcc8d875cddd0d8b
* F*: 71d8221589d4d438af3706d89cb653cf53e18aab
* Libcrux: 68dfed5a4a9e40277f62828471c029afed1ecdcc
* F*: unset
* Libcrux: bf73a8a7a0f119e66b105a3462265b4a2a3af63b
*/
164 changes: 25 additions & 139 deletions libcrux-ml-kem/extracts/c/generated/internal/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Charon: 667d2fc98984ff7f3df989c2367e6c1fa4a000e7
* Eurydice: 2381cbc416ef2ad0b561c362c500bc84f36b6785
* Karamel: 80f5435f2fc505973c469a4afcc8d875cddd0d8b
* F*: 71d8221589d4d438af3706d89cb653cf53e18aab
* Libcrux: 68dfed5a4a9e40277f62828471c029afed1ecdcc
* F*: unset
* Libcrux: bf73a8a7a0f119e66b105a3462265b4a2a3af63b
*/

#ifndef internal_libcrux_core_H
Expand Down Expand Up @@ -38,11 +38,9 @@ static inline uint64_t core_num__u64__rotate_left(uint64_t x0, uint32_t x1);

static inline void core_num__u64__to_le_bytes(uint64_t x0, uint8_t x1[8U]);

#define LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE ((size_t)32U)

void libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time(
Eurydice_slice lhs_c, Eurydice_slice rhs_c, Eurydice_slice lhs_s,
Eurydice_slice rhs_s, uint8_t ret[32U]);
Eurydice_slice rhs_s, Eurydice_slice out);

#define LIBCRUX_ML_KEM_CONSTANTS_BITS_PER_COEFFICIENT ((size_t)12U)

Expand All @@ -58,6 +56,8 @@ void libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_i

#define LIBCRUX_ML_KEM_CONSTANTS_H_DIGEST_SIZE ((size_t)32U)

#define LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE ((size_t)32U)

/**
K * BITS_PER_RING_ELEMENT / 8

Expand All @@ -66,8 +66,6 @@ void libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_i
*/
size_t libcrux_ml_kem_constants_ranked_bytes_per_ring_element(size_t rank);

int16_t libcrux_secrets_int_I16(int16_t v);

/**
This function found in impl {libcrux_secrets::traits::Classify<T> for T}
*/
Expand All @@ -78,6 +76,16 @@ with types int16_t
*/
int16_t libcrux_secrets_int_public_integers_classify_27_39(int16_t self);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t

*/
uint8_t libcrux_secrets_int_public_integers_declassify_d8_90(uint8_t self);

/**
This function found in impl {libcrux_secrets::int::CastOps for u8}
*/
Expand Down Expand Up @@ -153,16 +161,6 @@ This function found in impl {libcrux_secrets::int::CastOps for i16}
*/
int16_t libcrux_secrets_int_as_i16_f5(int16_t self);

typedef struct libcrux_ml_kem_utils_extraction_helper_Keypair1024_s {
uint8_t fst[1536U];
uint8_t snd[1568U];
} libcrux_ml_kem_utils_extraction_helper_Keypair1024;

typedef struct libcrux_ml_kem_utils_extraction_helper_Keypair768_s {
uint8_t fst[1152U];
uint8_t snd[1184U];
} libcrux_ml_kem_utils_extraction_helper_Keypair768;

/**
This function found in impl
{libcrux_ml_kem::types::MlKemKeyPair<PRIVATE_KEY_SIZE, PUBLIC_KEY_SIZE>}
Expand Down Expand Up @@ -190,15 +188,16 @@ libcrux_ml_kem_types_MlKemPrivateKey_83 libcrux_ml_kem_types_from_77_39(
uint8_t value[3168U]);

/**
This function found in impl {libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
This function found in impl {core::default::Default for
libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
*/
/**
A monomorphic instance of libcrux_ml_kem.types.as_slice_a9
A monomorphic instance of libcrux_ml_kem.types.default_73
with const generics
- SIZE= 1568
*/
uint8_t *libcrux_ml_kem_types_as_slice_a9_af(
libcrux_ml_kem_types_MlKemCiphertext_64 *self);
libcrux_ml_kem_types_MlKemCiphertext_64 libcrux_ml_kem_types_default_73_af(
void);

/**
This function found in impl
Expand Down Expand Up @@ -227,15 +226,16 @@ libcrux_ml_kem_types_MlKemPrivateKey_d9 libcrux_ml_kem_types_from_77_28(
uint8_t value[2400U]);

/**
This function found in impl {libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
This function found in impl {core::default::Default for
libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
*/
/**
A monomorphic instance of libcrux_ml_kem.types.as_slice_a9
A monomorphic instance of libcrux_ml_kem.types.default_73
with const generics
- SIZE= 1088
*/
uint8_t *libcrux_ml_kem_types_as_slice_a9_80(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self);
libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_default_73_80(
void);

/**
This function found in impl {libcrux_ml_kem::types::MlKemPublicKey<SIZE>}
Expand Down Expand Up @@ -286,18 +286,6 @@ with const generics
Eurydice_slice_uint8_t_x4 libcrux_ml_kem_types_unpack_private_key_b4(
Eurydice_slice private_key);

/**
This function found in impl {core::convert::From<@Array<u8, SIZE>> for
libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
*/
/**
A monomorphic instance of libcrux_ml_kem.types.from_e0
with const generics
- SIZE= 1088
*/
libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_e0_80(
uint8_t value[1088U]);

/**
A monomorphic instance of libcrux_ml_kem.utils.prf_input_inc
with const generics
Expand Down Expand Up @@ -406,18 +394,6 @@ with const generics
void libcrux_ml_kem_utils_into_padded_array_b6(Eurydice_slice slice,
uint8_t ret[34U]);

/**
This function found in impl {core::convert::From<@Array<u8, SIZE>> for
libcrux_ml_kem::types::MlKemCiphertext<SIZE>}
*/
/**
A monomorphic instance of libcrux_ml_kem.types.from_e0
with const generics
- SIZE= 1568
*/
libcrux_ml_kem_types_MlKemCiphertext_64 libcrux_ml_kem_types_from_e0_af(
uint8_t value[1568U]);

/**
A monomorphic instance of libcrux_ml_kem.utils.prf_input_inc
with const generics
Expand Down Expand Up @@ -471,72 +447,6 @@ with const generics
void libcrux_ml_kem_utils_into_padded_array_24(Eurydice_slice slice,
uint8_t ret[64U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[24size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_d2(uint8_t self[24U],
uint8_t ret[24U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[22size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_fa(uint8_t self[22U],
uint8_t ret[22U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[20size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_57(uint8_t self[20U],
uint8_t ret[20U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[10size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_cc(uint8_t self[10U],
uint8_t ret[10U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[8size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_76(uint8_t self[8U],
uint8_t ret[8U]);

/**
This function found in impl {libcrux_secrets::traits::Declassify<T> for T}
*/
/**
A monomorphic instance of libcrux_secrets.int.public_integers.declassify_d8
with types uint8_t[2size_t]

*/
void libcrux_secrets_int_public_integers_declassify_d8_d4(uint8_t self[2U],
uint8_t ret[2U]);

/**
Classify a mutable slice (identity)
We define a separate function for this because hax has limited support for
Expand Down Expand Up @@ -585,30 +495,6 @@ with types int16_t
Eurydice_slice libcrux_secrets_int_classify_public_classify_ref_9b_39(
Eurydice_slice self);

/**
A monomorphic instance of core.result.Result
with types int16_t[16size_t], core_array_TryFromSliceError

*/
typedef struct core_result_Result_0a_s {
core_result_Result_fb_tags tag;
union {
int16_t case_Ok[16U];
core_array_TryFromSliceError case_Err;
} val;
} core_result_Result_0a;

/**
This function found in impl {core::result::Result<T, E>[TraitClause@0,
TraitClause@1]}
*/
/**
A monomorphic instance of core.result.unwrap_26
with types int16_t[16size_t], core_array_TryFromSliceError

*/
void core_result_unwrap_26_00(core_result_Result_0a self, int16_t ret[16U]);

/**
This function found in impl {libcrux_secrets::traits::Classify<T> for T}
*/
Expand Down
Loading
Loading