From fa71b36a9094873bbd35ff3d30dfc09509dea8d6 Mon Sep 17 00:00:00 2001 From: mamonet Date: Tue, 17 Sep 2024 16:51:08 +0000 Subject: [PATCH 01/14] Add conditions for generic compress and serialize functions --- libcrux-ml-kem/src/serialize.rs | 107 +++++++++++++----- libcrux-ml-kem/src/vector/avx2.rs | 20 +++- libcrux-ml-kem/src/vector/portable.rs | 30 +++-- .../src/vector/portable/compress.rs | 59 ++++++++-- libcrux-ml-kem/src/vector/traits.rs | 24 +++- 5 files changed, 188 insertions(+), 52 deletions(-) diff --git a/libcrux-ml-kem/src/serialize.rs b/libcrux-ml-kem/src/serialize.rs index 5ca732a6b..58765f1aa 100644 --- a/libcrux-ml-kem/src/serialize.rs +++ b/libcrux-ml-kem/src/serialize.rs @@ -2,17 +2,39 @@ use crate::{ constants::{COEFFICIENTS_IN_RING_ELEMENT, BYTES_PER_RING_ELEMENT, SHARED_SECRET_SIZE}, helper::cloop, polynomial::{PolynomialRingElement, VECTORS_IN_RING_ELEMENT}, - vector::{decompress_1, to_unsigned_representative, Operations}, + vector::{decompress_1, to_unsigned_representative, Operations, FIELD_MODULUS}, }; #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $a) i) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $a) i) < v $FIELD_MODULUS"))] +#[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $result) i) >= 0 /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $result) i) < v $FIELD_MODULUS"))] +pub(super) fn to_unsigned_field_modulus( + a: Vector, +) -> Vector { + to_unsigned_representative::(a) +} + +#[inline(always)] +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> + (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS)"))] pub(super) fn compress_then_serialize_message( re: PolynomialRingElement, ) -> [u8; SHARED_SECRET_SIZE] { let mut serialized = [0u8; SHARED_SECRET_SIZE]; for i in 0..16 { - let coefficient = to_unsigned_representative::(re.coefficients[i]); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS)") }); + hax_lib::fstar!("assert (2 * v $i + 2 <= 32)"); + let coefficient = to_unsigned_field_modulus(re.coefficients[i]); let coefficient_compressed = Vector::compress_1(coefficient); let bytes = Vector::serialize_1(coefficient_compressed); @@ -34,13 +56,23 @@ pub(super) fn deserialize_then_decompress_message( } #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] +#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> + (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS)"))] pub(super) fn serialize_uncompressed_ring_element( re: &PolynomialRingElement, ) -> [u8; BYTES_PER_RING_ELEMENT] { + hax_lib::fstar!("assert_norm (pow2 12 == 4096)"); let mut serialized = [0u8; BYTES_PER_RING_ELEMENT]; for i in 0..VECTORS_IN_RING_ELEMENT { - let coefficient = to_unsigned_representative::(re.coefficients[i]); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + hax_lib::fstar!("assert (24 * v $i + 24 <= 384)"); + let coefficient = to_unsigned_field_modulus(re.coefficients[i]); let bytes = Vector::serialize_12(coefficient); serialized[24 * i..24 * i + 24].copy_from_slice(&bytes); @@ -117,17 +149,24 @@ pub(super) fn deserialize_ring_elements_reduced< } #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] -#[hax_lib::requires( - OUT_LEN == 320 -)] +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] +#[hax_lib::requires(fstar!("v $OUT_LEN == 320 /\\ (forall (i:nat). i < 16 ==> + (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] fn compress_then_serialize_10( re: &PolynomialRingElement, ) -> [u8; OUT_LEN] { + hax_lib::fstar!("assert_norm (pow2 10 == 1024)"); let mut serialized = [0u8; OUT_LEN]; for i in 0..VECTORS_IN_RING_ELEMENT { + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + hax_lib::fstar!("assert (20 * v $i + 20 <= 320)"); let coefficient = - Vector::compress::<10>(to_unsigned_representative::(re.coefficients[i])); + Vector::compress::<10>(to_unsigned_field_modulus(re.coefficients[i])); let bytes = Vector::serialize_10(coefficient); serialized[20 * i..20 * i + 20].copy_from_slice(&bytes); @@ -137,9 +176,6 @@ fn compress_then_serialize_10( #[inline(always)] #[hax_lib::fstar::verification_status(lax)] -#[hax_lib::requires( - OUT_LEN == 352 -)] fn compress_then_serialize_11( re: &PolynomialRingElement, ) -> [u8; OUT_LEN] { @@ -155,10 +191,11 @@ fn compress_then_serialize_11( } #[inline(always)] -#[hax_lib::requires( - (COMPRESSION_FACTOR == 10 || COMPRESSION_FACTOR == 11) && - OUT_LEN == 32 * COMPRESSION_FACTOR -)] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] +#[hax_lib::requires(fstar!("(v $COMPRESSION_FACTOR == 10 \\/ v $COMPRESSION_FACTOR == 11) /\\ v $OUT_LEN == 32 * v $COMPRESSION_FACTOR /\\ + (forall (i:nat). i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] pub(super) fn compress_then_serialize_ring_element_u< const COMPRESSION_FACTOR: usize, const OUT_LEN: usize, @@ -168,7 +205,8 @@ pub(super) fn compress_then_serialize_ring_element_u< ) -> [u8; OUT_LEN] { hax_lib::fstar!("assert ( (v (cast $COMPRESSION_FACTOR <: u32) == 10) \\/ - (v (cast $COMPRESSION_FACTOR <: u32) == 11))"); + (v (cast $COMPRESSION_FACTOR <: u32) == 11)); + Rust_primitives.Integers.mk_int_equiv_lemma #usize_inttype (v $COMPRESSION_FACTOR)"); match COMPRESSION_FACTOR as u32 { 10 => compress_then_serialize_10(re), 11 => compress_then_serialize_11(re), @@ -177,21 +215,29 @@ pub(super) fn compress_then_serialize_ring_element_u< } #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] -#[hax_lib::requires( - serialized.len() == 128 -)] +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] +#[hax_lib::requires(fstar!("Seq.length $serialized == 128 /\\ (forall (i:nat). i < 16 ==> + (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] fn compress_then_serialize_4( re: PolynomialRingElement, serialized: &mut [u8], ) { + hax_lib::fstar!("assert_norm (pow2 4 == 16)"); let _serialized_len = serialized.len(); // The semicolon and parentheses at the end of loop are a workaround // for the following bug https://github.com/hacspec/hax/issues/720 for i in 0..VECTORS_IN_RING_ELEMENT { - hax_lib::loop_invariant!(|i: usize| serialized.len() == _serialized_len); + // NOTE: Using `$serialized` in loop_invariant doesn't work here + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ + Seq.length serialized == v $_serialized_len /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + hax_lib::fstar!("assert (8 * v $i + 8 <= 128)"); let coefficient = - Vector::compress::<4>(to_unsigned_representative::(re.coefficients[i])); + Vector::compress::<4>(to_unsigned_field_modulus(re.coefficients[i])); let bytes = Vector::serialize_4(coefficient); serialized[8 * i..8 * i + 8].copy_from_slice(&bytes); @@ -223,11 +269,11 @@ fn compress_then_serialize_5( } #[inline(always)] -#[hax_lib::requires( - (COMPRESSION_FACTOR == 4 || COMPRESSION_FACTOR == 5) && - OUT_LEN == 32 * COMPRESSION_FACTOR && - out.len() == OUT_LEN -)] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] +#[hax_lib::requires(fstar!("(v $COMPRESSION_FACTOR == 4 \\/ v $COMPRESSION_FACTOR == 5) /\\ v $OUT_LEN == 32 * v $COMPRESSION_FACTOR /\\ + Seq.length $out == v $OUT_LEN /\\ (forall (i:nat). i < 16 ==> (forall (j:nat). j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] #[hax_lib::ensures(|_| fstar!("${out_future.len()} == ${out.len()}") )] @@ -241,7 +287,8 @@ pub(super) fn compress_then_serialize_ring_element_v< ) { hax_lib::fstar!("assert ( (v (cast $COMPRESSION_FACTOR <: u32) == 4) \\/ - (v (cast $COMPRESSION_FACTOR <: u32) == 5))"); + (v (cast $COMPRESSION_FACTOR <: u32) == 5)); + Rust_primitives.Integers.mk_int_equiv_lemma #usize_inttype (v $COMPRESSION_FACTOR)"); match COMPRESSION_FACTOR as u32 { 4 => compress_then_serialize_4(re, out), 5 => compress_then_serialize_5(re, out), diff --git a/libcrux-ml-kem/src/vector/avx2.rs b/libcrux-ml-kem/src/vector/avx2.rs index e5a205174..c3c3368f2 100644 --- a/libcrux-ml-kem/src/vector/avx2.rs +++ b/libcrux-ml-kem/src/vector/avx2.rs @@ -7,6 +7,8 @@ mod ntt; mod sampling; mod serialize; +use crate::vector::FIELD_MODULUS; + #[derive(Clone, Copy)] #[hax_lib::fstar::before(interface,"noeq")] #[hax_lib::fstar::after(interface,"let repr (x:t_SIMD256Vector) : t_Array i16 (sz 16) = Libcrux_intrinsics.Avx2_extract.vec256_as_i16x16 x.f_elements")] @@ -127,15 +129,29 @@ impl Operations for SIMD256Vector { } } + #[requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $vector) i) >= 0 /\\ + v (Seq.index (impl.f_repr $vector) i) < v $FIELD_MODULUS"))] + #[ensures(|out| fstar!("forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) 1"))] fn compress_1(vector: Self) -> Self { + hax_lib::fstar!("admit()"); Self { elements: compress::compress_message_coefficient(vector.elements), } } - #[requires(COEFFICIENT_BITS == 4 || COEFFICIENT_BITS == 5 || - COEFFICIENT_BITS == 10 || COEFFICIENT_BITS == 11)] + #[requires(fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) /\\ + (forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $vector) i) >= 0 /\\ + v (Seq.index (impl.f_repr $vector) i) < v $FIELD_MODULUS)"))] + #[ensures(|out| fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) ==> + (forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) (v $COEFFICIENT_BITS))"))] fn compress(vector: Self) -> Self { + hax_lib::fstar!("admit()"); Self { elements: compress::compress_ciphertext_coefficient::( vector.elements, diff --git a/libcrux-ml-kem/src/vector/portable.rs b/libcrux-ml-kem/src/vector/portable.rs index 1b34df9bc..144ee6ada 100644 --- a/libcrux-ml-kem/src/vector/portable.rs +++ b/libcrux-ml-kem/src/vector/portable.rs @@ -15,6 +15,8 @@ use vector_type::*; pub(crate) use vector_type::PortableVector; +use crate::vector::FIELD_MODULUS; + #[cfg(hax)] impl crate::vector::traits::Repr for PortableVector { fn repr(x: Self) -> [i16; 16] { @@ -83,14 +85,26 @@ impl Operations for PortableVector { montgomery_multiply_by_constant(v, r) } - fn compress_1(v: Self) -> Self { - compress_1(v) - } - - #[requires(COEFFICIENT_BITS == 4 || COEFFICIENT_BITS == 5 || - COEFFICIENT_BITS == 10 || COEFFICIENT_BITS == 11)] - fn compress(v: Self) -> Self { - compress::(v) + #[requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $a) i) >= 0 /\\ + v (Seq.index (impl.f_repr $a) i) < v $FIELD_MODULUS"))] + #[ensures(|out| fstar!("forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) 1"))] + fn compress_1(a: Self) -> Self { + compress_1(a) + } + + #[requires(fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) /\\ + (forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $a) i) >= 0 /\\ + v (Seq.index (impl.f_repr $a) i) < v $FIELD_MODULUS)"))] + #[ensures(|out| fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) ==> + (forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) (v $COEFFICIENT_BITS))"))] + fn compress(a: Self) -> Self { + compress::(a) } #[requires(COEFFICIENT_BITS == 4 || COEFFICIENT_BITS == 5 || diff --git a/libcrux-ml-kem/src/vector/portable/compress.rs b/libcrux-ml-kem/src/vector/portable/compress.rs index dab3e8190..8183d26d5 100644 --- a/libcrux-ml-kem/src/vector/portable/compress.rs +++ b/libcrux-ml-kem/src/vector/portable/compress.rs @@ -84,21 +84,66 @@ pub(crate) fn compress_ciphertext_coefficient(coefficient_bits: u8, fe: u16) -> } #[inline(always)] -pub(crate) fn compress_1(mut v: PortableVector) -> PortableVector { +#[cfg_attr(hax, hax_lib::fstar::before(" +let compress_message_coefficient_range_helper (fe: u16) : Lemma + (requires fe <. (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16)) + (ensures v (cast (compress_message_coefficient fe) <: i16) >= 0 /\\ + v (cast (compress_message_coefficient fe) <: i16) < 2) = + assert (v (cast (compress_message_coefficient fe) <: i16) >= 0 /\\ + v (cast (compress_message_coefficient fe) <: i16) < 2) +"))] +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 2000")] +#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index ${a}.f_elements i) >= 0 /\\ + v (Seq.index ${a}.f_elements i) < v $FIELD_MODULUS"))] +#[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> v (${result}.f_elements.[ sz i ] <: i16) >= 0 /\\ + v (${result}.f_elements.[ sz i ] <: i16) < 2"))] +pub(crate) fn compress_1(mut a: PortableVector) -> PortableVector { + hax_lib::fstar!("assert (forall (i:nat). i < 16 ==> (cast (${a}.f_elements.[ sz i ]) <: u16) <. + (cast ($FIELD_MODULUS) <: u16))"); for i in 0..FIELD_ELEMENTS_IN_VECTOR { - v.elements[i] = compress_message_coefficient(v.elements[i] as u16) as i16; + hax_lib::loop_invariant!(|i: usize| { fstar!("(v $i < 16 ==> (forall (j:nat). (j >= v $i /\\ j < 16) ==> + v (cast (${a}.f_elements.[ sz j ]) <: u16) < v (cast ($FIELD_MODULUS) <: u16))) /\\ + (forall (j:nat). j < v $i ==> v (${a}.f_elements.[ sz j ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ sz j ] <: i16) < 2)") }); + hax_lib::fstar!("compress_message_coefficient_range_helper (cast (${a}.f_elements.[ $i ]) <: u16)"); + a.elements[i] = compress_message_coefficient(a.elements[i] as u16) as i16; + hax_lib::fstar!("assert (v (${a}.f_elements.[ $i ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ $i ] <: i16) < 2)"); } - v + hax_lib::fstar!("assert (forall (i:nat). i < 16 ==> v (${a}.f_elements.[ sz i ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ sz i ] <: i16) < 2)"); + a } #[inline(always)] -pub(crate) fn compress(mut v: PortableVector) -> PortableVector { +#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 2000")] +#[hax_lib::requires(fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) /\\ + (forall (i:nat). i < 16 ==> v (Seq.index ${a}.f_elements i) >= 0 /\\ + v (Seq.index ${a}.f_elements i) < v $FIELD_MODULUS)"))] +#[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> v (${result}.f_elements.[ sz i ] <: i16) >= 0 /\\ + v (${result}.f_elements.[ sz i ] <: i16) < pow2 (v $COEFFICIENT_BITS))"))] +pub(crate) fn compress(mut a: PortableVector) -> PortableVector { + hax_lib::fstar!("assert (v (cast ($COEFFICIENT_BITS) <: u8) == v $COEFFICIENT_BITS); + assert (v (cast ($COEFFICIENT_BITS) <: u32) == v $COEFFICIENT_BITS)"); + hax_lib::fstar!("assert (forall (i:nat). i < 16 ==> (cast (${a}.f_elements.[ sz i ]) <: u16) <. + (cast ($FIELD_MODULUS) <: u16))"); for i in 0..FIELD_ELEMENTS_IN_VECTOR { - v.elements[i] = - compress_ciphertext_coefficient(COEFFICIENT_BITS as u8, v.elements[i] as u16) as i16; + hax_lib::loop_invariant!(|i: usize| { fstar!("(v $i < 16 ==> (forall (j:nat). (j >= v $i /\\ j < 16) ==> + v (cast (${a}.f_elements.[ sz j ]) <: u16) < v (cast ($FIELD_MODULUS) <: u16))) /\\ + (forall (j:nat). j < v $i ==> v (${a}.f_elements.[ sz j ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ sz j ] <: i16) < pow2 (v (cast ($COEFFICIENT_BITS) <: u32)))") }); + a.elements[i] = + compress_ciphertext_coefficient(COEFFICIENT_BITS as u8, a.elements[i] as u16) as i16; + hax_lib::fstar!("assert (v (${a}.f_elements.[ $i ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ $i ] <: i16) < pow2 (v (cast ($COEFFICIENT_BITS) <: u32)))"); } - v + hax_lib::fstar!("assert (forall (i:nat). i < 16 ==> v (${a}.f_elements.[ sz i ] <: i16) >= 0 /\\ + v (${a}.f_elements.[ sz i ] <: i16) < pow2 (v $COEFFICIENT_BITS))"); + a } #[inline(always)] diff --git a/libcrux-ml-kem/src/vector/traits.rs b/libcrux-ml-kem/src/vector/traits.rs index d965a9581..1ee052c22 100644 --- a/libcrux-ml-kem/src/vector/traits.rs +++ b/libcrux-ml-kem/src/vector/traits.rs @@ -63,11 +63,22 @@ pub trait Operations: Copy + Clone + Repr { fn montgomery_multiply_by_constant(v: Self, c: i16) -> Self; // Compression - #[requires(true)] - fn compress_1(v: Self) -> Self; - #[requires(COEFFICIENT_BITS == 4 || COEFFICIENT_BITS == 5 || - COEFFICIENT_BITS == 10 || COEFFICIENT_BITS == 11)] - fn compress(v: Self) -> Self; + #[requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index (f_repr $a) i) >= 0 /\\ + v (Seq.index (f_repr $a) i) < 3329"))] + #[ensures(|result| fstar!("forall (i:nat). i < 16 ==> bounded (Seq.index (f_repr $result) i) 1"))] + fn compress_1(a: Self) -> Self; + #[requires(fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) /\\ + (forall (i:nat). i < 16 ==> v (Seq.index (f_repr $a) i) >= 0 /\\ + v (Seq.index (f_repr $a) i) < 3329)"))] + #[ensures(|result| fstar!("(v $COEFFICIENT_BITS == 4 \\/ + v $COEFFICIENT_BITS == 5 \\/ + v $COEFFICIENT_BITS == 10 \\/ + v $COEFFICIENT_BITS == 11) ==> + (forall (i:nat). i < 16 ==> bounded (Seq.index (f_repr $result) i) (v $COEFFICIENT_BITS))"))] + fn compress(a: Self) -> Self; #[requires(COEFFICIENT_BITS == 4 || COEFFICIENT_BITS == 5 || COEFFICIENT_BITS == 10 || COEFFICIENT_BITS == 11)] fn decompress_ciphertext_coefficient(v: Self) -> Self; @@ -186,6 +197,9 @@ pub fn to_standard_domain(v: T) -> T { T::montgomery_multiply_by_constant(v, MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS as i16) } +#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::ensures(|result| fstar!("f_to_i16_array $result == Spec.Utils.map2 (+.) (f_to_i16_array $a) + (Spec.Utils.map_array (fun x -> (x >>! 15l) &. $FIELD_MODULUS) (f_to_i16_array $a))"))] pub fn to_unsigned_representative(a: T) -> T { let t = T::shift_right::<15>(a); let fm = T::bitwise_and_with_constant(t, FIELD_MODULUS); From 9ab86ed4b3df8e0f56f6aedbea0c5bf1556b2541 Mon Sep 17 00:00:00 2001 From: mamonet Date: Tue, 17 Sep 2024 16:54:48 +0000 Subject: [PATCH 02/14] Update F* files --- .../extraction/Libcrux_ml_kem.Serialize.fst | 131 ++++++++++--- .../extraction/Libcrux_ml_kem.Serialize.fsti | 127 +++++++++++- .../Libcrux_ml_kem.Vector.Avx2.fsti | 29 ++- ...ibcrux_ml_kem.Vector.Portable.Compress.fst | 184 ++++++++++++------ ...bcrux_ml_kem.Vector.Portable.Compress.fsti | 33 +++- .../Libcrux_ml_kem.Vector.Portable.fst | 15 ++ .../Libcrux_ml_kem.Vector.Portable.fsti | 35 ++-- .../Libcrux_ml_kem.Vector.Traits.fst | 4 +- .../Libcrux_ml_kem.Vector.Traits.fsti | 37 +++- 9 files changed, 470 insertions(+), 125 deletions(-) create mode 100644 libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fst diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst index 0aff4b996..b30651d80 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst @@ -9,7 +9,18 @@ let _ = let open Libcrux_ml_kem.Vector.Traits in () -#push-options "--admit_smt_queries true" +let to_unsigned_field_modulus + (#v_Vector: Type0) + (#[FStar.Tactics.Typeclasses.tcresolve ()] + i1: + Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector) + (a: v_Vector) + = + let result:v_Vector = Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector a in + let _:Prims.unit = admit () (* Panic freedom *) in + result + +#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" let compress_then_serialize_10_ (v_OUT_LEN: usize) @@ -19,23 +30,37 @@ let compress_then_serialize_10_ Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector) (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = + let _:Prims.unit = assert_norm (pow2 10 == 1024) in let serialized:t_Array u8 v_OUT_LEN = Rust_primitives.Hax.repeat 0uy v_OUT_LEN in let serialized:t_Array u8 v_OUT_LEN = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Polynomial.v_VECTORS_IN_RING_ELEMENT - (fun serialized temp_1_ -> + (fun serialized i -> let serialized:t_Array u8 v_OUT_LEN = serialized in - let _:usize = temp_1_ in - true) + let i:usize = i in + v i >= 0 /\ v i <= 16 /\ + (v i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) serialized (fun serialized i -> let serialized:t_Array u8 v_OUT_LEN = serialized in let i:usize = i in + let _:Prims.unit = assert (20 * v i + 20 <= 320) in let coefficient:v_Vector = Libcrux_ml_kem.Vector.Traits.f_compress #v_Vector #FStar.Tactics.Typeclasses.solve 10l - (Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector + (to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) <: v_Vector) @@ -68,7 +93,9 @@ let compress_then_serialize_10_ in serialized) in - serialized + let result:t_Array u8 v_OUT_LEN = serialized in + let _:Prims.unit = admit () (* Panic freedom *) in + result #pop-options @@ -135,7 +162,7 @@ let compress_then_serialize_11_ #pop-options -#push-options "--admit_smt_queries true" +#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" let compress_then_serialize_4_ (#v_Vector: Type0) @@ -145,6 +172,7 @@ let compress_then_serialize_4_ (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) (serialized: t_Slice u8) = + let _:Prims.unit = assert_norm (pow2 4 == 16) in let v__serialized_len:usize = Core.Slice.impl__len #u8 serialized in let serialized:t_Slice u8 = Rust_primitives.Hax.Folds.fold_range (sz 0) @@ -152,16 +180,29 @@ let compress_then_serialize_4_ (fun serialized i -> let serialized:t_Slice u8 = serialized in let i:usize = i in - (Core.Slice.impl__len #u8 serialized <: usize) =. v__serialized_len <: bool) + v i >= 0 /\ v i <= 16 /\ Seq.length serialized == v v__serialized_len /\ + (v i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) serialized (fun serialized i -> let serialized:t_Slice u8 = serialized in let i:usize = i in + let _:Prims.unit = assert (8 * v i + 8 <= 128) in let coefficient:v_Vector = Libcrux_ml_kem.Vector.Traits.f_compress #v_Vector #FStar.Tactics.Typeclasses.solve 4l - (Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector + (to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) <: v_Vector) @@ -194,7 +235,9 @@ let compress_then_serialize_4_ in serialized) in - let hax_temp_output:Prims.unit = () <: Prims.unit in + let result:Prims.unit = () <: Prims.unit in + let _:Prims.unit = admit () (* Panic freedom *) in + let hax_temp_output:Prims.unit = result in serialized #pop-options @@ -263,8 +306,6 @@ let compress_then_serialize_5_ #pop-options -#push-options "--admit_smt_queries true" - let compress_then_serialize_message (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -276,16 +317,28 @@ let compress_then_serialize_message let serialized:t_Array u8 (sz 32) = Rust_primitives.Hax.Folds.fold_range (sz 0) (sz 16) - (fun serialized temp_1_ -> + (fun serialized i -> let serialized:t_Array u8 (sz 32) = serialized in - let _:usize = temp_1_ in - true) + let i:usize = i in + v i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) serialized (fun serialized i -> let serialized:t_Array u8 (sz 32) = serialized in let i:usize = i in + let _:Prims.unit = assert (2 * v i + 2 <= 32) in let coefficient:v_Vector = - Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector + to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) in let coefficient_compressed:v_Vector = @@ -321,9 +374,11 @@ let compress_then_serialize_message in serialized) in - serialized + let result:t_Array u8 (sz 32) = serialized in + let _:Prims.unit = admit () (* Panic freedom *) in + result -#pop-options +#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" let compress_then_serialize_ring_element_u (v_COMPRESSION_FACTOR v_OUT_LEN: usize) @@ -335,7 +390,8 @@ let compress_then_serialize_ring_element_u = let _:Prims.unit = assert ((v (cast v_COMPRESSION_FACTOR <: u32) == 10) \/ - (v (cast v_COMPRESSION_FACTOR <: u32) == 11)) + (v (cast v_COMPRESSION_FACTOR <: u32) == 11)); + Rust_primitives.Integers.mk_int_equiv_lemma #usize_inttype (v v_COMPRESSION_FACTOR) in match cast (v_COMPRESSION_FACTOR <: usize) <: u32 with | 10ul -> compress_then_serialize_10_ v_OUT_LEN #v_Vector re @@ -346,6 +402,10 @@ let compress_then_serialize_ring_element_u <: Rust_primitives.Hax.t_Never) +#pop-options + +#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" + let compress_then_serialize_ring_element_v (v_COMPRESSION_FACTOR v_OUT_LEN: usize) (#v_Vector: Type0) @@ -357,7 +417,8 @@ let compress_then_serialize_ring_element_v = let _:Prims.unit = assert ((v (cast v_COMPRESSION_FACTOR <: u32) == 4) \/ - (v (cast v_COMPRESSION_FACTOR <: u32) == 5)) + (v (cast v_COMPRESSION_FACTOR <: u32) == 5)); + Rust_primitives.Integers.mk_int_equiv_lemma #usize_inttype (v v_COMPRESSION_FACTOR) in let out, hax_temp_output:(t_Slice u8 & Prims.unit) = match cast (v_COMPRESSION_FACTOR <: usize) <: u32 with @@ -374,6 +435,8 @@ let compress_then_serialize_ring_element_v in out +#pop-options + let deserialize_then_decompress_10_ (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -821,7 +884,7 @@ let deserialize_to_uncompressed_ring_element in re -#push-options "--admit_smt_queries true" +#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" let serialize_uncompressed_ring_element (#v_Vector: Type0) @@ -830,20 +893,34 @@ let serialize_uncompressed_ring_element Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector) (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = + let _:Prims.unit = assert_norm (pow2 12 == 4096) in let serialized:t_Array u8 (sz 384) = Rust_primitives.Hax.repeat 0uy (sz 384) in let serialized:t_Array u8 (sz 384) = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Polynomial.v_VECTORS_IN_RING_ELEMENT - (fun serialized temp_1_ -> + (fun serialized i -> let serialized:t_Array u8 (sz 384) = serialized in - let _:usize = temp_1_ in - true) + let i:usize = i in + v i >= 0 /\ v i <= 16 /\ + (v i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) serialized (fun serialized i -> let serialized:t_Array u8 (sz 384) = serialized in let i:usize = i in + let _:Prims.unit = assert (24 * v i + 24 <= 384) in let coefficient:v_Vector = - Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector + to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) in let bytes:t_Array u8 (sz 24) = @@ -874,6 +951,8 @@ let serialize_uncompressed_ring_element in serialized) in - serialized + let result:t_Array u8 (sz 384) = serialized in + let _:Prims.unit = admit () (* Panic freedom *) in + result #pop-options diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti index c5c20e382..df1a37b01 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti @@ -9,19 +9,57 @@ let _ = let open Libcrux_ml_kem.Vector.Traits in () +val to_unsigned_field_modulus + (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (a: v_Vector) + : Prims.Pure v_Vector + (requires + forall (i: nat). + i < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array a) i) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array a) i) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) + (ensures + fun result -> + let result:v_Vector = result in + forall (i: nat). + i < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array result) i) >= 0 /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array result) i) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) + val compress_then_serialize_10_ (v_OUT_LEN: usize) (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) - : Prims.Pure (t_Array u8 v_OUT_LEN) (requires v_OUT_LEN =. sz 320) (fun _ -> Prims.l_True) + : Prims.Pure (t_Array u8 v_OUT_LEN) + (requires + v v_OUT_LEN == 320 /\ + (forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + (fun _ -> Prims.l_True) val compress_then_serialize_11_ (v_OUT_LEN: usize) (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) - : Prims.Pure (t_Array u8 v_OUT_LEN) (requires v_OUT_LEN =. sz 352) (fun _ -> Prims.l_True) + : Prims.Pure (t_Array u8 v_OUT_LEN) Prims.l_True (fun _ -> Prims.l_True) val compress_then_serialize_4_ (#v_Vector: Type0) @@ -29,7 +67,21 @@ val compress_then_serialize_4_ (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) (serialized: t_Slice u8) : Prims.Pure (t_Slice u8) - (requires (Core.Slice.impl__len #u8 serialized <: usize) =. sz 128) + (requires + Seq.length serialized == 128 /\ + (forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) (fun _ -> Prims.l_True) val compress_then_serialize_5_ @@ -45,7 +97,22 @@ val compress_then_serialize_message (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) - : Prims.Pure (t_Array u8 (sz 32)) Prims.l_True (fun _ -> Prims.l_True) + : Prims.Pure (t_Array u8 (sz 32)) + (requires + forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + (fun _ -> Prims.l_True) val compress_then_serialize_ring_element_u (v_COMPRESSION_FACTOR v_OUT_LEN: usize) @@ -54,8 +121,21 @@ val compress_then_serialize_ring_element_u (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) : Prims.Pure (t_Array u8 v_OUT_LEN) (requires - (v_COMPRESSION_FACTOR =. sz 10 || v_COMPRESSION_FACTOR =. sz 11) && - v_OUT_LEN =. (sz 32 *! v_COMPRESSION_FACTOR <: usize)) + (v v_COMPRESSION_FACTOR == 10 \/ v v_COMPRESSION_FACTOR == 11) /\ + v v_OUT_LEN == 32 * v v_COMPRESSION_FACTOR /\ + (forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) (fun _ -> Prims.l_True) val compress_then_serialize_ring_element_v @@ -66,9 +146,21 @@ val compress_then_serialize_ring_element_v (out: t_Slice u8) : Prims.Pure (t_Slice u8) (requires - (v_COMPRESSION_FACTOR =. sz 4 || v_COMPRESSION_FACTOR =. sz 5) && - v_OUT_LEN =. (sz 32 *! v_COMPRESSION_FACTOR <: usize) && - (Core.Slice.impl__len #u8 out <: usize) =. v_OUT_LEN) + (v v_COMPRESSION_FACTOR == 4 \/ v v_COMPRESSION_FACTOR == 5) /\ + v v_OUT_LEN == 32 * v v_COMPRESSION_FACTOR /\ Seq.length out == v v_OUT_LEN /\ + (forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) (ensures fun out_future -> let out_future:t_Slice u8 = out_future in @@ -176,4 +268,19 @@ val serialize_uncompressed_ring_element (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) - : Prims.Pure (t_Array u8 (sz 384)) Prims.l_True (fun _ -> Prims.l_True) + : Prims.Pure (t_Array u8 (sz 384)) + (requires + forall (i: nat). + i < 16 ==> + (forall (j: nat). + j < 16 ==> + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) >= + - + (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re + .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) + j) < + v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + (fun _ -> Prims.l_True) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti index 2aa6f7ab9..14a8a6489 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti @@ -177,11 +177,21 @@ let impl_3: Libcrux_ml_kem.Vector.Traits.t_Operations t_SIMD256Vector = } <: t_SIMD256Vector); - f_compress_1_pre = (fun (vector: t_SIMD256Vector) -> true); - f_compress_1_post = (fun (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> true); + f_compress_1_pre + = + (fun (vector: t_SIMD256Vector) -> + forall (i: nat). + i < 16 ==> + v (Seq.index (impl.f_repr vector) i) >= 0 /\ + v (Seq.index (impl.f_repr vector) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS); + f_compress_1_post + = + (fun (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> + forall (i: nat). i < 16 ==> bounded (Seq.index (impl.f_repr out) i) 1); f_compress_1_ = (fun (vector: t_SIMD256Vector) -> + let _:Prims.unit = admit () in { f_elements = @@ -192,14 +202,23 @@ let impl_3: Libcrux_ml_kem.Vector.Traits.t_Operations t_SIMD256Vector = f_compress_pre = (fun (v_COEFFICIENT_BITS: i32) (vector: t_SIMD256Vector) -> - v_COEFFICIENT_BITS =. 4l || v_COEFFICIENT_BITS =. 5l || v_COEFFICIENT_BITS =. 10l || - v_COEFFICIENT_BITS =. 11l); + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) /\ + (forall (i: nat). + i < 16 ==> + v (Seq.index (impl.f_repr vector) i) >= 0 /\ + v (Seq.index (impl.f_repr vector) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)); f_compress_post = - (fun (v_COEFFICIENT_BITS: i32) (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> true); + (fun (v_COEFFICIENT_BITS: i32) (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) ==> + (forall (i: nat). i < 16 ==> bounded (Seq.index (impl.f_repr out) i) (v v_COEFFICIENT_BITS)) + ); f_compress = (fun (v_COEFFICIENT_BITS: i32) (vector: t_SIMD256Vector) -> + let _:Prims.unit = admit () in { f_elements = diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fst index 4a470d7d1..d8c5b91a8 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fst @@ -22,78 +22,146 @@ let compress_message_coefficient (fe: u16) = let shifted_positive_in_range:i16 = shifted_to_positive -! 832s in cast ((shifted_positive_in_range >>! 15l <: i16) &. 1s <: i16) <: u8 +#push-options "--fuel 0 --ifuel 0 --z3rlimit 2000" + let compress (v_COEFFICIENT_BITS: i32) - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) = - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = + let _:Prims.unit = + assert (v (cast (v_COEFFICIENT_BITS) <: u8) == v v_COEFFICIENT_BITS); + assert (v (cast (v_COEFFICIENT_BITS) <: u32) == v v_COEFFICIENT_BITS) + in + let _:Prims.unit = + assert (forall (i: nat). + i < 16 ==> + (cast (a.f_elements.[ sz i ]) <: u16) <. + (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16)) + in + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Vector.Traits.v_FIELD_ELEMENTS_IN_VECTOR - (fun v temp_1_ -> - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = v in - let _:usize = temp_1_ in - true) - v - (fun v i -> - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = v in + (fun a i -> + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = a in + let i:usize = i in + (v i < 16 ==> + (forall (j: nat). + (j >= v i /\ j < 16) ==> + v (cast (a.f_elements.[ sz j ]) <: u16) < + v (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16))) /\ + (forall (j: nat). + j < v i ==> + v (a.f_elements.[ sz j ] <: i16) >= 0 /\ + v (a.f_elements.[ sz j ] <: i16) < pow2 (v (cast (v_COEFFICIENT_BITS) <: u32)))) + a + (fun a i -> + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = a in let i:usize = i in - { - v with - Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - = - Rust_primitives.Hax.Monomorphized_update_at.update_at_usize v - .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - i - (compress_ciphertext_coefficient (cast (v_COEFFICIENT_BITS <: i32) <: u8) - (cast (v.Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements.[ i ] <: i16) - <: - u16) - <: - i16) + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = + { + a with + Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements + = + Rust_primitives.Hax.Monomorphized_update_at.update_at_usize a + .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements + i + (compress_ciphertext_coefficient (cast (v_COEFFICIENT_BITS <: i32) <: u8) + (cast (a.Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements.[ i ] <: i16) + <: + u16) + <: + i16) + } <: - t_Array i16 (sz 16) - } - <: - Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector + in + let _:Prims.unit = + assert (v (a.f_elements.[ i ] <: i16) >= 0 /\ + v (a.f_elements.[ i ] <: i16) < pow2 (v (cast (v_COEFFICIENT_BITS) <: u32))) + in + a) in - v + let _:Prims.unit = + assert (forall (i: nat). + i < 16 ==> + v (a.f_elements.[ sz i ] <: i16) >= 0 /\ + v (a.f_elements.[ sz i ] <: i16) < pow2 (v v_COEFFICIENT_BITS)) + in + a -let compress_1_ (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) = - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = +#pop-options + +#push-options "--fuel 0 --ifuel 0 --z3rlimit 2000" + +let compress_message_coefficient_range_helper (fe: u16) : Lemma + (requires fe <. (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16)) + (ensures v (cast (compress_message_coefficient fe) <: i16) >= 0 /\ + v (cast (compress_message_coefficient fe) <: i16) < 2) = + assert (v (cast (compress_message_coefficient fe) <: i16) >= 0 /\ + v (cast (compress_message_coefficient fe) <: i16) < 2) + +let compress_1_ (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) = + let _:Prims.unit = + assert (forall (i: nat). + i < 16 ==> + (cast (a.f_elements.[ sz i ]) <: u16) <. + (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16)) + in + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Vector.Traits.v_FIELD_ELEMENTS_IN_VECTOR - (fun v temp_1_ -> - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = v in - let _:usize = temp_1_ in - true) - v - (fun v i -> - let v:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = v in + (fun a i -> + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = a in + let i:usize = i in + (v i < 16 ==> + (forall (j: nat). + (j >= v i /\ j < 16) ==> + v (cast (a.f_elements.[ sz j ]) <: u16) < + v (cast (Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) <: u16))) /\ + (forall (j: nat). + j < v i ==> + v (a.f_elements.[ sz j ] <: i16) >= 0 /\ v (a.f_elements.[ sz j ] <: i16) < 2)) + a + (fun a i -> + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = a in let i:usize = i in - { - v with - Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - = - Rust_primitives.Hax.Monomorphized_update_at.update_at_usize v - .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - i - (cast (compress_message_coefficient (cast (v - .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements.[ i ] - <: - i16) - <: - u16) - <: - u8) - <: - i16) + let _:Prims.unit = + compress_message_coefficient_range_helper (cast (a.f_elements.[ i ]) <: u16) + in + let a:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = + { + a with + Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements + = + Rust_primitives.Hax.Monomorphized_update_at.update_at_usize a + .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements + i + (cast (compress_message_coefficient (cast (a + .Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements.[ i ] + <: + i16) + <: + u16) + <: + u8) + <: + i16) + } <: - t_Array i16 (sz 16) - } - <: - Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector + in + let _:Prims.unit = + assert (v (a.f_elements.[ i ] <: i16) >= 0 /\ v (a.f_elements.[ i ] <: i16) < 2) + in + a) in - v + let _:Prims.unit = + assert (forall (i: nat). + i < 16 ==> v (a.f_elements.[ sz i ] <: i16) >= 0 /\ v (a.f_elements.[ sz i ] <: i16) < 2) + in + a + +#pop-options let decompress_ciphertext_coefficient (v_COEFFICIENT_BITS: i32) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti index 8a078f1b0..57e5a0a1d 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti @@ -47,15 +47,36 @@ val compress_message_coefficient (fe: u16) val compress (v_COEFFICIENT_BITS: i32) - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - Prims.l_True - (fun _ -> Prims.l_True) + (requires + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) /\ + (forall (i: nat). + i < 16 ==> + v (Seq.index a.f_elements i) >= 0 /\ + v (Seq.index a.f_elements i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + (ensures + fun result -> + let result:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = result in + forall (i: nat). + i < 16 ==> + v (result.f_elements.[ sz i ] <: i16) >= 0 /\ + v (result.f_elements.[ sz i ] <: i16) < pow2 (v v_COEFFICIENT_BITS)) -val compress_1_ (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) +val compress_1_ (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - Prims.l_True - (fun _ -> Prims.l_True) + (requires + forall (i: nat). + i < 16 ==> + v (Seq.index a.f_elements i) >= 0 /\ + v (Seq.index a.f_elements i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) + (ensures + fun result -> + let result:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = result in + forall (i: nat). + i < 16 ==> + v (result.f_elements.[ sz i ] <: i16) >= 0 /\ v (result.f_elements.[ sz i ] <: i16) < 2) val decompress_ciphertext_coefficient (v_COEFFICIENT_BITS: i32) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fst new file mode 100644 index 000000000..dbd72c7e0 --- /dev/null +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fst @@ -0,0 +1,15 @@ +module Libcrux_ml_kem.Vector.Portable +#set-options "--fuel 0 --ifuel 1 --z3rlimit 15" +open Core +open FStar.Mul + +let _ = + (* This module has implicit dependencies, here we make them explicit. *) + (* The implicit dependencies arise from typeclasses instances. *) + let open Libcrux_ml_kem.Vector.Portable.Vector_type in + let open Libcrux_ml_kem.Vector.Traits in + () + +#push-options "--z3rlimit 300" + +#pop-options diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti index 461660a87..8f46599b2 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti @@ -206,41 +206,52 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = Libcrux_ml_kem.Vector.Portable.Arithmetic.montgomery_multiply_by_constant v r); f_compress_1_pre = - (fun (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> true); + (fun (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> + forall (i: nat). + i < 16 ==> + v (Seq.index (impl.f_repr a) i) >= 0 /\ + v (Seq.index (impl.f_repr a) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS); f_compress_1_post = (fun - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) (out: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> - true); + forall (i: nat). i < 16 ==> bounded (Seq.index (impl.f_repr out) i) 1); f_compress_1_ = - (fun (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> - Libcrux_ml_kem.Vector.Portable.Compress.compress_1_ v); + (fun (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> + Libcrux_ml_kem.Vector.Portable.Compress.compress_1_ a); f_compress_pre = (fun (v_COEFFICIENT_BITS: i32) - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> - v_COEFFICIENT_BITS =. 4l || v_COEFFICIENT_BITS =. 5l || v_COEFFICIENT_BITS =. 10l || - v_COEFFICIENT_BITS =. 11l); + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) /\ + (forall (i: nat). + i < 16 ==> + v (Seq.index (impl.f_repr a) i) >= 0 /\ + v (Seq.index (impl.f_repr a) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)); f_compress_post = (fun (v_COEFFICIENT_BITS: i32) - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) (out: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> - true); + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) ==> + (forall (i: nat). i < 16 ==> bounded (Seq.index (impl.f_repr out) i) (v v_COEFFICIENT_BITS)) + ); f_compress = (fun (v_COEFFICIENT_BITS: i32) - (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) + (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> - Libcrux_ml_kem.Vector.Portable.Compress.compress v_COEFFICIENT_BITS v); + Libcrux_ml_kem.Vector.Portable.Compress.compress v_COEFFICIENT_BITS a); f_decompress_ciphertext_coefficient_pre = (fun diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst index be631a15d..05c102c6a 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst @@ -45,4 +45,6 @@ let to_unsigned_representative let fm:v_T = f_bitwise_and_with_constant #v_T #FStar.Tactics.Typeclasses.solve t v_FIELD_MODULUS in - f_add #v_T #FStar.Tactics.Typeclasses.solve a fm + let result:v_T = f_add #v_T #FStar.Tactics.Typeclasses.solve a fm in + let _:Prims.unit = admit () (* Panic freedom *) in + result diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti index 1df7c1846..44ad4dd11 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti @@ -101,17 +101,32 @@ class t_Operations (v_Self: Type0) = { -> Prims.Pure v_Self (f_montgomery_multiply_by_constant_pre x0 x1) (fun result -> f_montgomery_multiply_by_constant_post x0 x1 result); - f_compress_1_pre:v: v_Self -> pred: Type0{true ==> pred}; - f_compress_1_post:v_Self -> v_Self -> Type0; + f_compress_1_pre:a: v_Self + -> pred: + Type0 + { (forall (i: nat). + i < 16 ==> v (Seq.index (f_repr a) i) >= 0 /\ v (Seq.index (f_repr a) i) < 3329) ==> + pred }; + f_compress_1_post:a: v_Self -> result: v_Self + -> pred: Type0{pred ==> (forall (i: nat). i < 16 ==> bounded (Seq.index (f_repr result) i) 1)}; f_compress_1_:x0: v_Self -> Prims.Pure v_Self (f_compress_1_pre x0) (fun result -> f_compress_1_post x0 result); - f_compress_pre:v_COEFFICIENT_BITS: i32 -> v: v_Self + f_compress_pre:v_COEFFICIENT_BITS: i32 -> a: v_Self -> pred: Type0 - { v_COEFFICIENT_BITS =. 4l || v_COEFFICIENT_BITS =. 5l || v_COEFFICIENT_BITS =. 10l || - v_COEFFICIENT_BITS =. 11l ==> + { (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) /\ + (forall (i: nat). + i < 16 ==> v (Seq.index (f_repr a) i) >= 0 /\ v (Seq.index (f_repr a) i) < 3329) ==> pred }; - f_compress_post:v_COEFFICIENT_BITS: i32 -> v_Self -> v_Self -> Type0; + f_compress_post:v_COEFFICIENT_BITS: i32 -> a: v_Self -> result: v_Self + -> pred: + Type0 + { pred ==> + (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ + v v_COEFFICIENT_BITS == 11) ==> + (forall (i: nat). i < 16 ==> bounded (Seq.index (f_repr result) i) (v v_COEFFICIENT_BITS)) + }; f_compress:v_COEFFICIENT_BITS: i32 -> x0: v_Self -> Prims.Pure v_Self (f_compress_pre v_COEFFICIENT_BITS x0) @@ -333,4 +348,12 @@ val to_standard_domain (#v_T: Type0) {| i1: t_Operations v_T |} (v: v_T) : Prims.Pure v_T Prims.l_True (fun _ -> Prims.l_True) val to_unsigned_representative (#v_T: Type0) {| i1: t_Operations v_T |} (a: v_T) - : Prims.Pure v_T Prims.l_True (fun _ -> Prims.l_True) + : Prims.Pure v_T + Prims.l_True + (ensures + fun result -> + let result:v_T = result in + f_to_i16_array result == + Spec.Utils.map2 ( +. ) + (f_to_i16_array a) + (Spec.Utils.map_array (fun x -> (x >>! 15l) &. v_FIELD_MODULUS) (f_to_i16_array a))) From 09cde639253d41f1d79790d7fd88084cc0fb60a7 Mon Sep 17 00:00:00 2001 From: mamonet Date: Sat, 21 Sep 2024 08:37:45 +0000 Subject: [PATCH 03/14] Update Libcrux_ml_kem.Ind_cpa --- .../extraction/Libcrux_ml_kem.Ind_cpa.fst | 40 +++++++++++++++++-- .../extraction/Libcrux_ml_kem.Ind_cpa.fsti | 10 ++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst index 7aff6f7ed..daba9dd3b 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst @@ -197,7 +197,32 @@ let sample_vector_cbd_then_ntt let _:Prims.unit = admit () (* Panic freedom *) in result -#push-options "--z3rlimit 200" +val compress_then_serialize_ring_element_u1 + (v_COMPRESSION_FACTOR v_OUT_LEN: usize) + (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) + : Prims.Pure (t_Array u8 v_OUT_LEN) + (requires True) + (fun _ -> Prims.l_True) + +let compress_then_serialize_ring_element_u1 = admit() + +val compress_then_serialize_u_helper (i v_K v_OUT_LEN v_BLOCK_LEN: usize) : + Lemma (requires (Spec.MLKEM.is_rank v_K /\ v_OUT_LEN == Spec.MLKEM.v_C1_SIZE v_K /\ + v_BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE v_K /\ v i < v v_K)) + (ensures (v (v_OUT_LEN /! v_K) == v ((i +! sz 1) *! (v_OUT_LEN /! v_K)) - v (i *! (v_OUT_LEN /! v_K)) /\ + v (v_OUT_LEN /! v_K) == v v_BLOCK_LEN /\ + v i * (v v_OUT_LEN / v v_K) < v v_OUT_LEN /\ + v i * (v v_OUT_LEN / v v_K) + (v v_OUT_LEN / v v_K) <= v v_OUT_LEN)) + +let compress_then_serialize_u_helper i v_K v_OUT_LEN v_BLOCK_LEN = + assert (v (v_OUT_LEN /! v_K) == v ((i +! sz 1) *! (v_OUT_LEN /! v_K)) - v (i *! (v_OUT_LEN /! v_K))); + assert (v (v_OUT_LEN /! v_K) == v v_BLOCK_LEN); + assert (v i * (v v_OUT_LEN / v v_K) < v v_OUT_LEN); + assert (v i * (v v_OUT_LEN / v v_K) + (v v_OUT_LEN / v v_K) <= v v_OUT_LEN) + +#push-options "--max_fuel 1 --max_ifuel 1 --z3rlimit 2000" let compress_then_serialize_u (v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize) @@ -208,6 +233,8 @@ let compress_then_serialize_u (input: t_Array (Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) v_K) (out: t_Slice u8) = + //assume (forall (i:nat). i < v v_K ==> (forall (j:nat). j < 16 ==> (forall (k:nat). k < 16 ==> + // v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array (Seq.index input i).f_coefficients.[sz j]) k) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))); let _:Prims.unit = assert ((v Libcrux_ml_kem.Constants.v_COEFFICIENTS_IN_RING_ELEMENT * v v_COMPRESSION_FACTOR) / 8 == 320 \/ @@ -219,13 +246,20 @@ let compress_then_serialize_u (fun out i -> let out:t_Slice u8 = out in let i:usize = i in - (Core.Slice.impl__len #u8 out <: usize) =. v_OUT_LEN <: bool) + v i >= 0 /\ v i <= v v_K /\ + v (Core.Slice.impl__len #u8 out <: usize) == v v_OUT_LEN) out (fun out temp_1_ -> let out:t_Slice u8 = out in let i, re:(usize & Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = temp_1_ in + assert (v i >= 0 /\ v i < v v_K); + assert (v (v_OUT_LEN /! v_K) == v v_OUT_LEN / v v_K); + assert (v (i *! (v_OUT_LEN /! v_K <: usize)) == v i * v (v_OUT_LEN /! v_K)); + assert (v (i +! sz 1) == v i + 1); + assert (v ((i +! sz 1 <: usize) *! (v_OUT_LEN /! v_K <: usize)) == v (i +! sz 1) * v (v_OUT_LEN /! v_K)); + compress_then_serialize_u_helper i v_K v_OUT_LEN v_BLOCK_LEN; let out:t_Slice u8 = Rust_primitives.Hax.Monomorphized_update_at.update_at_range out ({ @@ -247,7 +281,7 @@ let compress_then_serialize_u Core.Ops.Range.t_Range usize ] <: t_Slice u8) - (Libcrux_ml_kem.Serialize.compress_then_serialize_ring_element_u v_COMPRESSION_FACTOR + (compress_then_serialize_ring_element_u1 v_COMPRESSION_FACTOR v_BLOCK_LEN #v_Vector re diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti index edacb43f3..37373dc6b 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti @@ -50,6 +50,13 @@ val sample_vector_cbd_then_ntt (Seq.slice prf_input 0 32) (sz (v domain_separator))) +let compress_then_serialize_u_helper_f (v_K: usize) (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (input: t_Array (Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) v_K) = + forall (i:nat). i < v v_K ==> (let re = Seq.index input i in forall (j:nat). j < 256 ==> + (let coef:t_Array i16 (sz 16) = Libcrux_ml_kem.Vector.Traits.f_to_i16_array (Seq.index re.f_coefficients (j / 16)) in + v (Seq.index coef (j % 16)) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + /// Call [`compress_then_serialize_ring_element_u`] on each ring element. val compress_then_serialize_u (v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize) @@ -61,7 +68,8 @@ val compress_then_serialize_u (requires Spec.MLKEM.is_rank v_K /\ v_OUT_LEN == Spec.MLKEM.v_C1_SIZE v_K /\ v_COMPRESSION_FACTOR == Spec.MLKEM.v_VECTOR_U_COMPRESSION_FACTOR v_K /\ - v_BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE v_K /\ Core.Slice.impl__len #u8 out == v_OUT_LEN) + v_BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE v_K /\ Core.Slice.impl__len #u8 out == v_OUT_LEN /\ + compress_then_serialize_u_helper_f v_K #v_Vector input) (ensures fun out_future -> let out_future:t_Slice u8 = out_future in From 29148553dd08d6266c5c114569a8f0e9f38908b4 Mon Sep 17 00:00:00 2001 From: mamonet Date: Sun, 22 Sep 2024 19:13:53 +0000 Subject: [PATCH 04/14] Use opaque_to_smt to make serialize functions fast to verify --- .../extraction/Libcrux_ml_kem.Ind_cpa.fst | 42 +----- .../extraction/Libcrux_ml_kem.Ind_cpa.fsti | 11 +- .../extraction/Libcrux_ml_kem.Serialize.fst | 101 ++++---------- .../extraction/Libcrux_ml_kem.Serialize.fsti | 124 ++++-------------- .../Libcrux_ml_kem.Vector.Avx2.fsti | 7 +- ...bcrux_ml_kem.Vector.Portable.Compress.fsti | 8 +- ...bcrux_ml_kem.Vector.Portable.Serialize.fst | 12 ++ ...crux_ml_kem.Vector.Portable.Serialize.fsti | 12 ++ .../Libcrux_ml_kem.Vector.Portable.fsti | 17 ++- .../Libcrux_ml_kem.Vector.Traits.fst | 12 +- .../Libcrux_ml_kem.Vector.Traits.fsti | 4 +- .../proofs/fstar/spec/Spec.MLKEM.Math.fst | 5 +- libcrux-ml-kem/src/ind_cpa.rs | 8 +- libcrux-ml-kem/src/serialize.rs | 90 +++++++------ libcrux-ml-kem/src/vector/avx2.rs | 4 +- libcrux-ml-kem/src/vector/portable.rs | 8 +- .../src/vector/portable/compress.rs | 4 +- .../src/vector/portable/serialize.rs | 44 +++++++ libcrux-ml-kem/src/vector/traits.rs | 5 +- 19 files changed, 222 insertions(+), 296 deletions(-) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst index daba9dd3b..245a00761 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst @@ -197,32 +197,7 @@ let sample_vector_cbd_then_ntt let _:Prims.unit = admit () (* Panic freedom *) in result -val compress_then_serialize_ring_element_u1 - (v_COMPRESSION_FACTOR v_OUT_LEN: usize) - (#v_Vector: Type0) - {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} - (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) - : Prims.Pure (t_Array u8 v_OUT_LEN) - (requires True) - (fun _ -> Prims.l_True) - -let compress_then_serialize_ring_element_u1 = admit() - -val compress_then_serialize_u_helper (i v_K v_OUT_LEN v_BLOCK_LEN: usize) : - Lemma (requires (Spec.MLKEM.is_rank v_K /\ v_OUT_LEN == Spec.MLKEM.v_C1_SIZE v_K /\ - v_BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE v_K /\ v i < v v_K)) - (ensures (v (v_OUT_LEN /! v_K) == v ((i +! sz 1) *! (v_OUT_LEN /! v_K)) - v (i *! (v_OUT_LEN /! v_K)) /\ - v (v_OUT_LEN /! v_K) == v v_BLOCK_LEN /\ - v i * (v v_OUT_LEN / v v_K) < v v_OUT_LEN /\ - v i * (v v_OUT_LEN / v v_K) + (v v_OUT_LEN / v v_K) <= v v_OUT_LEN)) - -let compress_then_serialize_u_helper i v_K v_OUT_LEN v_BLOCK_LEN = - assert (v (v_OUT_LEN /! v_K) == v ((i +! sz 1) *! (v_OUT_LEN /! v_K)) - v (i *! (v_OUT_LEN /! v_K))); - assert (v (v_OUT_LEN /! v_K) == v v_BLOCK_LEN); - assert (v i * (v v_OUT_LEN / v v_K) < v v_OUT_LEN); - assert (v i * (v v_OUT_LEN / v v_K) + (v v_OUT_LEN / v v_K) <= v v_OUT_LEN) - -#push-options "--max_fuel 1 --max_ifuel 1 --z3rlimit 2000" +#push-options "--z3rlimit 200" let compress_then_serialize_u (v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize) @@ -233,8 +208,6 @@ let compress_then_serialize_u (input: t_Array (Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) v_K) (out: t_Slice u8) = - //assume (forall (i:nat). i < v v_K ==> (forall (j:nat). j < 16 ==> (forall (k:nat). k < 16 ==> - // v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array (Seq.index input i).f_coefficients.[sz j]) k) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))); let _:Prims.unit = assert ((v Libcrux_ml_kem.Constants.v_COEFFICIENTS_IN_RING_ELEMENT * v v_COMPRESSION_FACTOR) / 8 == 320 \/ @@ -246,20 +219,15 @@ let compress_then_serialize_u (fun out i -> let out:t_Slice u8 = out in let i:usize = i in - v i >= 0 /\ v i <= v v_K /\ - v (Core.Slice.impl__len #u8 out <: usize) == v v_OUT_LEN) + v i < v v_K ==> + (Seq.length out == v v_OUT_LEN /\ + Libcrux_ml_kem.Serialize.coefficients_field_modulus_range (Seq.index input (v i)))) out (fun out temp_1_ -> let out:t_Slice u8 = out in let i, re:(usize & Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = temp_1_ in - assert (v i >= 0 /\ v i < v v_K); - assert (v (v_OUT_LEN /! v_K) == v v_OUT_LEN / v v_K); - assert (v (i *! (v_OUT_LEN /! v_K <: usize)) == v i * v (v_OUT_LEN /! v_K)); - assert (v (i +! sz 1) == v i + 1); - assert (v ((i +! sz 1 <: usize) *! (v_OUT_LEN /! v_K <: usize)) == v (i +! sz 1) * v (v_OUT_LEN /! v_K)); - compress_then_serialize_u_helper i v_K v_OUT_LEN v_BLOCK_LEN; let out:t_Slice u8 = Rust_primitives.Hax.Monomorphized_update_at.update_at_range out ({ @@ -281,7 +249,7 @@ let compress_then_serialize_u Core.Ops.Range.t_Range usize ] <: t_Slice u8) - (compress_then_serialize_ring_element_u1 v_COMPRESSION_FACTOR + (Libcrux_ml_kem.Serialize.compress_then_serialize_ring_element_u v_COMPRESSION_FACTOR v_BLOCK_LEN #v_Vector re diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti index 37373dc6b..550d08b03 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fsti @@ -50,13 +50,6 @@ val sample_vector_cbd_then_ntt (Seq.slice prf_input 0 32) (sz (v domain_separator))) -let compress_then_serialize_u_helper_f (v_K: usize) (#v_Vector: Type0) - {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} - (input: t_Array (Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) v_K) = - forall (i:nat). i < v v_K ==> (let re = Seq.index input i in forall (j:nat). j < 256 ==> - (let coef:t_Array i16 (sz 16) = Libcrux_ml_kem.Vector.Traits.f_to_i16_array (Seq.index re.f_coefficients (j / 16)) in - v (Seq.index coef (j % 16)) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) - /// Call [`compress_then_serialize_ring_element_u`] on each ring element. val compress_then_serialize_u (v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize) @@ -69,7 +62,9 @@ val compress_then_serialize_u Spec.MLKEM.is_rank v_K /\ v_OUT_LEN == Spec.MLKEM.v_C1_SIZE v_K /\ v_COMPRESSION_FACTOR == Spec.MLKEM.v_VECTOR_U_COMPRESSION_FACTOR v_K /\ v_BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE v_K /\ Core.Slice.impl__len #u8 out == v_OUT_LEN /\ - compress_then_serialize_u_helper_f v_K #v_Vector input) + (forall (i: nat). + i < v v_K ==> + Libcrux_ml_kem.Serialize.coefficients_field_modulus_range (Seq.index input i))) (ensures fun out_future -> let out_future:t_Slice u8 = out_future in diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst index 8ed8516c8..2226342d3 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst @@ -16,12 +16,11 @@ let to_unsigned_field_modulus Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector) (a: v_Vector) = + let _:Prims.unit = reveal_opaque (`%field_modulus_range) (field_modulus_range #v_Vector) in let result:v_Vector = Libcrux_ml_kem.Vector.Traits.to_unsigned_representative #v_Vector a in let _:Prims.unit = admit () (* Panic freedom *) in result -#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" - let compress_then_serialize_10_ (v_OUT_LEN: usize) (#v_Vector: Type0) @@ -38,24 +37,16 @@ let compress_then_serialize_10_ (fun serialized i -> let serialized:t_Array u8 v_OUT_LEN = serialized in let i:usize = i in - v i >= 0 /\ v i <= 16 /\ - (v i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + v i >= 0 /\ v i <= 16 /\ v i < 16 ==> coefficients_field_modulus_range re) serialized (fun serialized i -> let serialized:t_Array u8 v_OUT_LEN = serialized in let i:usize = i in let _:Prims.unit = assert (20 * v i + 20 <= 320) in + let _:Prims.unit = + reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #v_Vector) + in let coefficient:v_Vector = Libcrux_ml_kem.Vector.Traits.f_compress #v_Vector #FStar.Tactics.Typeclasses.solve @@ -97,8 +88,6 @@ let compress_then_serialize_10_ let _:Prims.unit = admit () (* Panic freedom *) in result -#pop-options - #push-options "--admit_smt_queries true" let compress_then_serialize_11_ @@ -162,8 +151,6 @@ let compress_then_serialize_11_ #pop-options -#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" - let compress_then_serialize_4_ (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -173,31 +160,23 @@ let compress_then_serialize_4_ (serialized: t_Slice u8) = let _:Prims.unit = assert_norm (pow2 4 == 16) in - let v__serialized_len:usize = Core.Slice.impl__len #u8 serialized in let serialized:t_Slice u8 = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Polynomial.v_VECTORS_IN_RING_ELEMENT (fun serialized i -> let serialized:t_Slice u8 = serialized in let i:usize = i in - v i >= 0 /\ v i <= 16 /\ Seq.length serialized == v v__serialized_len /\ - (v i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + v i >= 0 /\ v i <= 16 /\ v i < 16 ==> + (Seq.length serialized == 128 /\ coefficients_field_modulus_range re)) serialized (fun serialized i -> let serialized:t_Slice u8 = serialized in let i:usize = i in let _:Prims.unit = assert (8 * v i + 8 <= 128) in + let _:Prims.unit = + reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #v_Vector) + in let coefficient:v_Vector = Libcrux_ml_kem.Vector.Traits.f_compress #v_Vector #FStar.Tactics.Typeclasses.solve @@ -240,8 +219,6 @@ let compress_then_serialize_4_ let hax_temp_output:Prims.unit = result in serialized -#pop-options - #push-options "--admit_smt_queries true" let compress_then_serialize_5_ @@ -252,14 +229,13 @@ let compress_then_serialize_5_ (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) (serialized: t_Slice u8) = - let v__serialized_len:usize = Core.Slice.impl__len #u8 serialized in let serialized:t_Slice u8 = Rust_primitives.Hax.Folds.fold_range (sz 0) Libcrux_ml_kem.Polynomial.v_VECTORS_IN_RING_ELEMENT - (fun serialized i -> + (fun serialized temp_1_ -> let serialized:t_Slice u8 = serialized in - let i:usize = i in - (Core.Slice.impl__len #u8 serialized <: usize) =. v__serialized_len <: bool) + let _:usize = temp_1_ in + true) serialized (fun serialized i -> let serialized:t_Slice u8 = serialized in @@ -320,23 +296,16 @@ let compress_then_serialize_message (fun serialized i -> let serialized:t_Array u8 (sz 32) = serialized in let i:usize = i in - v i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + v i < 16 ==> coefficients_field_modulus_range re) serialized (fun serialized i -> let serialized:t_Array u8 (sz 32) = serialized in let i:usize = i in let _:Prims.unit = assert (2 * v i + 2 <= 32) in + let _:Prims.unit = + reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #v_Vector) + in let coefficient:v_Vector = to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) @@ -378,8 +347,6 @@ let compress_then_serialize_message let _:Prims.unit = admit () (* Panic freedom *) in result -#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" - let compress_then_serialize_ring_element_u (v_COMPRESSION_FACTOR v_OUT_LEN: usize) (#v_Vector: Type0) @@ -402,10 +369,6 @@ let compress_then_serialize_ring_element_u <: Rust_primitives.Hax.t_Never) -#pop-options - -#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" - let compress_then_serialize_ring_element_v (v_COMPRESSION_FACTOR v_OUT_LEN: usize) (#v_Vector: Type0) @@ -435,8 +398,6 @@ let compress_then_serialize_ring_element_v in out -#pop-options - let deserialize_then_decompress_10_ (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -892,8 +853,6 @@ let deserialize_to_uncompressed_ring_element in re -#push-options "--fuel 0 --ifuel 0 --z3rlimit 500" - let serialize_uncompressed_ring_element (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -909,24 +868,16 @@ let serialize_uncompressed_ring_element (fun serialized i -> let serialized:t_Array u8 (sz 384) = serialized in let i:usize = i in - v i >= 0 /\ v i <= 16 /\ - (v i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + v i >= 0 /\ v i <= 16 /\ v i < 16 ==> coefficients_field_modulus_range re) serialized (fun serialized i -> let serialized:t_Array u8 (sz 384) = serialized in let i:usize = i in let _:Prims.unit = assert (24 * v i + 24 <= 384) in + let _:Prims.unit = + reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #v_Vector) + in let coefficient:v_Vector = to_unsigned_field_modulus #v_Vector (re.Libcrux_ml_kem.Polynomial.f_coefficients.[ i ] <: v_Vector) @@ -962,5 +913,3 @@ let serialize_uncompressed_ring_element let result:t_Array u8 (sz 384) = serialized in let _:Prims.unit = admit () (* Panic freedom *) in result - -#pop-options diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti index 15846a26a..be80d6dac 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fsti @@ -9,19 +9,26 @@ let _ = let open Libcrux_ml_kem.Vector.Traits in () +[@@ "opaque_to_smt"] +let field_modulus_range (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (a: v_Vector) = + let coef = Libcrux_ml_kem.Vector.Traits.f_to_i16_array a in + forall (i:nat). i < 16 ==> v (Seq.index coef i) > -(v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ + v (Seq.index coef i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS + +[@@ "opaque_to_smt"] +let coefficients_field_modulus_range (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = + forall (i:nat). i < 16 ==> field_modulus_range (Seq.index re.f_coefficients i) + val to_unsigned_field_modulus (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (a: v_Vector) : Prims.Pure v_Vector - (requires - forall (i: nat). - i < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array a) i) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array a) i) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) + (requires field_modulus_range a) (ensures fun result -> let result:v_Vector = result in @@ -37,21 +44,7 @@ val compress_then_serialize_10_ {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) : Prims.Pure (t_Array u8 v_OUT_LEN) - (requires - v v_OUT_LEN == 320 /\ - (forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + (requires v v_OUT_LEN == 320 /\ coefficients_field_modulus_range re) (fun _ -> Prims.l_True) val compress_then_serialize_11_ @@ -67,22 +60,11 @@ val compress_then_serialize_4_ (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) (serialized: t_Slice u8) : Prims.Pure (t_Slice u8) - (requires - Seq.length serialized == 128 /\ - (forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) - (fun _ -> Prims.l_True) + (requires Seq.length serialized == 128 /\ coefficients_field_modulus_range re) + (ensures + fun serialized_future -> + let serialized_future:t_Slice u8 = serialized_future in + Core.Slice.impl__len #u8 serialized_future == Core.Slice.impl__len #u8 serialized) val compress_then_serialize_5_ (#v_Vector: Type0) @@ -91,27 +73,17 @@ val compress_then_serialize_5_ (serialized: t_Slice u8) : Prims.Pure (t_Slice u8) (requires (Core.Slice.impl__len #u8 serialized <: usize) =. sz 160) - (fun _ -> Prims.l_True) + (ensures + fun serialized_future -> + let serialized_future:t_Slice u8 = serialized_future in + Core.Slice.impl__len #u8 serialized_future == Core.Slice.impl__len #u8 serialized) val compress_then_serialize_message (#v_Vector: Type0) {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) : Prims.Pure (t_Array u8 (sz 32)) - (requires - forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + (requires coefficients_field_modulus_range re) (fun _ -> Prims.l_True) val compress_then_serialize_ring_element_u @@ -122,20 +94,7 @@ val compress_then_serialize_ring_element_u : Prims.Pure (t_Array u8 v_OUT_LEN) (requires (v v_COMPRESSION_FACTOR == 10 \/ v v_COMPRESSION_FACTOR == 11) /\ - v v_OUT_LEN == 32 * v v_COMPRESSION_FACTOR /\ - (forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + v v_OUT_LEN == 32 * v v_COMPRESSION_FACTOR /\ coefficients_field_modulus_range re) (fun _ -> Prims.l_True) val compress_then_serialize_ring_element_v @@ -148,19 +107,7 @@ val compress_then_serialize_ring_element_v (requires (v v_COMPRESSION_FACTOR == 4 \/ v v_COMPRESSION_FACTOR == 5) /\ v v_OUT_LEN == 32 * v v_COMPRESSION_FACTOR /\ Seq.length out == v v_OUT_LEN /\ - (forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS))) + coefficients_field_modulus_range re) (ensures fun out_future -> let out_future:t_Slice u8 = out_future in @@ -269,18 +216,5 @@ val serialize_uncompressed_ring_element {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) : Prims.Pure (t_Array u8 (sz 384)) - (requires - forall (i: nat). - i < 16 ==> - (forall (j: nat). - j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) >= - - - (v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) /\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array re - .Libcrux_ml_kem.Polynomial.f_coefficients.[ sz i ]) - j) < - v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + (requires coefficients_field_modulus_range re) (fun _ -> Prims.l_True) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti index 73dd1d799..0a135cf42 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Avx2.fsti @@ -208,8 +208,7 @@ let impl_3: Libcrux_ml_kem.Vector.Traits.t_Operations t_SIMD256Vector = (fun (vector: t_SIMD256Vector) -> forall (i: nat). i < 16 ==> - v (Seq.index (impl.f_repr vector) i) >= 0 /\ - v (Seq.index (impl.f_repr vector) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS); + v (Seq.index (impl.f_repr vector) i) >= 0 /\ v (Seq.index (impl.f_repr vector) i) < 3329); f_compress_1_post = (fun (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> @@ -232,8 +231,8 @@ let impl_3: Libcrux_ml_kem.Vector.Traits.t_Operations t_SIMD256Vector = v v_COEFFICIENT_BITS == 11) /\ (forall (i: nat). i < 16 ==> - v (Seq.index (impl.f_repr vector) i) >= 0 /\ - v (Seq.index (impl.f_repr vector) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)); + v (Seq.index (impl.f_repr vector) i) >= 0 /\ v (Seq.index (impl.f_repr vector) i) < 3329 + )); f_compress_post = (fun (v_COEFFICIENT_BITS: i32) (vector: t_SIMD256Vector) (out: t_SIMD256Vector) -> diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti index 3de4509e5..938330976 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Compress.fsti @@ -53,9 +53,7 @@ val compress (v v_COEFFICIENT_BITS == 4 \/ v v_COEFFICIENT_BITS == 5 \/ v v_COEFFICIENT_BITS == 10 \/ v v_COEFFICIENT_BITS == 11) /\ (forall (i: nat). - i < 16 ==> - v (Seq.index a.f_elements i) >= 0 /\ - v (Seq.index a.f_elements i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)) + i < 16 ==> v (Seq.index a.f_elements i) >= 0 /\ v (Seq.index a.f_elements i) < 3329)) (ensures fun result -> let result:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = result in @@ -68,9 +66,7 @@ val compress_1_ (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires forall (i: nat). - i < 16 ==> - v (Seq.index a.f_elements i) >= 0 /\ - v (Seq.index a.f_elements i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS) + i < 16 ==> v (Seq.index a.f_elements i) >= 0 /\ v (Seq.index a.f_elements i) < 3329) (ensures fun result -> let result:Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = result in diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst index eed6ec9d6..a9947aa86 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst @@ -297,6 +297,9 @@ let deserialize_1_lemma inputs = #pop-options +let deserialize_1_bounded_lemma inputs = + admit() + let deserialize_10_ (bytes: t_Slice u8) = let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = deserialize_10_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 10 } @@ -348,6 +351,9 @@ let deserialize_10_lemma inputs = #pop-options +let deserialize_10_bounded_lemma inputs = + admit() + let deserialize_11_ (bytes: t_Slice u8) = let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = deserialize_11_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 11 } @@ -471,6 +477,9 @@ let deserialize_12_lemma inputs = #pop-options +let deserialize_12_bounded_lemma inputs = + admit() + let deserialize_4_ (bytes: t_Slice u8) = let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = deserialize_4_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 4 } @@ -522,6 +531,9 @@ let deserialize_4_lemma inputs = #pop-options +let deserialize_4_bounded_lemma inputs = + admit() + let deserialize_5_ (bytes: t_Slice u8) = let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = deserialize_5_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 5 } diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti index 16fd7000e..6f7c4897d 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti @@ -61,6 +61,9 @@ val deserialize_1_ (v: t_Slice u8) val deserialize_1_lemma (inputs: t_Array u8 (sz 2)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_1_ inputs).f_elements 1 == bit_vec_of_int_t_array inputs 8) +val deserialize_1_bounded_lemma (inputs: t_Array u8 (sz 2)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_1_ inputs).f_elements i) 1) + val deserialize_10_ (bytes: t_Slice u8) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires Core.Slice.impl__len #u8 bytes =. sz 20) @@ -69,6 +72,9 @@ val deserialize_10_ (bytes: t_Slice u8) val deserialize_10_lemma (inputs: t_Array u8 (sz 20)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_10_ inputs).f_elements 10 == bit_vec_of_int_t_array inputs 8) +val deserialize_10_bounded_lemma (inputs: t_Array u8 (sz 20)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_10_ inputs).f_elements i) 10) + val deserialize_11_ (bytes: t_Slice u8) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires Core.Slice.impl__len #u8 bytes =. sz 22) @@ -82,6 +88,9 @@ val deserialize_12_ (bytes: t_Slice u8) val deserialize_12_lemma (inputs: t_Array u8 (sz 24)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_12_ inputs).f_elements 12 == bit_vec_of_int_t_array inputs 8) +val deserialize_12_bounded_lemma (inputs: t_Array u8 (sz 24)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_12_ inputs).f_elements i) 12) + val deserialize_4_ (bytes: t_Slice u8) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires Core.Slice.impl__len #u8 bytes =. sz 8) @@ -90,6 +99,9 @@ val deserialize_4_ (bytes: t_Slice u8) val deserialize_4_lemma (inputs: t_Array u8 (sz 8)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_4_ inputs).f_elements 4 == bit_vec_of_int_t_array inputs 8) +val deserialize_4_bounded_lemma (inputs: t_Array u8 (sz 8)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_4_ inputs).f_elements i) 4) + val deserialize_5_ (bytes: t_Slice u8) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires Core.Slice.impl__len #u8 bytes =. sz 10) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti index 3ffb27cb0..2c4690115 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.fsti @@ -30,7 +30,7 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = Libcrux_ml_kem.Vector.Portable.Vector_type.to_i16_array x } -#push-options "--z3rlimit 400" +#push-options "--z3rlimit 200" [@@ FStar.Tactics.Typeclasses.tcinstance] let impl_1: Libcrux_ml_kem.Vector.Traits.t_Operations @@ -226,9 +226,7 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = = (fun (a: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) -> forall (i: nat). - i < 16 ==> - v (Seq.index (impl.f_repr a) i) >= 0 /\ - v (Seq.index (impl.f_repr a) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS); + i < 16 ==> v (Seq.index (impl.f_repr a) i) >= 0 /\ v (Seq.index (impl.f_repr a) i) < 3329); f_compress_1_post = (fun @@ -250,8 +248,7 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = v v_COEFFICIENT_BITS == 11) /\ (forall (i: nat). i < 16 ==> - v (Seq.index (impl.f_repr a) i) >= 0 /\ - v (Seq.index (impl.f_repr a) i) < v Libcrux_ml_kem.Vector.Traits.v_FIELD_MODULUS)); + v (Seq.index (impl.f_repr a) i) >= 0 /\ v (Seq.index (impl.f_repr a) i) < 3329)); f_compress_post = (fun @@ -510,6 +507,7 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = = (fun (a: t_Slice u8) -> let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_1_lemma a in + let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_1_bounded_lemma a in Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_1_ a); f_serialize_4_pre = @@ -540,6 +538,7 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = = (fun (a: t_Slice u8) -> let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_4_lemma a in + let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_4_bounded_lemma a in Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_4_ a); f_serialize_5_pre = @@ -588,6 +587,9 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = = (fun (a: t_Slice u8) -> let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_10_lemma a in + let _:Prims.unit = + Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_10_bounded_lemma a + in Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_10_ a); f_serialize_11_pre = @@ -636,6 +638,9 @@ Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector = = (fun (a: t_Slice u8) -> let _:Prims.unit = Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_12_lemma a in + let _:Prims.unit = + Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_12_bounded_lemma a + in Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_12_ a); f_rej_sample_pre = diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst index ab5746891..1394dbd46 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst @@ -5,6 +5,8 @@ open FStar.Mul #push-options "--z3rlimit 50" +#push-options "--admit_smt_queries true" + let decompress_1_ (#v_T: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] i1: t_Operations v_T) @@ -31,6 +33,8 @@ let decompress_1_ #pop-options +#pop-options + let montgomery_multiply_fe (#v_T: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] i1: t_Operations v_T) @@ -48,6 +52,8 @@ let to_standard_domain v v_MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS +#push-options "--admit_smt_queries true" + let to_unsigned_representative (#v_T: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] i1: t_Operations v_T) @@ -57,6 +63,6 @@ let to_unsigned_representative let fm:v_T = f_bitwise_and_with_constant #v_T #FStar.Tactics.Typeclasses.solve t v_FIELD_MODULUS in - let result:v_T = f_add #v_T #FStar.Tactics.Typeclasses.solve a fm in - let _:Prims.unit = admit () (* Panic freedom *) in - result + f_add #v_T #FStar.Tactics.Typeclasses.solve a fm + +#pop-options diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti index dd493a634..48acb8256 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fsti @@ -436,8 +436,8 @@ val to_standard_domain (#v_T: Type0) {| i1: t_Operations v_T |} (v: v_T) val to_unsigned_representative (#v_T: Type0) {| i1: t_Operations v_T |} (a: v_T) : Prims.Pure v_T - (requires Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)) - (ensures + (requires Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)) + (ensures fun result -> let result:v_T = result in f_to_i16_array result == diff --git a/libcrux-ml-kem/proofs/fstar/spec/Spec.MLKEM.Math.fst b/libcrux-ml-kem/proofs/fstar/spec/Spec.MLKEM.Math.fst index dabcb0f5c..128981634 100644 --- a/libcrux-ml-kem/proofs/fstar/spec/Spec.MLKEM.Math.fst +++ b/libcrux-ml-kem/proofs/fstar/spec/Spec.MLKEM.Math.fst @@ -275,7 +275,7 @@ let serialize_post (coefficients: t_Array i16 (sz 16) { serialize_pre d1 coefficients }) (output: t_Array u8 (sz (d1 * 2))) = BitVecEq.int_t_array_bitwise_eq coefficients d1 - output 8 + output 8 // TODO: this is an alternative version of byte_decode // rename to decoded bytes @@ -284,5 +284,6 @@ let deserialize_post (bytes: t_Array u8 (sz (d1 * 2))) (output: t_Array i16 (sz 16)) = BitVecEq.int_t_array_bitwise_eq bytes 8 - output d1 + output d1 /\ + forall (i:nat). i < 16 ==> bounded (Seq.index output i) d1 #pop-options diff --git a/libcrux-ml-kem/src/ind_cpa.rs b/libcrux-ml-kem/src/ind_cpa.rs index 4673dca06..493839a6c 100644 --- a/libcrux-ml-kem/src/ind_cpa.rs +++ b/libcrux-ml-kem/src/ind_cpa.rs @@ -291,12 +291,13 @@ pub(crate) fn generate_keypair< /// Call [`compress_then_serialize_ring_element_u`] on each ring element. #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::fstar::options("--z3rlimit 200")] #[hax_lib::requires(fstar!("Spec.MLKEM.is_rank $K /\\ $OUT_LEN == Spec.MLKEM.v_C1_SIZE $K /\\ $COMPRESSION_FACTOR == Spec.MLKEM.v_VECTOR_U_COMPRESSION_FACTOR $K /\\ $BLOCK_LEN == Spec.MLKEM.v_C1_BLOCK_SIZE $K /\\ - ${out.len()} == $OUT_LEN"))] + ${out.len()} == $OUT_LEN /\\ + (forall (i:nat). i < v $K ==> + Libcrux_ml_kem.Serialize.coefficients_field_modulus_range (Seq.index $input i))"))] #[hax_lib::ensures(|_| fstar!("$out_future == Spec.MLKEM.compress_then_encode_u #$K (Libcrux_ml_kem.Polynomial.to_spec_vector_t #$K #$:Vector $input)") @@ -317,7 +318,8 @@ fn compress_then_serialize_u< // for the following bug https://github.com/hacspec/hax/issues/720 cloop! { for (i, re) in input.into_iter().enumerate() { - hax_lib::loop_invariant!(|i: usize| out.len() == OUT_LEN); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i < v $K ==> (Seq.length out == v $OUT_LEN /\\ + Libcrux_ml_kem.Serialize.coefficients_field_modulus_range (Seq.index $input (v $i)))") }); out[i * (OUT_LEN / K)..(i + 1) * (OUT_LEN / K)].copy_from_slice( &compress_then_serialize_ring_element_u::(&re), ); diff --git a/libcrux-ml-kem/src/serialize.rs b/libcrux-ml-kem/src/serialize.rs index c9f071153..6779d0e7f 100644 --- a/libcrux-ml-kem/src/serialize.rs +++ b/libcrux-ml-kem/src/serialize.rs @@ -6,34 +6,43 @@ use crate::{ }; #[inline(always)] +#[hax_lib::fstar::before(interface, "[@@ \"opaque_to_smt\"] +let coefficients_field_modulus_range (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (re: Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector) = + forall (i:nat). i < 16 ==> field_modulus_range (Seq.index re.f_coefficients i)")] +#[hax_lib::fstar::before(interface, "[@@ \"opaque_to_smt\"] +let field_modulus_range (#v_Vector: Type0) + {| i1: Libcrux_ml_kem.Vector.Traits.t_Operations v_Vector |} + (a: v_Vector) = + let coef = Libcrux_ml_kem.Vector.Traits.f_to_i16_array a in + forall (i:nat). i < 16 ==> v (Seq.index coef i) > -(v $FIELD_MODULUS) /\\ + v (Seq.index coef i) < v $FIELD_MODULUS")] #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $a) i) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $a) i) < v $FIELD_MODULUS"))] +#[hax_lib::requires(fstar!("field_modulus_range $a"))] #[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $result) i) >= 0 /\\ v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array $result) i) < v $FIELD_MODULUS"))] pub(super) fn to_unsigned_field_modulus( a: Vector, ) -> Vector { + hax_lib::fstar!("reveal_opaque (`%field_modulus_range) (field_modulus_range #$:Vector)"); to_unsigned_representative::(a) } #[inline(always)] #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> - (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS)"))] +#[hax_lib::requires(fstar!("coefficients_field_modulus_range $re"))] pub(super) fn compress_then_serialize_message( re: PolynomialRingElement, ) -> [u8; SHARED_SECRET_SIZE] { let mut serialized = [0u8; SHARED_SECRET_SIZE]; for i in 0..16 { - hax_lib::loop_invariant!(|i: usize| { fstar!("v $i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS)") }); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i < 16 ==> + coefficients_field_modulus_range $re") }); hax_lib::fstar!("assert (2 * v $i + 2 <= 32)"); + hax_lib::fstar!("reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #$:Vector)"); let coefficient = to_unsigned_field_modulus(re.coefficients[i]); let coefficient_compressed = Vector::compress_1(coefficient); @@ -43,6 +52,7 @@ pub(super) fn compress_then_serialize_message( serialized } + #[inline(always)] #[hax_lib::fstar::verification_status(lax)] pub(super) fn deserialize_then_decompress_message( @@ -58,21 +68,18 @@ pub(super) fn deserialize_then_decompress_message( #[inline(always)] #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] -#[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> - (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS)"))] +#[hax_lib::requires(fstar!("coefficients_field_modulus_range $re"))] pub(super) fn serialize_uncompressed_ring_element( re: &PolynomialRingElement, ) -> [u8; BYTES_PER_RING_ELEMENT] { hax_lib::fstar!("assert_norm (pow2 12 == 4096)"); let mut serialized = [0u8; BYTES_PER_RING_ELEMENT]; for i in 0..VECTORS_IN_RING_ELEMENT { - hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ + v $i < 16 ==> coefficients_field_modulus_range $re") }); hax_lib::fstar!("assert (24 * v $i + 24 <= 384)"); + hax_lib::fstar!("reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #$:Vector)"); let coefficient = to_unsigned_field_modulus(re.coefficients[i]); let bytes = Vector::serialize_12(coefficient); @@ -152,21 +159,18 @@ pub(super) fn deserialize_ring_elements_reduced< #[inline(always)] #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] -#[hax_lib::requires(fstar!("v $OUT_LEN == 320 /\\ (forall (i:nat). i < 16 ==> - (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] +#[hax_lib::requires(fstar!("v $OUT_LEN == 320 /\\ coefficients_field_modulus_range $re"))] fn compress_then_serialize_10( re: &PolynomialRingElement, ) -> [u8; OUT_LEN] { hax_lib::fstar!("assert_norm (pow2 10 == 1024)"); let mut serialized = [0u8; OUT_LEN]; for i in 0..VECTORS_IN_RING_ELEMENT { - hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ + v $i < 16 ==> coefficients_field_modulus_range $re") }); hax_lib::fstar!("assert (20 * v $i + 20 <= 320)"); + hax_lib::fstar!("reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #$:Vector)"); let coefficient = Vector::compress::<10>(to_unsigned_field_modulus(re.coefficients[i])); @@ -193,11 +197,8 @@ fn compress_then_serialize_11( } #[inline(always)] -#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] -#[hax_lib::requires(fstar!("(v $COMPRESSION_FACTOR == 10 \\/ v $COMPRESSION_FACTOR == 11) /\\ v $OUT_LEN == 32 * v $COMPRESSION_FACTOR /\\ - (forall (i:nat). i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] +#[hax_lib::requires(fstar!("(v $COMPRESSION_FACTOR == 10 \\/ v $COMPRESSION_FACTOR == 11) /\\ + v $OUT_LEN == 32 * v $COMPRESSION_FACTOR /\\ coefficients_field_modulus_range $re"))] pub(super) fn compress_then_serialize_ring_element_u< const COMPRESSION_FACTOR: usize, const OUT_LEN: usize, @@ -218,26 +219,25 @@ pub(super) fn compress_then_serialize_ring_element_u< #[inline(always)] #[hax_lib::fstar::verification_status(panic_free)] -#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] -#[hax_lib::requires(fstar!("Seq.length $serialized == 128 /\\ (forall (i:nat). i < 16 ==> - (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] +#[hax_lib::requires(fstar!("Seq.length $serialized == 128 /\\ + coefficients_field_modulus_range $re"))] +#[hax_lib::ensures(|_| + fstar!("${serialized_future.len()} == ${serialized.len()}") +)] fn compress_then_serialize_4( re: PolynomialRingElement, serialized: &mut [u8], ) { hax_lib::fstar!("assert_norm (pow2 4 == 16)"); - let _serialized_len = serialized.len(); // The semicolon and parentheses at the end of loop are a workaround // for the following bug https://github.com/hacspec/hax/issues/720 for i in 0..VECTORS_IN_RING_ELEMENT { // NOTE: Using `$serialized` in loop_invariant doesn't work here hax_lib::loop_invariant!(|i: usize| { fstar!("v $i >= 0 /\\ v $i <= 16 /\\ - Seq.length serialized == v $_serialized_len /\\ (v $i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[i]) j) < v $FIELD_MODULUS))") }); + v $i < 16 ==> (Seq.length serialized == 128 /\\ coefficients_field_modulus_range $re)") }); hax_lib::fstar!("assert (8 * v $i + 8 <= 128)"); + hax_lib::fstar!("reveal_opaque (`%coefficients_field_modulus_range) + (coefficients_field_modulus_range #$:Vector)"); let coefficient = Vector::compress::<4>(to_unsigned_field_modulus(re.coefficients[i])); @@ -252,15 +252,16 @@ fn compress_then_serialize_4( #[hax_lib::requires( serialized.len() == 160 )] +#[hax_lib::ensures(|_| + fstar!("${serialized_future.len()} == ${serialized.len()}") +)] fn compress_then_serialize_5( re: PolynomialRingElement, serialized: &mut [u8], ) { - let _serialized_len = serialized.len(); // The semicolon and parentheses at the end of loop are a workaround // for the following bug https://github.com/hacspec/hax/issues/720 for i in 0..VECTORS_IN_RING_ELEMENT { - hax_lib::loop_invariant!(|i: usize| serialized.len() == _serialized_len); let coefficients = Vector::compress::<5>(to_unsigned_representative::(re.coefficients[i])); @@ -271,11 +272,8 @@ fn compress_then_serialize_5( } #[inline(always)] -#[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 500")] #[hax_lib::requires(fstar!("(v $COMPRESSION_FACTOR == 4 \\/ v $COMPRESSION_FACTOR == 5) /\\ v $OUT_LEN == 32 * v $COMPRESSION_FACTOR /\\ - Seq.length $out == v $OUT_LEN /\\ (forall (i:nat). i < 16 ==> (forall (j:nat). j < 16 ==> - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) >= -(v $FIELD_MODULUS) /\\ - v (Seq.index (Libcrux_ml_kem.Vector.Traits.f_to_i16_array ${re.coefficients}.[sz i]) j) < v $FIELD_MODULUS))"))] + Seq.length $out == v $OUT_LEN /\\ coefficients_field_modulus_range $re"))] #[hax_lib::ensures(|_| fstar!("${out_future.len()} == ${out.len()}") )] diff --git a/libcrux-ml-kem/src/vector/avx2.rs b/libcrux-ml-kem/src/vector/avx2.rs index 3306c8433..8f73537cf 100644 --- a/libcrux-ml-kem/src/vector/avx2.rs +++ b/libcrux-ml-kem/src/vector/avx2.rs @@ -142,7 +142,7 @@ impl Operations for SIMD256Vector { } #[requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $vector) i) >= 0 /\\ - v (Seq.index (impl.f_repr $vector) i) < v $FIELD_MODULUS"))] + v (Seq.index (impl.f_repr $vector) i) < 3329"))] #[ensures(|out| fstar!("forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) 1"))] fn compress_1(vector: Self) -> Self { hax_lib::fstar!("admit()"); @@ -156,7 +156,7 @@ impl Operations for SIMD256Vector { v $COEFFICIENT_BITS == 10 \\/ v $COEFFICIENT_BITS == 11) /\\ (forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $vector) i) >= 0 /\\ - v (Seq.index (impl.f_repr $vector) i) < v $FIELD_MODULUS)"))] + v (Seq.index (impl.f_repr $vector) i) < 3329)"))] #[ensures(|out| fstar!("(v $COEFFICIENT_BITS == 4 \\/ v $COEFFICIENT_BITS == 5 \\/ v $COEFFICIENT_BITS == 10 \\/ diff --git a/libcrux-ml-kem/src/vector/portable.rs b/libcrux-ml-kem/src/vector/portable.rs index 16d99dba7..6a631d556 100644 --- a/libcrux-ml-kem/src/vector/portable.rs +++ b/libcrux-ml-kem/src/vector/portable.rs @@ -99,7 +99,7 @@ impl Operations for PortableVector { } #[requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $a) i) >= 0 /\\ - v (Seq.index (impl.f_repr $a) i) < v $FIELD_MODULUS"))] + v (Seq.index (impl.f_repr $a) i) < 3329"))] #[ensures(|out| fstar!("forall (i:nat). i < 16 ==> bounded (Seq.index (impl.f_repr $out) i) 1"))] fn compress_1(a: Self) -> Self { compress_1(a) @@ -110,7 +110,7 @@ impl Operations for PortableVector { v $COEFFICIENT_BITS == 10 \\/ v $COEFFICIENT_BITS == 11) /\\ (forall (i:nat). i < 16 ==> v (Seq.index (impl.f_repr $a) i) >= 0 /\\ - v (Seq.index (impl.f_repr $a) i) < v $FIELD_MODULUS)"))] + v (Seq.index (impl.f_repr $a) i) < 3329)"))] #[ensures(|out| fstar!("(v $COEFFICIENT_BITS == 4 \\/ v $COEFFICIENT_BITS == 5 \\/ v $COEFFICIENT_BITS == 10 \\/ @@ -199,6 +199,7 @@ impl Operations for PortableVector { #[ensures(|out| fstar!("sz (Seq.length $a) =. sz 2 ==> Spec.MLKEM.deserialize_post 1 $a (impl.f_repr $out)"))] fn deserialize_1(a: &[u8]) -> Self { hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_1_lemma $a"); + hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_1_bounded_lemma $a"); deserialize_1(a) } @@ -214,6 +215,7 @@ impl Operations for PortableVector { #[ensures(|out| fstar!("sz (Seq.length $a) =. sz 8 ==> Spec.MLKEM.deserialize_post 4 $a (impl.f_repr $out)"))] fn deserialize_4(a: &[u8]) -> Self { hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_4_lemma $a"); + hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_4_bounded_lemma $a"); deserialize_4(a) } @@ -237,6 +239,7 @@ impl Operations for PortableVector { #[ensures(|out| fstar!("sz (Seq.length $a) =. sz 20 ==> Spec.MLKEM.deserialize_post 10 $a (impl.f_repr $out)"))] fn deserialize_10(a: &[u8]) -> Self { hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_10_lemma $a"); + hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_10_bounded_lemma $a"); deserialize_10(a) } @@ -260,6 +263,7 @@ impl Operations for PortableVector { #[ensures(|out| fstar!("sz (Seq.length $a) =. sz 24 ==> Spec.MLKEM.deserialize_post 12 $a (impl.f_repr $out)"))] fn deserialize_12(a: &[u8]) -> Self { hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_12_lemma $a"); + hax_lib::fstar!("Libcrux_ml_kem.Vector.Portable.Serialize.deserialize_12_bounded_lemma $a"); deserialize_12(a) } diff --git a/libcrux-ml-kem/src/vector/portable/compress.rs b/libcrux-ml-kem/src/vector/portable/compress.rs index 8183d26d5..fa8e5a0ee 100644 --- a/libcrux-ml-kem/src/vector/portable/compress.rs +++ b/libcrux-ml-kem/src/vector/portable/compress.rs @@ -94,7 +94,7 @@ let compress_message_coefficient_range_helper (fe: u16) : Lemma "))] #[hax_lib::fstar::options("--fuel 0 --ifuel 0 --z3rlimit 2000")] #[hax_lib::requires(fstar!("forall (i:nat). i < 16 ==> v (Seq.index ${a}.f_elements i) >= 0 /\\ - v (Seq.index ${a}.f_elements i) < v $FIELD_MODULUS"))] + v (Seq.index ${a}.f_elements i) < 3329"))] #[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> v (${result}.f_elements.[ sz i ] <: i16) >= 0 /\\ v (${result}.f_elements.[ sz i ] <: i16) < 2"))] pub(crate) fn compress_1(mut a: PortableVector) -> PortableVector { @@ -123,7 +123,7 @@ pub(crate) fn compress_1(mut a: PortableVector) -> PortableVector { v $COEFFICIENT_BITS == 10 \\/ v $COEFFICIENT_BITS == 11) /\\ (forall (i:nat). i < 16 ==> v (Seq.index ${a}.f_elements i) >= 0 /\\ - v (Seq.index ${a}.f_elements i) < v $FIELD_MODULUS)"))] + v (Seq.index ${a}.f_elements i) < 3329)"))] #[hax_lib::ensures(|result| fstar!("forall (i:nat). i < 16 ==> v (${result}.f_elements.[ sz i ] <: i16) >= 0 /\\ v (${result}.f_elements.[ sz i ] <: i16) < pow2 (v $COEFFICIENT_BITS))"))] pub(crate) fn compress(mut a: PortableVector) -> PortableVector { diff --git a/libcrux-ml-kem/src/vector/portable/serialize.rs b/libcrux-ml-kem/src/vector/portable/serialize.rs index e10194a40..151c1b31b 100644 --- a/libcrux-ml-kem/src/vector/portable/serialize.rs +++ b/libcrux-ml-kem/src/vector/portable/serialize.rs @@ -59,6 +59,16 @@ pub(crate) fn serialize_1(v: PortableVector) -> [u8; 2] { ] } +//deserialize_1_bounded_lemma +#[cfg_attr(hax, hax_lib::fstar::after(interface, " +val deserialize_1_bounded_lemma (inputs: t_Array u8 (sz 2)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (${deserialize_1} inputs).f_elements i) 1) +"))] +#[cfg_attr(hax, hax_lib::fstar::after(" +let deserialize_1_bounded_lemma inputs = + admit() +"))] +//deserialize_1_lemma #[cfg_attr(hax, hax_lib::fstar::after(interface, " val deserialize_1_lemma (inputs: t_Array u8 (sz 2)) : Lemma (ensures bit_vec_of_int_t_array (${deserialize_1} inputs).f_elements 1 == bit_vec_of_int_t_array inputs 8) @@ -73,6 +83,7 @@ let deserialize_1_lemma inputs = #pop-options "))] +//deserialize_1_bit_vec_lemma #[cfg_attr(hax, hax_lib::fstar::after(" #push-options \"--compat_pre_core 2 --z3rlimit 300 --z3refresh\" @@ -200,6 +211,16 @@ pub(crate) fn deserialize_4_int(bytes: &[u8]) -> (i16, i16, i16, i16, i16, i16, (v0, v1, v2, v3, v4, v5, v6, v7) } +//deserialize_4_bounded_lemma +#[cfg_attr(hax, hax_lib::fstar::after(interface, " +val deserialize_4_bounded_lemma (inputs: t_Array u8 (sz 8)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (${deserialize_4} inputs).f_elements i) 4) +"))] +#[cfg_attr(hax, hax_lib::fstar::after(" +let deserialize_4_bounded_lemma inputs = + admit() +"))] +//deserialize_4_lemma #[cfg_attr(hax, hax_lib::fstar::after(interface, " val deserialize_4_lemma (inputs: t_Array u8 (sz 8)) : Lemma (ensures bit_vec_of_int_t_array (${deserialize_4} inputs).f_elements 4 == bit_vec_of_int_t_array inputs 8) @@ -214,6 +235,7 @@ let deserialize_4_lemma inputs = #pop-options "))] +//deserialize_4_bit_vec_lemma #[cfg_attr(hax, hax_lib::fstar::after(" #push-options \"--compat_pre_core 2 --z3rlimit 300 --z3refresh\" @@ -454,6 +476,16 @@ pub(crate) fn deserialize_10_int(bytes: &[u8]) -> (i16, i16, i16, i16, i16, i16, (r0, r1, r2, r3, r4, r5, r6, r7) } +//deserialize_10_bounded_lemma +#[cfg_attr(hax, hax_lib::fstar::after(interface, " +val deserialize_10_bounded_lemma (inputs: t_Array u8 (sz 20)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (${deserialize_10} inputs).f_elements i) 10) +"))] +#[cfg_attr(hax, hax_lib::fstar::after(" +let deserialize_10_bounded_lemma inputs = + admit() +"))] +//deserialize_10_lemma #[cfg_attr(hax, hax_lib::fstar::after(interface, " val deserialize_10_lemma (inputs: t_Array u8 (sz 20)) : Lemma (ensures bit_vec_of_int_t_array (${deserialize_10} inputs).f_elements 10 == bit_vec_of_int_t_array inputs 8) @@ -468,6 +500,7 @@ let deserialize_10_lemma inputs = #pop-options "))] +//deserialize_10_bit_vec_lemma #[cfg_attr(hax, hax_lib::fstar::after(" #push-options \"--compat_pre_core 2 --z3rlimit 300 --z3refresh\" @@ -711,6 +744,16 @@ pub(crate) fn deserialize_12_int(bytes: &[u8]) -> (i16, i16) { (r0, r1) } +//deserialize_12_bounded_lemma +#[cfg_attr(hax, hax_lib::fstar::after(interface, " +val deserialize_12_bounded_lemma (inputs: t_Array u8 (sz 24)) : Lemma + (ensures forall i. i < 16 ==> bounded (Seq.index (${deserialize_12} inputs).f_elements i) 12) +"))] +#[cfg_attr(hax, hax_lib::fstar::after(" +let deserialize_12_bounded_lemma inputs = + admit() +"))] +//deserialize_12_lemma #[cfg_attr(hax, hax_lib::fstar::after(interface, " val deserialize_12_lemma (inputs: t_Array u8 (sz 24)) : Lemma (ensures bit_vec_of_int_t_array (${deserialize_12} inputs).f_elements 12 == bit_vec_of_int_t_array inputs 8) @@ -725,6 +768,7 @@ let deserialize_12_lemma inputs = #pop-options "))] +//deserialize_12_bit_vec_lemma #[cfg_attr(hax, hax_lib::fstar::after(" #push-options \"--compat_pre_core 2 --z3rlimit 300 --z3refresh\" diff --git a/libcrux-ml-kem/src/vector/traits.rs b/libcrux-ml-kem/src/vector/traits.rs index 6c8a2cb21..dacbec1a3 100644 --- a/libcrux-ml-kem/src/vector/traits.rs +++ b/libcrux-ml-kem/src/vector/traits.rs @@ -223,16 +223,17 @@ pub fn to_standard_domain(v: T) -> T { T::montgomery_multiply_by_constant(v, MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS as i16) } -#[hax_lib::fstar::verification_status(panic_free)] +#[hax_lib::fstar::verification_status(lax)] +#[hax_lib::requires(fstar!("Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)"))] #[hax_lib::ensures(|result| fstar!("f_to_i16_array $result == Spec.Utils.map2 (+.) (f_to_i16_array $a) (Spec.Utils.map_array (fun x -> (x >>! 15l) &. $FIELD_MODULUS) (f_to_i16_array $a))"))] -#[hax_lib::requires(fstar!("Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)"))] pub fn to_unsigned_representative(a: T) -> T { let t = T::shift_right::<15>(a); let fm = T::bitwise_and_with_constant(t, FIELD_MODULUS); T::add(a, &fm) } +#[hax_lib::fstar::verification_status(lax)] #[hax_lib::fstar::options("--z3rlimit 50")] #[hax_lib::requires(fstar!("forall i. let x = Seq.index (i1._super_8706949974463268012.f_repr ${vec}) i in (x == 0s \\/ x == 1s)"))] From a0a7d89f298a757de9c8e0c4ea9792ddb664fa4d Mon Sep 17 00:00:00 2001 From: mamonet Date: Sun, 22 Sep 2024 19:18:51 +0000 Subject: [PATCH 05/14] Use `fold-enum-slice` hax branch --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5c2c65ea..1ba626ec1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,9 +191,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -300,9 +300,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -312,9 +312,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "hax-lib" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#9313dbaa10a1c769daded71b641cf1d4854c8dfb" +source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" dependencies = [ "hax-lib-macros", "num-bigint", @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "hax-lib-macros" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#9313dbaa10a1c769daded71b641cf1d4854c8dfb" +source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" dependencies = [ "hax-lib-macros-types", "paste", @@ -725,7 +725,7 @@ dependencies = [ [[package]] name = "hax-lib-macros-types" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#9313dbaa10a1c769daded71b641cf1d4854c8dfb" +source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 1b8317ec1..bfa8a2d6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,8 +79,8 @@ getrandom = { version = "0.2", features = ["js"], optional = true } # This is only required when doing proofs. #[target.'cfg(hax)'.dependencies] [workspace.dependencies] -hax-lib-macros = { git = "https://github.com/hacspec/hax", branch = "main" } -hax-lib = { git = "https://github.com/hacspec/hax/", branch = "main" } +hax-lib-macros = { git = "https://github.com/hacspec/hax", branch = "fold-enum-slice" } +hax-lib = { git = "https://github.com/hacspec/hax/", branch = "fold-enum-slice" } [dev-dependencies] libcrux = { path = ".", features = ["rand", "tests"] } From 737bf435cc71dfa8e0b385ec5da962532a46f6e1 Mon Sep 17 00:00:00 2001 From: mamonet Date: Mon, 23 Sep 2024 06:33:05 +0000 Subject: [PATCH 06/14] Use main branch of hax --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ba626ec1..de7055b90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "hax-lib" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" +source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" dependencies = [ "hax-lib-macros", "num-bigint", @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "hax-lib-macros" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" +source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" dependencies = [ "hax-lib-macros-types", "paste", @@ -725,7 +725,7 @@ dependencies = [ [[package]] name = "hax-lib-macros-types" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=fold-enum-slice#0bb2f9bdce8f36cecd87a0adb59a975ddf660fca" +source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index bfa8a2d6e..1b8317ec1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,8 +79,8 @@ getrandom = { version = "0.2", features = ["js"], optional = true } # This is only required when doing proofs. #[target.'cfg(hax)'.dependencies] [workspace.dependencies] -hax-lib-macros = { git = "https://github.com/hacspec/hax", branch = "fold-enum-slice" } -hax-lib = { git = "https://github.com/hacspec/hax/", branch = "fold-enum-slice" } +hax-lib-macros = { git = "https://github.com/hacspec/hax", branch = "main" } +hax-lib = { git = "https://github.com/hacspec/hax/", branch = "main" } [dev-dependencies] libcrux = { path = ".", features = ["rand", "tests"] } From c7c3b3e5e40dc188bd55a798bdca9673f44db161 Mon Sep 17 00:00:00 2001 From: mamonet Date: Mon, 23 Sep 2024 06:39:22 +0000 Subject: [PATCH 07/14] Remove `use crate::vector::FIELD_MODULUS` --- libcrux-ml-kem/src/vector/avx2.rs | 2 -- libcrux-ml-kem/src/vector/portable.rs | 2 -- 2 files changed, 4 deletions(-) diff --git a/libcrux-ml-kem/src/vector/avx2.rs b/libcrux-ml-kem/src/vector/avx2.rs index 8f73537cf..907f14ecd 100644 --- a/libcrux-ml-kem/src/vector/avx2.rs +++ b/libcrux-ml-kem/src/vector/avx2.rs @@ -7,8 +7,6 @@ mod ntt; mod sampling; mod serialize; -use crate::vector::FIELD_MODULUS; - #[derive(Clone, Copy)] #[hax_lib::fstar::before(interface,"noeq")] #[hax_lib::fstar::after(interface,"let repr (x:t_SIMD256Vector) : t_Array i16 (sz 16) = Libcrux_intrinsics.Avx2_extract.vec256_as_i16x16 x.f_elements")] diff --git a/libcrux-ml-kem/src/vector/portable.rs b/libcrux-ml-kem/src/vector/portable.rs index 6a631d556..0c1d07d1e 100644 --- a/libcrux-ml-kem/src/vector/portable.rs +++ b/libcrux-ml-kem/src/vector/portable.rs @@ -15,8 +15,6 @@ use vector_type::*; pub(crate) use vector_type::PortableVector; -use crate::vector::FIELD_MODULUS; - #[cfg(hax)] impl crate::vector::traits::Repr for PortableVector { fn repr(x: Self) -> [i16; 16] { From ec66aac38b08189f6af07b83cb322c228ab537d4 Mon Sep 17 00:00:00 2001 From: mamonet Date: Mon, 23 Sep 2024 07:34:15 +0000 Subject: [PATCH 08/14] Update serialize.rs --- .../fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst | 4 ---- .../extraction/Libcrux_ml_kem.Serialize.fst | 16 ++++++---------- libcrux-ml-kem/src/serialize.rs | 4 ++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst index 245a00761..7246b601c 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Ind_cpa.fst @@ -197,8 +197,6 @@ let sample_vector_cbd_then_ntt let _:Prims.unit = admit () (* Panic freedom *) in result -#push-options "--z3rlimit 200" - let compress_then_serialize_u (v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize) (#v_Vector: Type0) @@ -265,8 +263,6 @@ let compress_then_serialize_u let hax_temp_output:Prims.unit = result in out -#pop-options - #push-options "--admit_smt_queries true" let deserialize_then_decompress_u diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst index 2226342d3..c2604b65e 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Serialize.fst @@ -617,8 +617,6 @@ let deserialize_then_decompress_5_ in re -#push-options "--admit_smt_queries true" - let deserialize_then_decompress_message (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -669,9 +667,9 @@ let deserialize_then_decompress_message in re) in - re - -#pop-options + let result:Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector = re in + let _:Prims.unit = admit () (* Panic freedom *) in + result let deserialize_then_decompress_ring_element_u (v_COMPRESSION_FACTOR: usize) @@ -715,8 +713,6 @@ let deserialize_then_decompress_ring_element_v <: Rust_primitives.Hax.t_Never) -#push-options "--admit_smt_queries true" - let deserialize_to_reduced_ring_element (#v_Vector: Type0) (#[FStar.Tactics.Typeclasses.tcresolve ()] @@ -763,9 +759,9 @@ let deserialize_to_reduced_ring_element in re) in - re - -#pop-options + let result:Libcrux_ml_kem.Polynomial.t_PolynomialRingElement v_Vector = re in + let _:Prims.unit = admit () (* Panic freedom *) in + result let deserialize_ring_elements_reduced (v_K: usize) diff --git a/libcrux-ml-kem/src/serialize.rs b/libcrux-ml-kem/src/serialize.rs index 6779d0e7f..55c49e527 100644 --- a/libcrux-ml-kem/src/serialize.rs +++ b/libcrux-ml-kem/src/serialize.rs @@ -54,7 +54,7 @@ pub(super) fn compress_then_serialize_message( } #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] +#[hax_lib::fstar::verification_status(panic_free)] pub(super) fn deserialize_then_decompress_message( serialized: [u8; SHARED_SECRET_SIZE], ) -> PolynomialRingElement { @@ -111,7 +111,7 @@ pub(super) fn deserialize_to_uncompressed_ring_element( /// /// This MUST NOT be used with secret inputs, like its caller `deserialize_ring_elements_reduced`. #[inline(always)] -#[hax_lib::fstar::verification_status(lax)] +#[hax_lib::fstar::verification_status(panic_free)] #[hax_lib::requires( serialized.len() == BYTES_PER_RING_ELEMENT )] From aee4c5b7de9c48eb0e6bf3165f40564521abfe75 Mon Sep 17 00:00:00 2001 From: mamonet Date: Mon, 23 Sep 2024 07:40:56 +0000 Subject: [PATCH 09/14] Update traits.rs --- libcrux-ml-kem/src/vector/traits.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/libcrux-ml-kem/src/vector/traits.rs b/libcrux-ml-kem/src/vector/traits.rs index 9d4ce44c3..8239a12db 100644 --- a/libcrux-ml-kem/src/vector/traits.rs +++ b/libcrux-ml-kem/src/vector/traits.rs @@ -223,7 +223,6 @@ pub fn to_standard_domain(v: T) -> T { T::montgomery_multiply_by_constant(v, MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS as i16) } -#[hax_lib::fstar::verification_status(lax)] #[hax_lib::fstar::options("--z3rlimit 100")] #[hax_lib::requires(fstar!("Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)"))] #[hax_lib::ensures(|result| fstar!("forall i. From 44af8bab271322d2ad322d9a703b62a22e168fdd Mon Sep 17 00:00:00 2001 From: mamonet Date: Mon, 23 Sep 2024 09:47:34 +0000 Subject: [PATCH 10/14] Mark to_unsigned_representative as lax --- .../proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst | 2 +- libcrux-ml-kem/src/vector/traits.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst index 5557ab9f0..31c67d6b2 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Traits.fst @@ -53,7 +53,7 @@ let to_standard_domain v v_MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS -#push-options "--z3rlimit 100" +#push-options "--admit_smt_queries true" let to_unsigned_representative (#v_T: Type0) diff --git a/libcrux-ml-kem/src/vector/traits.rs b/libcrux-ml-kem/src/vector/traits.rs index 8239a12db..2ee7d1667 100644 --- a/libcrux-ml-kem/src/vector/traits.rs +++ b/libcrux-ml-kem/src/vector/traits.rs @@ -223,7 +223,7 @@ pub fn to_standard_domain(v: T) -> T { T::montgomery_multiply_by_constant(v, MONTGOMERY_R_SQUARED_MOD_FIELD_MODULUS as i16) } -#[hax_lib::fstar::options("--z3rlimit 100")] +#[hax_lib::fstar::verification_status(lax)] #[hax_lib::requires(fstar!("Spec.Utils.is_i16b_array 3328 (i1._super_8706949974463268012.f_repr a)"))] #[hax_lib::ensures(|result| fstar!("forall i. (let x = Seq.index (i1._super_8706949974463268012.f_repr ${a}) i in From 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d Mon Sep 17 00:00:00 2001 From: Karthikeyan Bhargavan Date: Tue, 24 Sep 2024 11:36:47 +0200 Subject: [PATCH 11/14] f* reextract --- Cargo.lock | 10 +-- ...bcrux_ml_kem.Vector.Portable.Serialize.fst | 66 ------------------- ...crux_ml_kem.Vector.Portable.Serialize.fsti | 16 ----- 3 files changed, 5 insertions(+), 87 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f73d6fed..e09691d28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "hax-lib" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" +source = "git+https://github.com/hacspec/hax/?branch=main#c2093b4963099522c65f5cd42b96d6433afb0617" dependencies = [ "hax-lib-macros", "num-bigint", @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "hax-lib-macros" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" +source = "git+https://github.com/hacspec/hax/?branch=main#c2093b4963099522c65f5cd42b96d6433afb0617" dependencies = [ "hax-lib-macros-types", "paste", @@ -725,7 +725,7 @@ dependencies = [ [[package]] name = "hax-lib-macros-types" version = "0.1.0-pre.1" -source = "git+https://github.com/hacspec/hax/?branch=main#0bd125aa5ab3ce2400ac3e01072710bb628b270f" +source = "git+https://github.com/hacspec/hax/?branch=main#c2093b4963099522c65f5cd42b96d6433afb0617" dependencies = [ "proc-macro2", "quote", @@ -1259,9 +1259,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst index de5f6acf6..37ca063e4 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fst @@ -472,42 +472,9 @@ let deserialize_10_lemma inputs = #pop-options -<<<<<<< HEAD let deserialize_10_bounded_lemma inputs = admit() -let deserialize_11_ (bytes: t_Slice u8) = - let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = - deserialize_11_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 11 } - <: - Core.Ops.Range.t_Range usize ] - <: - t_Slice u8) - in - let v8_15_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = - deserialize_11_int (bytes.[ { Core.Ops.Range.f_start = sz 11; Core.Ops.Range.f_end = sz 22 } - <: - Core.Ops.Range.t_Range usize ] - <: - t_Slice u8) - in - { - Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - = - let list = - [ - v0_7_._1; v0_7_._2; v0_7_._3; v0_7_._4; v0_7_._5; v0_7_._6; v0_7_._7; v0_7_._8; v8_15_._1; - v8_15_._2; v8_15_._3; v8_15_._4; v8_15_._5; v8_15_._6; v8_15_._7; v8_15_._8 - ] - in - FStar.Pervasives.assert_norm (Prims.eq2 (List.Tot.length list) 16); - Rust_primitives.Hax.array_of_list 16 list - } - <: - Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - -======= ->>>>>>> dev let deserialize_12_ (bytes: t_Slice u8) = let v0_1_:(i16 & i16) = deserialize_12_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 3 } @@ -655,42 +622,9 @@ let deserialize_4_lemma inputs = #pop-options -<<<<<<< HEAD let deserialize_4_bounded_lemma inputs = admit() -let deserialize_5_ (bytes: t_Slice u8) = - let v0_7_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = - deserialize_5_int (bytes.[ { Core.Ops.Range.f_start = sz 0; Core.Ops.Range.f_end = sz 5 } - <: - Core.Ops.Range.t_Range usize ] - <: - t_Slice u8) - in - let v8_15_:(i16 & i16 & i16 & i16 & i16 & i16 & i16 & i16) = - deserialize_5_int (bytes.[ { Core.Ops.Range.f_start = sz 5; Core.Ops.Range.f_end = sz 10 } - <: - Core.Ops.Range.t_Range usize ] - <: - t_Slice u8) - in - { - Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements - = - let list = - [ - v0_7_._1; v0_7_._2; v0_7_._3; v0_7_._4; v0_7_._5; v0_7_._6; v0_7_._7; v0_7_._8; v8_15_._1; - v8_15_._2; v8_15_._3; v8_15_._4; v8_15_._5; v8_15_._6; v8_15_._7; v8_15_._8 - ] - in - FStar.Pervasives.assert_norm (Prims.eq2 (List.Tot.length list) 16); - Rust_primitives.Hax.array_of_list 16 list - } - <: - Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - -======= ->>>>>>> dev let serialize_1_ (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) = let result0:u8 = (((((((cast (v.Libcrux_ml_kem.Vector.Portable.Vector_type.f_elements.[ sz 0 ] <: i16) <: u8) |. diff --git a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti index b8bec32b1..97118a4cc 100644 --- a/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti +++ b/libcrux-ml-kem/proofs/fstar/extraction/Libcrux_ml_kem.Vector.Portable.Serialize.fsti @@ -88,17 +88,9 @@ val deserialize_10_ (bytes: t_Slice u8) val deserialize_10_lemma (inputs: t_Array u8 (sz 20)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_10_ inputs).f_elements 10 == bit_vec_of_int_t_array inputs 8) -<<<<<<< HEAD val deserialize_10_bounded_lemma (inputs: t_Array u8 (sz 20)) : Lemma (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_10_ inputs).f_elements i) 10) -val deserialize_11_ (bytes: t_Slice u8) - : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - (requires Core.Slice.impl__len #u8 bytes =. sz 22) - (fun _ -> Prims.l_True) - -======= ->>>>>>> dev val deserialize_12_ (bytes: t_Slice u8) : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector (requires Core.Slice.impl__len #u8 bytes =. sz 24) @@ -118,17 +110,9 @@ val deserialize_4_ (bytes: t_Slice u8) val deserialize_4_lemma (inputs: t_Array u8 (sz 8)) : Lemma (ensures bit_vec_of_int_t_array (deserialize_4_ inputs).f_elements 4 == bit_vec_of_int_t_array inputs 8) -<<<<<<< HEAD val deserialize_4_bounded_lemma (inputs: t_Array u8 (sz 8)) : Lemma (ensures forall i. i < 16 ==> bounded (Seq.index (deserialize_4_ inputs).f_elements i) 4) -val deserialize_5_ (bytes: t_Slice u8) - : Prims.Pure Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector - (requires Core.Slice.impl__len #u8 bytes =. sz 10) - (fun _ -> Prims.l_True) - -======= ->>>>>>> dev val serialize_1_ (v: Libcrux_ml_kem.Vector.Portable.Vector_type.t_PortableVector) : Prims.Pure (t_Array u8 (sz 2)) Prims.l_True (fun _ -> Prims.l_True) From 5971b6982c7af3edf6b84c36aa90697e599288a4 Mon Sep 17 00:00:00 2001 From: karthikbhargavan Date: Tue, 24 Sep 2024 12:54:26 +0000 Subject: [PATCH 12/14] c code refresh --- libcrux-ml-kem/c/code_gen.txt | 10 +- libcrux-ml-kem/c/eurydice_glue.h | 18 - libcrux-ml-kem/c/internal/libcrux_core.h | 81 +- .../c/internal/libcrux_mlkem_avx2.h | 40 +- .../c/internal/libcrux_mlkem_portable.h | 40 +- libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h | 10 +- .../c/internal/libcrux_sha3_internal.h | 138 +- libcrux-ml-kem/c/libcrux_core.c | 88 +- libcrux-ml-kem/c/libcrux_core.h | 17 +- libcrux-ml-kem/c/libcrux_mlkem1024.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem1024_portable.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem1024_portable.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem512.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem512_avx2.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem512_avx2.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem512_portable.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem512_portable.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem768.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem768_avx2.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem768_avx2.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem768_portable.c | 40 +- libcrux-ml-kem/c/libcrux_mlkem768_portable.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem_avx2.c | 1049 ++++++++-------- libcrux-ml-kem/c/libcrux_mlkem_avx2.h | 10 +- libcrux-ml-kem/c/libcrux_mlkem_portable.c | 1107 +++++++++-------- libcrux-ml-kem/c/libcrux_mlkem_portable.h | 14 +- libcrux-ml-kem/c/libcrux_sha3.h | 10 +- libcrux-ml-kem/c/libcrux_sha3_avx2.c | 22 +- libcrux-ml-kem/c/libcrux_sha3_avx2.h | 10 +- libcrux-ml-kem/c/libcrux_sha3_internal.h | 50 +- libcrux-ml-kem/c/libcrux_sha3_neon.c | 10 +- libcrux-ml-kem/c/libcrux_sha3_neon.h | 10 +- libcrux-ml-kem/cg/code_gen.txt | 10 +- libcrux-ml-kem/cg/libcrux_core.h | 66 +- libcrux-ml-kem/cg/libcrux_ct_ops.h | 10 +- libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h | 806 ++++++------ .../cg/libcrux_mlkem768_avx2_types.h | 74 +- libcrux-ml-kem/cg/libcrux_mlkem768_portable.h | 836 +++++++------ .../cg/libcrux_mlkem768_portable_types.h | 80 +- libcrux-ml-kem/cg/libcrux_sha3_avx2.h | 22 +- libcrux-ml-kem/cg/libcrux_sha3_portable.h | 178 +-- 43 files changed, 2562 insertions(+), 2584 deletions(-) diff --git a/libcrux-ml-kem/c/code_gen.txt b/libcrux-ml-kem/c/code_gen.txt index 12d9d454e..21d1a541d 100644 --- a/libcrux-ml-kem/c/code_gen.txt +++ b/libcrux-ml-kem/c/code_gen.txt @@ -1,6 +1,6 @@ This code was generated with the following revisions: -Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 -Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac -Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 -F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty -Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 +Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d +Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 +Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 +F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd +Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d diff --git a/libcrux-ml-kem/c/eurydice_glue.h b/libcrux-ml-kem/c/eurydice_glue.h index ad026b9e1..660918c54 100644 --- a/libcrux-ml-kem/c/eurydice_glue.h +++ b/libcrux-ml-kem/c/eurydice_glue.h @@ -18,13 +18,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #define LowStar_Ignore_ignore(e, t, _ret_t) ((void)e) -#define EURYDICE_ASSERT(test, msg) \ - do { \ - if (!(test)) { \ - fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n", msg, \ - __FILE__, __LINE__); \ - } \ - } while (0) // SLICES, ARRAYS, ETC. @@ -137,10 +130,6 @@ static inline void core_num__u32_8__to_be_bytes(uint32_t src, uint8_t dst[4]) { memcpy(dst, &x, 4); } -static inline void core_num__u32_8__to_le_bytes(uint32_t src, uint8_t dst[4]) { - store32_le(dst, src); -} - static inline uint32_t core_num__u32_8__from_le_bytes(uint8_t buf[4]) { return load32_le(buf); } @@ -148,7 +137,6 @@ static inline uint32_t core_num__u32_8__from_le_bytes(uint8_t buf[4]) { static inline void core_num__u64_9__to_le_bytes(uint64_t v, uint8_t buf[8]) { store64_le(buf, v); } - static inline uint64_t core_num__u64_9__from_le_bytes(uint8_t buf[8]) { return load64_le(buf); } @@ -200,9 +188,6 @@ static inline uint8_t Eurydice_bitand_pv_u8(uint8_t *p, uint8_t v) { static inline uint8_t Eurydice_shr_pv_u8(uint8_t *p, int32_t v) { return (*p) >> v; } -static inline uint32_t Eurydice_min_u32(uint32_t x, uint32_t y) { - return x < y ? x : y; -} #define core_num_nonzero_private_NonZeroUsizeInner size_t static inline core_num_nonzero_private_NonZeroUsizeInner @@ -225,9 +210,6 @@ core_num_nonzero_private___core__clone__Clone_for_core__num__nonzero__private__N #define core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next \ Eurydice_range_iter_next -#define core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next \ - Eurydice_range_iter_next - // See note in karamel/lib/Inlining.ml if you change this #define Eurydice_into_iter(x, t, _ret_t) (x) #define core_iter_traits_collect___core__iter__traits__collect__IntoIterator_for_I___into_iter \ diff --git a/libcrux-ml-kem/c/internal/libcrux_core.h b/libcrux-ml-kem/c/internal/libcrux_core.h index eaff82347..ea0d66fb8 100644 --- a/libcrux-ml-kem/c/internal/libcrux_core.h +++ b/libcrux-ml-kem/c/internal/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __internal_libcrux_core_H @@ -69,7 +69,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 1568 */ -libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_5a_c61( +libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_5a_451( uint8_t value[1568U]); /** @@ -82,7 +82,7 @@ with const generics - PRIVATE_KEY_SIZE= 3168 - PUBLIC_KEY_SIZE= 1568 */ -libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_3a_8d1( +libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_3a_f61( libcrux_ml_kem_types_MlKemPrivateKey_95 sk, libcrux_ml_kem_types_MlKemPublicKey_1f pk); @@ -95,7 +95,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 3168 */ -libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_7f_721( +libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_7f_8c1( uint8_t value[3168U]); /** @@ -107,7 +107,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 1184 */ -libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_5a_c60( +libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_5a_450( uint8_t value[1184U]); /** @@ -120,7 +120,7 @@ with const generics - PRIVATE_KEY_SIZE= 2400 - PUBLIC_KEY_SIZE= 1184 */ -libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_3a_8d0( +libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_3a_f60( libcrux_ml_kem_types_MlKemPrivateKey_55 sk, libcrux_ml_kem_types_MlKemPublicKey_15 pk); @@ -133,7 +133,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 2400 */ -libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_7f_720( +libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_7f_8c0( uint8_t value[2400U]); /** @@ -145,7 +145,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 800 */ -libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_5a_c6( +libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_5a_45( uint8_t value[800U]); /** @@ -158,7 +158,7 @@ with const generics - PRIVATE_KEY_SIZE= 1632 - PUBLIC_KEY_SIZE= 800 */ -libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_3a_8d( +libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_3a_f6( libcrux_ml_kem_types_MlKemPrivateKey_5e sk, libcrux_ml_kem_types_MlKemPublicKey_be pk); @@ -171,7 +171,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 1632 */ -libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_7f_72( +libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_7f_8c( uint8_t value[1632U]); /** @@ -182,7 +182,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 1184 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc1( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf1( libcrux_ml_kem_types_MlKemPublicKey_15 *self); /** @@ -194,7 +194,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 1088 */ -libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_fc1( +libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_1f1( uint8_t value[1088U]); /** @@ -206,7 +206,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 1088 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_471( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_491( libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self); /** @@ -228,7 +228,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 800 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc0( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf0( libcrux_ml_kem_types_MlKemPublicKey_be *self); /** @@ -240,7 +240,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 768 */ -libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_fc0( +libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_1f0( uint8_t value[768U]); /** @@ -252,7 +252,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 768 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_470( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_490( libcrux_ml_kem_types_MlKemCiphertext_e8 *self); /** @@ -274,7 +274,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 1568 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf( libcrux_ml_kem_types_MlKemPublicKey_1f *self); /** @@ -291,15 +291,14 @@ typedef struct core_result_Result_00_s { } core_result_Result_00; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[32size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_33(core_result_Result_00 self, uint8_t ret[32U]); +void core_result_unwrap_41_33(core_result_Result_00 self, uint8_t ret[32U]); /** Pad the `slice` with `0`s at the end. @@ -321,7 +320,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 1568 */ -libcrux_ml_kem_types_MlKemCiphertext_1f libcrux_ml_kem_types_from_01_fc( +libcrux_ml_kem_types_MlKemCiphertext_1f libcrux_ml_kem_types_from_01_1f( uint8_t value[1568U]); /** @@ -344,7 +343,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 1568 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_47( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_49( libcrux_ml_kem_types_MlKemCiphertext_1f *self); /** @@ -383,15 +382,14 @@ typedef struct core_result_Result_6f_s { } core_result_Result_6f; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[24size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_76(core_result_Result_6f self, uint8_t ret[24U]); +void core_result_unwrap_41_76(core_result_Result_6f self, uint8_t ret[24U]); /** A monomorphic instance of core.result.Result @@ -407,15 +405,14 @@ typedef struct core_result_Result_7a_s { } core_result_Result_7a; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[20size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_ea(core_result_Result_7a self, uint8_t ret[20U]); +void core_result_unwrap_41_ea(core_result_Result_7a self, uint8_t ret[20U]); /** A monomorphic instance of core.result.Result @@ -431,15 +428,14 @@ typedef struct core_result_Result_cd_s { } core_result_Result_cd; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[10size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_07(core_result_Result_cd self, uint8_t ret[10U]); +void core_result_unwrap_41_07(core_result_Result_cd self, uint8_t ret[10U]); /** A monomorphic instance of core.result.Result @@ -455,15 +451,14 @@ typedef struct core_result_Result_c0_s { } core_result_Result_c0; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types int16_t[16size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_30(core_result_Result_c0 self, int16_t ret[16U]); +void core_result_unwrap_41_30(core_result_Result_c0 self, int16_t ret[16U]); typedef struct Eurydice_slice_uint8_t_4size_t__x2_s { Eurydice_slice fst[4U]; diff --git a/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h b/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h index 49e1f29a2..faf1c9b68 100644 --- a/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h +++ b/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __internal_libcrux_mlkem_avx2_H @@ -41,7 +41,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_951(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_2e1(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -51,7 +51,7 @@ with const generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca1( +bool libcrux_ml_kem_ind_cca_validate_private_key_c61( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext); @@ -69,7 +69,7 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a1(uint8_t randomness[64U]); +libcrux_ml_kem_ind_cca_generate_keypair_dd1(uint8_t randomness[64U]); /** A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate @@ -90,7 +90,7 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c61( +tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c21( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]); @@ -116,7 +116,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab1( +void libcrux_ml_kem_ind_cca_decapsulate_0b1( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]); @@ -128,7 +128,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_950(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_2e0(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -138,7 +138,7 @@ with const generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca0( +bool libcrux_ml_kem_ind_cca_validate_private_key_c60( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *_ciphertext); @@ -156,7 +156,7 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem1024_MlKem1024KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]); +libcrux_ml_kem_ind_cca_generate_keypair_dd0(uint8_t randomness[64U]); /** A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate @@ -177,7 +177,7 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c60( +tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c20( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]); @@ -203,7 +203,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab0( +void libcrux_ml_kem_ind_cca_decapsulate_0b0( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]); @@ -215,7 +215,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_95(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_2e(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -225,7 +225,7 @@ with const generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca( +bool libcrux_ml_kem_ind_cca_validate_private_key_c6( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext); @@ -242,7 +242,7 @@ with const generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_2a( +libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_dd( uint8_t randomness[64U]); /** @@ -264,7 +264,7 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c6( +tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c2( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]); @@ -290,7 +290,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab( +void libcrux_ml_kem_ind_cca_decapsulate_0b( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]); diff --git a/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h b/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h index f3a967c5f..7d3aec1df 100644 --- a/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h +++ b/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __internal_libcrux_mlkem_portable_H @@ -46,7 +46,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c1(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_f71(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -56,7 +56,7 @@ with const generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_53( +bool libcrux_ml_kem_ind_cca_validate_private_key_ed( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *_ciphertext); @@ -74,7 +74,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem1024_MlKem1024KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b21(uint8_t randomness[64U]); +libcrux_ml_kem_ind_cca_generate_keypair_911(uint8_t randomness[64U]); /** A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate @@ -95,7 +95,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_21 libcrux_ml_kem_ind_cca_encapsulate_131( +tuple_21 libcrux_ml_kem_ind_cca_encapsulate_361( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]); @@ -121,7 +121,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -void libcrux_ml_kem_ind_cca_decapsulate_551( +void libcrux_ml_kem_ind_cca_decapsulate_391( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]); @@ -133,7 +133,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c0(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_f70(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -143,7 +143,7 @@ with const generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_24( +bool libcrux_ml_kem_ind_cca_validate_private_key_d8( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext); @@ -161,7 +161,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 192 */ libcrux_ml_kem_types_MlKemKeyPair_cb -libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]); +libcrux_ml_kem_ind_cca_generate_keypair_910(uint8_t randomness[64U]); /** A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate @@ -182,7 +182,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_ec libcrux_ml_kem_ind_cca_encapsulate_130( +tuple_ec libcrux_ml_kem_ind_cca_encapsulate_360( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]); @@ -208,7 +208,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -void libcrux_ml_kem_ind_cca_decapsulate_550( +void libcrux_ml_kem_ind_cca_decapsulate_390( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]); @@ -220,7 +220,7 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c(uint8_t *public_key); +bool libcrux_ml_kem_ind_cca_validate_public_key_f7(uint8_t *public_key); /** A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key @@ -230,7 +230,7 @@ with const generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_9e( +bool libcrux_ml_kem_ind_cca_validate_private_key_c3( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext); @@ -248,7 +248,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]); +libcrux_ml_kem_ind_cca_generate_keypair_91(uint8_t randomness[64U]); /** A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate @@ -269,7 +269,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_3c libcrux_ml_kem_ind_cca_encapsulate_13( +tuple_3c libcrux_ml_kem_ind_cca_encapsulate_36( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]); @@ -295,7 +295,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -void libcrux_ml_kem_ind_cca_decapsulate_55( +void libcrux_ml_kem_ind_cca_decapsulate_39( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]); diff --git a/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h b/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h index ff78ba53c..653268abf 100644 --- a/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __internal_libcrux_sha3_avx2_H diff --git a/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h b/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h index 063a10640..924fca293 100644 --- a/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h +++ b/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __internal_libcrux_sha3_internal_H @@ -29,7 +29,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_48 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake128_init(void) { - return libcrux_sha3_generic_keccak_new_89_cf(); + return libcrux_sha3_generic_keccak_new_1e_cf(); } /** @@ -207,7 +207,7 @@ libcrux_sha3_portable_incremental_shake256_absorb_final( */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake256_init(void) { - return libcrux_sha3_generic_keccak_new_89_cf(); + return libcrux_sha3_generic_keccak_new_1e_cf(); } /** @@ -258,16 +258,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -292,16 +292,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -309,7 +309,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_8b_15(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_9d_15(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; { @@ -362,16 +362,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -379,7 +379,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); { @@ -408,7 +408,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} static inline void libcrux_sha3_portable_incremental_absorb_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_8b_45(self, buf); + libcrux_sha3_generic_keccak_absorb_9d_45(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_4f @@ -422,17 +422,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -440,7 +440,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; { @@ -487,7 +487,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_absorb_final_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_8b_b6(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_9d_b6(&self, buf); return self; } @@ -496,16 +496,16 @@ libcrux_sha3_portable_incremental_absorb_final_7d( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( +static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( uint8_t ret[136U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -650,21 +650,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_8b +A monomorphic instance of libcrux_sha3.generic_keccak.new_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f -libcrux_sha3_generic_keccak_new_8b_47(void) { +libcrux_sha3_generic_keccak_new_9d_47(void) { libcrux_sha3_generic_keccak_KeccakXofState_4f lit; - lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); uint8_t ret[136U]; - libcrux_sha3_generic_keccak_zero_block_8b_5e(ret); + libcrux_sha3_generic_keccak_zero_block_9d_5e(ret); memcpy(lit.buf[0U], ret, (size_t)136U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -681,7 +681,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_new_7d(void) { - return libcrux_sha3_generic_keccak_new_8b_47(); + return libcrux_sha3_generic_keccak_new_9d_47(); } /** @@ -712,16 +712,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -746,16 +746,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -763,7 +763,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_8b_150(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_9d_150(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; { @@ -816,16 +816,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -833,7 +833,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); { @@ -859,7 +859,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} static inline void libcrux_sha3_portable_incremental_absorb_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_8b_450(self, buf); + libcrux_sha3_generic_keccak_absorb_9d_450(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_78 @@ -873,17 +873,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -891,7 +891,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; { @@ -935,7 +935,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_absorb_final_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_8b_b60(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_9d_b60(&self, buf); return self; } @@ -944,16 +944,16 @@ libcrux_sha3_portable_incremental_absorb_final_1c( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( +static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( uint8_t ret[168U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -1130,21 +1130,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_8b +A monomorphic instance of libcrux_sha3.generic_keccak.new_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 -libcrux_sha3_generic_keccak_new_8b_470(void) { +libcrux_sha3_generic_keccak_new_9d_470(void) { libcrux_sha3_generic_keccak_KeccakXofState_78 lit; - lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); uint8_t ret[168U]; - libcrux_sha3_generic_keccak_zero_block_8b_5e0(ret); + libcrux_sha3_generic_keccak_zero_block_9d_5e0(ret); memcpy(lit.buf[0U], ret, (size_t)168U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -1158,7 +1158,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_new_1c(void) { - return libcrux_sha3_generic_keccak_new_8b_470(); + return libcrux_sha3_generic_keccak_new_9d_470(); } /** @@ -1205,16 +1205,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_81( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -1242,7 +1242,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1277,7 +1277,7 @@ libcrux_sha3::portable::incremental::Shake256Squeeze)#3} static inline void libcrux_sha3_portable_incremental_squeeze_8a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_8b_ba(self, buf); + libcrux_sha3_generic_keccak_squeeze_9d_ba(self, buf); } /** @@ -1324,16 +1324,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_810( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -1361,7 +1361,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1396,7 +1396,7 @@ libcrux_sha3::portable::incremental::Shake128Squeeze)#1} static inline void libcrux_sha3_portable_incremental_squeeze_10( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_8b_ba0(self, buf); + libcrux_sha3_generic_keccak_squeeze_9d_ba0(self, buf); } /** diff --git a/libcrux-ml-kem/c/libcrux_core.c b/libcrux-ml-kem/c/libcrux_core.c index 9b9cd41ce..c70315723 100644 --- a/libcrux-ml-kem/c/libcrux_core.c +++ b/libcrux-ml-kem/c/libcrux_core.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "internal/libcrux_core.h" @@ -91,7 +91,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 1568 */ -libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_5a_c61( +libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_5a_451( uint8_t value[1568U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1568U]; @@ -111,7 +111,7 @@ with const generics - PRIVATE_KEY_SIZE= 3168 - PUBLIC_KEY_SIZE= 1568 */ -libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_3a_8d1( +libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_3a_f61( libcrux_ml_kem_types_MlKemPrivateKey_95 sk, libcrux_ml_kem_types_MlKemPublicKey_1f pk) { return ( @@ -127,7 +127,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 3168 */ -libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_7f_721( +libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_7f_8c1( uint8_t value[3168U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[3168U]; @@ -146,7 +146,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 1184 */ -libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_5a_c60( +libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_5a_450( uint8_t value[1184U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1184U]; @@ -166,7 +166,7 @@ with const generics - PRIVATE_KEY_SIZE= 2400 - PUBLIC_KEY_SIZE= 1184 */ -libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_3a_8d0( +libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_3a_f60( libcrux_ml_kem_types_MlKemPrivateKey_55 sk, libcrux_ml_kem_types_MlKemPublicKey_15 pk) { return ( @@ -182,7 +182,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 2400 */ -libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_7f_720( +libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_7f_8c0( uint8_t value[2400U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[2400U]; @@ -201,7 +201,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_5a with const generics - SIZE= 800 */ -libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_5a_c6( +libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_5a_45( uint8_t value[800U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[800U]; @@ -221,7 +221,7 @@ with const generics - PRIVATE_KEY_SIZE= 1632 - PUBLIC_KEY_SIZE= 800 */ -libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_3a_8d( +libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_3a_f6( libcrux_ml_kem_types_MlKemPrivateKey_5e sk, libcrux_ml_kem_types_MlKemPublicKey_be pk) { return (CLITERAL(libcrux_ml_kem_types_MlKemKeyPair_cb){.sk = sk, .pk = pk}); @@ -236,7 +236,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_7f with const generics - SIZE= 1632 */ -libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_7f_72( +libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_7f_8c( uint8_t value[1632U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1632U]; @@ -254,7 +254,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 1184 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc1( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf1( libcrux_ml_kem_types_MlKemPublicKey_15 *self) { return self->value; } @@ -268,7 +268,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 1088 */ -libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_fc1( +libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_1f1( uint8_t value[1088U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1088U]; @@ -287,7 +287,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 1088 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_471( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_491( libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self) { return Eurydice_array_to_slice((size_t)1088U, self->value, uint8_t); } @@ -319,7 +319,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 800 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc0( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf0( libcrux_ml_kem_types_MlKemPublicKey_be *self) { return self->value; } @@ -333,7 +333,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 768 */ -libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_fc0( +libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_1f0( uint8_t value[768U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[768U]; @@ -352,7 +352,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 768 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_470( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_490( libcrux_ml_kem_types_MlKemCiphertext_e8 *self) { return Eurydice_array_to_slice((size_t)768U, self->value, uint8_t); } @@ -384,21 +384,20 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 1568 */ -uint8_t *libcrux_ml_kem_types_as_slice_fd_cc( +uint8_t *libcrux_ml_kem_types_as_slice_fd_cf( libcrux_ml_kem_types_MlKemPublicKey_1f *self) { return self->value; } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[32size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_33(core_result_Result_00 self, uint8_t ret[32U]) { +void core_result_unwrap_41_33(core_result_Result_00 self, uint8_t ret[32U]) { if (self.tag == core_result_Ok) { uint8_t f0[32U]; memcpy(f0, self.val.case_Ok, (size_t)32U * sizeof(uint8_t)); @@ -438,7 +437,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01 with const generics - SIZE= 1568 */ -libcrux_ml_kem_types_MlKemCiphertext_1f libcrux_ml_kem_types_from_01_fc( +libcrux_ml_kem_types_MlKemCiphertext_1f libcrux_ml_kem_types_from_01_1f( uint8_t value[1568U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1568U]; @@ -476,7 +475,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 1568 */ -Eurydice_slice libcrux_ml_kem_types_as_ref_00_47( +Eurydice_slice libcrux_ml_kem_types_as_ref_00_49( libcrux_ml_kem_types_MlKemCiphertext_1f *self) { return Eurydice_array_to_slice((size_t)1568U, self->value, uint8_t); } @@ -520,15 +519,14 @@ void libcrux_ml_kem_utils_into_padded_array_42(Eurydice_slice slice, } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[24size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_76(core_result_Result_6f self, uint8_t ret[24U]) { +void core_result_unwrap_41_76(core_result_Result_6f self, uint8_t ret[24U]) { if (self.tag == core_result_Ok) { uint8_t f0[24U]; memcpy(f0, self.val.case_Ok, (size_t)24U * sizeof(uint8_t)); @@ -541,15 +539,14 @@ void core_result_unwrap_26_76(core_result_Result_6f self, uint8_t ret[24U]) { } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[20size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_ea(core_result_Result_7a self, uint8_t ret[20U]) { +void core_result_unwrap_41_ea(core_result_Result_7a self, uint8_t ret[20U]) { if (self.tag == core_result_Ok) { uint8_t f0[20U]; memcpy(f0, self.val.case_Ok, (size_t)20U * sizeof(uint8_t)); @@ -562,15 +559,14 @@ void core_result_unwrap_26_ea(core_result_Result_7a self, uint8_t ret[20U]) { } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[10size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_07(core_result_Result_cd self, uint8_t ret[10U]) { +void core_result_unwrap_41_07(core_result_Result_cd self, uint8_t ret[10U]) { if (self.tag == core_result_Ok) { uint8_t f0[10U]; memcpy(f0, self.val.case_Ok, (size_t)10U * sizeof(uint8_t)); @@ -583,15 +579,14 @@ void core_result_unwrap_26_07(core_result_Result_cd self, uint8_t ret[10U]) { } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types int16_t[16size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_30(core_result_Result_c0 self, int16_t ret[16U]) { +void core_result_unwrap_41_30(core_result_Result_c0 self, int16_t ret[16U]) { if (self.tag == core_result_Ok) { int16_t f0[16U]; memcpy(f0, self.val.case_Ok, (size_t)16U * sizeof(int16_t)); @@ -604,15 +599,14 @@ void core_result_unwrap_26_30(core_result_Result_c0 self, int16_t ret[16U]) { } /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[8size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_0e(core_result_Result_56 self, uint8_t ret[8U]) { +void core_result_unwrap_41_0e(core_result_Result_56 self, uint8_t ret[8U]) { if (self.tag == core_result_Ok) { uint8_t f0[8U]; memcpy(f0, self.val.case_Ok, (size_t)8U * sizeof(uint8_t)); diff --git a/libcrux-ml-kem/c/libcrux_core.h b/libcrux-ml-kem/c/libcrux_core.h index 9d39b6164..d11c83a5a 100644 --- a/libcrux-ml-kem/c/libcrux_core.h +++ b/libcrux-ml-kem/c/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_core_H @@ -197,15 +197,14 @@ typedef struct core_result_Result_56_s { } core_result_Result_56; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[8size_t], core_array_TryFromSliceError */ -void core_result_unwrap_26_0e(core_result_Result_56 self, uint8_t ret[8U]); +void core_result_unwrap_41_0e(core_result_Result_56 self, uint8_t ret[8U]); typedef struct Eurydice_slice_uint8_t_x2_s { Eurydice_slice fst; diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024.h b/libcrux-ml-kem/c/libcrux_mlkem1024.h index 4f564c146..0c4269273 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem1024_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c index 65f4818c6..291cdea74 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem1024_avx2.h" @@ -35,10 +35,10 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -static void decapsulate_1b0( +static void decapsulate_ee0( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_ab0(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_0b0(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_1b0( void libcrux_ml_kem_mlkem1024_avx2_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { - decapsulate_1b0(private_key, ciphertext, ret); + decapsulate_ee0(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_21 encapsulate_ac0( +static tuple_21 encapsulate_370( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_1f *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_c60(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_c20(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_21 libcrux_ml_kem_mlkem1024_avx2_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_ac0(uu____0, copy_of_randomness); + return encapsulate_370(uu____0, copy_of_randomness); } /** @@ -109,12 +109,12 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.generate_keypair with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_mlkem1024_MlKem1024KeyPair generate_keypair_630( +static libcrux_ml_kem_mlkem1024_MlKem1024KeyPair generate_keypair_200( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_2a0(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_dd0(copy_of_randomness); } /** @@ -125,7 +125,7 @@ libcrux_ml_kem_mlkem1024_avx2_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_630(copy_of_randomness); + return generate_keypair_200(copy_of_randomness); } /** @@ -136,10 +136,10 @@ generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -static KRML_MUSTINLINE bool validate_private_key_550( +static KRML_MUSTINLINE bool validate_private_key_5f0( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_ca0(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_c60(private_key, ciphertext); } @@ -151,7 +151,7 @@ static KRML_MUSTINLINE bool validate_private_key_550( bool libcrux_ml_kem_mlkem1024_avx2_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext) { - return validate_private_key_550(private_key, ciphertext); + return validate_private_key_5f0(private_key, ciphertext); } /** @@ -162,8 +162,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE bool validate_public_key_d30(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_950(public_key); +static KRML_MUSTINLINE bool validate_public_key_4a0(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_2e0(public_key); } /** @@ -173,5 +173,5 @@ static KRML_MUSTINLINE bool validate_public_key_d30(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem1024_avx2_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key) { - return validate_public_key_d30(public_key->value); + return validate_public_key_4a0(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h index 5552a8b63..e261044f5 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem1024_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c index 01b6def3f..8589f3cb7 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem1024_portable.h" @@ -35,10 +35,10 @@ libcrux_ml_kem.ind_cca.instantiations.portable.decapsulate with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -static void decapsulate_861( +static void decapsulate_c81( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_551(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_391(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_861( void libcrux_ml_kem_mlkem1024_portable_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { - decapsulate_861(private_key, ciphertext, ret); + decapsulate_c81(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ libcrux_ml_kem.ind_cca.instantiations.portable.encapsulate with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_21 encapsulate_6f1( +static tuple_21 encapsulate_7d1( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_1f *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_131(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_361(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_21 libcrux_ml_kem_mlkem1024_portable_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_6f1(uu____0, copy_of_randomness); + return encapsulate_7d1(uu____0, copy_of_randomness); } /** @@ -110,12 +110,12 @@ generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_mlkem1024_MlKem1024KeyPair generate_keypair_7f1( +static libcrux_ml_kem_mlkem1024_MlKem1024KeyPair generate_keypair_081( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_b21(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_911(copy_of_randomness); } /** @@ -126,7 +126,7 @@ libcrux_ml_kem_mlkem1024_portable_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_7f1(copy_of_randomness); + return generate_keypair_081(copy_of_randomness); } /** @@ -137,10 +137,10 @@ generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -static KRML_MUSTINLINE bool validate_private_key_1e1( +static KRML_MUSTINLINE bool validate_private_key_501( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_53(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_ed(private_key, ciphertext); } @@ -152,7 +152,7 @@ static KRML_MUSTINLINE bool validate_private_key_1e1( bool libcrux_ml_kem_mlkem1024_portable_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext) { - return validate_private_key_1e1(private_key, ciphertext); + return validate_private_key_501(private_key, ciphertext); } /** @@ -163,8 +163,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE bool validate_public_key_f91(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_3c1(public_key); +static KRML_MUSTINLINE bool validate_public_key_931(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_f71(public_key); } /** @@ -174,5 +174,5 @@ static KRML_MUSTINLINE bool validate_public_key_f91(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem1024_portable_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key) { - return validate_public_key_f91(public_key->value); + return validate_public_key_931(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h index da249a492..5e13dac2e 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem1024_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512.h b/libcrux-ml-kem/c/libcrux_mlkem512.h index 75bb82159..e2d3aeec9 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem512_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c index 9e27b56f2..3147278df 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem512_avx2.h" @@ -35,10 +35,10 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -static void decapsulate_1b(libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, +static void decapsulate_ee(libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_ab(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_0b(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_1b(libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, void libcrux_ml_kem_mlkem512_avx2_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { - decapsulate_1b(private_key, ciphertext, ret); + decapsulate_ee(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_ec encapsulate_ac( +static tuple_ec encapsulate_37( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_be *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_c6(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_c2(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_ec libcrux_ml_kem_mlkem512_avx2_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_ac(uu____0, copy_of_randomness); + return encapsulate_37(uu____0, copy_of_randomness); } /** @@ -109,12 +109,12 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.generate_keypair with const generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -static libcrux_ml_kem_types_MlKemKeyPair_cb generate_keypair_63( +static libcrux_ml_kem_types_MlKemKeyPair_cb generate_keypair_20( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_2a(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_dd(copy_of_randomness); } /** @@ -125,7 +125,7 @@ libcrux_ml_kem_mlkem512_avx2_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_63(copy_of_randomness); + return generate_keypair_20(copy_of_randomness); } /** @@ -136,10 +136,10 @@ generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -static KRML_MUSTINLINE bool validate_private_key_55( +static KRML_MUSTINLINE bool validate_private_key_5f( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_ca(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_c6(private_key, ciphertext); } @@ -151,7 +151,7 @@ static KRML_MUSTINLINE bool validate_private_key_55( bool libcrux_ml_kem_mlkem512_avx2_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext) { - return validate_private_key_55(private_key, ciphertext); + return validate_private_key_5f(private_key, ciphertext); } /** @@ -162,8 +162,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE bool validate_public_key_d3(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_95(public_key); +static KRML_MUSTINLINE bool validate_public_key_4a(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_2e(public_key); } /** @@ -173,5 +173,5 @@ static KRML_MUSTINLINE bool validate_public_key_d3(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem512_avx2_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_be *public_key) { - return validate_public_key_d3(public_key->value); + return validate_public_key_4a(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h index 4b8af1f2a..b8b6f8b0d 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem512_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_portable.c b/libcrux-ml-kem/c/libcrux_mlkem512_portable.c index 39e4b67b9..f4b93367f 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem512_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem512_portable.h" @@ -35,10 +35,10 @@ libcrux_ml_kem.ind_cca.instantiations.portable.decapsulate with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -static void decapsulate_860( +static void decapsulate_c80( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_550(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_390(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_860( void libcrux_ml_kem_mlkem512_portable_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { - decapsulate_860(private_key, ciphertext, ret); + decapsulate_c80(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ libcrux_ml_kem.ind_cca.instantiations.portable.encapsulate with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_ec encapsulate_6f0( +static tuple_ec encapsulate_7d0( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_be *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_130(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_360(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_ec libcrux_ml_kem_mlkem512_portable_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_6f0(uu____0, copy_of_randomness); + return encapsulate_7d0(uu____0, copy_of_randomness); } /** @@ -110,12 +110,12 @@ generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -static libcrux_ml_kem_types_MlKemKeyPair_cb generate_keypair_7f0( +static libcrux_ml_kem_types_MlKemKeyPair_cb generate_keypair_080( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_b20(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_910(copy_of_randomness); } /** @@ -126,7 +126,7 @@ libcrux_ml_kem_mlkem512_portable_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_7f0(copy_of_randomness); + return generate_keypair_080(copy_of_randomness); } /** @@ -137,10 +137,10 @@ generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -static KRML_MUSTINLINE bool validate_private_key_1e0( +static KRML_MUSTINLINE bool validate_private_key_500( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_24(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_d8(private_key, ciphertext); } @@ -152,7 +152,7 @@ static KRML_MUSTINLINE bool validate_private_key_1e0( bool libcrux_ml_kem_mlkem512_portable_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext) { - return validate_private_key_1e0(private_key, ciphertext); + return validate_private_key_500(private_key, ciphertext); } /** @@ -163,8 +163,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE bool validate_public_key_f90(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_3c0(public_key); +static KRML_MUSTINLINE bool validate_public_key_930(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_f70(public_key); } /** @@ -174,5 +174,5 @@ static KRML_MUSTINLINE bool validate_public_key_f90(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem512_portable_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_be *public_key) { - return validate_public_key_f90(public_key->value); + return validate_public_key_930(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_portable.h b/libcrux-ml-kem/c/libcrux_mlkem512_portable.h index 3f156c570..7b475f089 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem512_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768.h b/libcrux-ml-kem/c/libcrux_mlkem768.h index 172185891..9d931422e 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c index 1033e69a1..067de4a91 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem768_avx2.h" @@ -35,10 +35,10 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -static void decapsulate_1b1( +static void decapsulate_ee1( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_ab1(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_0b1(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_1b1( void libcrux_ml_kem_mlkem768_avx2_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - decapsulate_1b1(private_key, ciphertext, ret); + decapsulate_ee1(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_3c encapsulate_ac1( +static tuple_3c encapsulate_371( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_c61(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_c21(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_3c libcrux_ml_kem_mlkem768_avx2_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_ac1(uu____0, copy_of_randomness); + return encapsulate_371(uu____0, copy_of_randomness); } /** @@ -109,12 +109,12 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.generate_keypair with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_mlkem768_MlKem768KeyPair generate_keypair_631( +static libcrux_ml_kem_mlkem768_MlKem768KeyPair generate_keypair_201( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_2a1(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_dd1(copy_of_randomness); } /** @@ -125,7 +125,7 @@ libcrux_ml_kem_mlkem768_avx2_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_631(copy_of_randomness); + return generate_keypair_201(copy_of_randomness); } /** @@ -136,10 +136,10 @@ generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE bool validate_private_key_551( +static KRML_MUSTINLINE bool validate_private_key_5f1( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_ca1(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_c61(private_key, ciphertext); } @@ -151,7 +151,7 @@ static KRML_MUSTINLINE bool validate_private_key_551( bool libcrux_ml_kem_mlkem768_avx2_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return validate_private_key_551(private_key, ciphertext); + return validate_private_key_5f1(private_key, ciphertext); } /** @@ -162,8 +162,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE bool validate_public_key_d31(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_951(public_key); +static KRML_MUSTINLINE bool validate_public_key_4a1(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_2e1(public_key); } /** @@ -173,5 +173,5 @@ static KRML_MUSTINLINE bool validate_public_key_d31(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem768_avx2_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key) { - return validate_public_key_d31(public_key->value); + return validate_public_key_4a1(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h index 4d8d496ac..7a86aed30 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_portable.c b/libcrux-ml-kem/c/libcrux_mlkem768_portable.c index 4f102ff81..fae6a874c 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem768_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_mlkem768_portable.h" @@ -35,10 +35,10 @@ libcrux_ml_kem.ind_cca.instantiations.portable.decapsulate with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -static void decapsulate_86( +static void decapsulate_c8( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_55(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_39(private_key, ciphertext, ret); } /** @@ -51,7 +51,7 @@ static void decapsulate_86( void libcrux_ml_kem_mlkem768_portable_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - decapsulate_86(private_key, ciphertext, ret); + decapsulate_c8(private_key, ciphertext, ret); } /** @@ -71,14 +71,14 @@ libcrux_ml_kem.ind_cca.instantiations.portable.encapsulate with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static tuple_3c encapsulate_6f( +static tuple_3c encapsulate_7d( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_13(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_36(uu____0, copy_of_randomness); } /** @@ -95,7 +95,7 @@ tuple_3c libcrux_ml_kem_mlkem768_portable_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return encapsulate_6f(uu____0, copy_of_randomness); + return encapsulate_7d(uu____0, copy_of_randomness); } /** @@ -110,12 +110,12 @@ generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_mlkem768_MlKem768KeyPair generate_keypair_7f( +static libcrux_ml_kem_mlkem768_MlKem768KeyPair generate_keypair_08( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_b2(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_91(copy_of_randomness); } /** @@ -126,7 +126,7 @@ libcrux_ml_kem_mlkem768_portable_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return generate_keypair_7f(copy_of_randomness); + return generate_keypair_08(copy_of_randomness); } /** @@ -137,10 +137,10 @@ generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE bool validate_private_key_1e( +static KRML_MUSTINLINE bool validate_private_key_50( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_9e(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_c3(private_key, ciphertext); } @@ -152,7 +152,7 @@ static KRML_MUSTINLINE bool validate_private_key_1e( bool libcrux_ml_kem_mlkem768_portable_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return validate_private_key_1e(private_key, ciphertext); + return validate_private_key_50(private_key, ciphertext); } /** @@ -163,8 +163,8 @@ generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE bool validate_public_key_f9(uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_3c(public_key); +static KRML_MUSTINLINE bool validate_public_key_93(uint8_t *public_key) { + return libcrux_ml_kem_ind_cca_validate_public_key_f7(public_key); } /** @@ -174,5 +174,5 @@ static KRML_MUSTINLINE bool validate_public_key_f9(uint8_t *public_key) { */ bool libcrux_ml_kem_mlkem768_portable_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key) { - return validate_public_key_f9(public_key->value); + return validate_public_key_93(public_key->value); } diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_portable.h b/libcrux-ml-kem/c/libcrux_mlkem768_portable.h index a3cebbef2..5feb24427 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem_avx2.c index 18db095f7..a0b9361ed 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "internal/libcrux_mlkem_avx2.h" @@ -603,7 +603,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_4( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, ret0); + core_result_unwrap_41_0e(dst, ret0); memcpy(ret, ret0, (size_t)8U * sizeof(uint8_t)); } @@ -694,7 +694,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_5( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)10U, uint8_t), Eurydice_slice, uint8_t[10U]); - core_result_unwrap_26_07(dst, ret0); + core_result_unwrap_41_07(dst, ret0); memcpy(ret, ret0, (size_t)10U * sizeof(uint8_t)); } @@ -797,7 +797,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_10( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)20U, uint8_t), Eurydice_slice, uint8_t[20U]); - core_result_unwrap_26_ea(dst, ret0); + core_result_unwrap_41_ea(dst, ret0); memcpy(ret, ret0, (size_t)20U * sizeof(uint8_t)); } @@ -924,7 +924,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_12( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)24U, uint8_t), Eurydice_slice, uint8_t[24U]); - core_result_unwrap_26_76(dst, ret0); + core_result_unwrap_41_76(dst, ret0); memcpy(ret, ret0, (size_t)24U * sizeof(uint8_t)); } @@ -1031,16 +1031,15 @@ inline __m256i libcrux_ml_kem_vector_avx2_clone_78(__m256i *self) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ZERO_ef_7d(void) { +static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ZERO_20_7d(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_avx2_ZERO_09(); lit.coefficients[1U] = libcrux_ml_kem_vector_avx2_ZERO_09(); @@ -1068,8 +1067,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_to_reduced_ring_element_ec(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_to_reduced_ring_element_b8(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -1088,7 +1087,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d1( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_fb1( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -1102,7 +1101,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d1( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_reduced_ring_element_ec(ring_element); + deserialize_to_reduced_ring_element_b8(ring_element); deserialized_pk[i0] = uu____0; } } @@ -1113,13 +1112,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_851( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf1( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_7d();); - deserialize_ring_elements_reduced_3d1(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_7d();); + deserialize_ring_elements_reduced_fb1(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); @@ -1130,7 +1129,7 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.arithmetic.shift_right with const generics - SHIFT_BY= 15 */ -static KRML_MUSTINLINE __m256i shift_right_d1(__m256i vector) { +static KRML_MUSTINLINE __m256i shift_right_e4(__m256i vector) { return mm256_srai_epi16((int32_t)15, vector, __m256i); } @@ -1143,8 +1142,8 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.shift_right_09 with const generics - SHIFT_BY= 15 */ -static __m256i shift_right_09_bb(__m256i vector) { - return shift_right_d1(vector); +static __m256i shift_right_09_92(__m256i vector) { + return shift_right_e4(vector); } /** @@ -1154,25 +1153,35 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static __m256i to_unsigned_representative_b5(__m256i a) { - __m256i t = shift_right_09_bb(a); + __m256i t = shift_right_09_92(a); __m256i fm = libcrux_ml_kem_vector_avx2_bitwise_and_with_constant_09( t, LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); return libcrux_ml_kem_vector_avx2_add_09(a, &fm); } +/** +A monomorphic instance of libcrux_ml_kem.serialize.to_unsigned_field_modulus +with types libcrux_ml_kem_vector_avx2_SIMD256Vector +with const generics + +*/ +static KRML_MUSTINLINE __m256i to_unsigned_field_modulus_88(__m256i a) { + return to_unsigned_representative_b5(a); +} + /** A monomorphic instance of libcrux_ml_kem.serialize.serialize_uncompressed_ring_element with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void serialize_uncompressed_ring_element_88( +static KRML_MUSTINLINE void serialize_uncompressed_ring_element_b8( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[384U]) { uint8_t serialized[384U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficient = to_unsigned_representative_b5(re->coefficients[i0]); + __m256i coefficient = to_unsigned_field_modulus_88(re->coefficients[i0]); uint8_t bytes[24U]; libcrux_ml_kem_vector_avx2_serialize_12_09(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -1180,7 +1189,9 @@ static KRML_MUSTINLINE void serialize_uncompressed_ring_element_88( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)24U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)384U * sizeof(uint8_t)); + uint8_t result[384U]; + memcpy(result, serialized, (size_t)384U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)384U * sizeof(uint8_t)); } /** @@ -1190,7 +1201,7 @@ with const generics - K= 3 - OUT_LEN= 1152 */ -static KRML_MUSTINLINE void serialize_secret_key_721( +static KRML_MUSTINLINE void serialize_secret_key_051( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *key, uint8_t ret[1152U]) { uint8_t out[1152U] = {0U}; @@ -1208,7 +1219,7 @@ static KRML_MUSTINLINE void serialize_secret_key_721( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_88(&re, ret0); + serialize_uncompressed_ring_element_b8(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -1223,13 +1234,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void serialize_public_key_mut_821( +static KRML_MUSTINLINE void serialize_public_key_mut_7b1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1152U, uint8_t); uint8_t ret[1152U]; - serialize_secret_key_721(t_as_ntt, ret); + serialize_secret_key_051(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1152U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -1246,11 +1257,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void serialize_public_key_391( +static KRML_MUSTINLINE void serialize_public_key_f71( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1184U]) { uint8_t public_key_serialized[1184U] = {0U}; - serialize_public_key_mut_821(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_7b1(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1184U]; memcpy(result, public_key_serialized, (size_t)1184U * sizeof(uint8_t)); memcpy(ret, result, (size_t)1184U * sizeof(uint8_t)); @@ -1264,15 +1275,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_951(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_2e1(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; - deserialize_ring_elements_reduced_out_851( + deserialize_ring_elements_reduced_out_bf1( Eurydice_array_to_subslice_to((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1184U]; - serialize_public_key_391( + serialize_public_key_f71( uu____0, Eurydice_array_to_subslice_from((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), @@ -1302,7 +1313,7 @@ with const generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca1( +bool libcrux_ml_kem_ind_cca_validate_private_key_c61( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext) { uint8_t t[32U]; @@ -1330,19 +1341,19 @@ typedef struct IndCpaPrivateKeyUnpacked_a0_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static IndCpaPrivateKeyUnpacked_a0 default_1a_191(void) { +static IndCpaPrivateKeyUnpacked_a0 default_f6_191(void) { IndCpaPrivateKeyUnpacked_a0 lit; - lit.secret_as_ntt[0U] = ZERO_ef_7d(); - lit.secret_as_ntt[1U] = ZERO_ef_7d(); - lit.secret_as_ntt[2U] = ZERO_ef_7d(); + lit.secret_as_ntt[0U] = ZERO_20_7d(); + lit.secret_as_ntt[1U] = ZERO_20_7d(); + lit.secret_as_ntt[2U] = ZERO_20_7d(); return lit; } @@ -1361,33 +1372,33 @@ typedef struct IndCpaPublicKeyUnpacked_a0_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static IndCpaPublicKeyUnpacked_a0 default_8d_801(void) { +static IndCpaPublicKeyUnpacked_a0 default_85_801(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - uu____0[i] = ZERO_ef_7d();); + uu____0[i] = ZERO_20_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_a0 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_7d(); - lit.A[0U][1U] = ZERO_ef_7d(); - lit.A[0U][2U] = ZERO_ef_7d(); - lit.A[1U][0U] = ZERO_ef_7d(); - lit.A[1U][1U] = ZERO_ef_7d(); - lit.A[1U][2U] = ZERO_ef_7d(); - lit.A[2U][0U] = ZERO_ef_7d(); - lit.A[2U][1U] = ZERO_ef_7d(); - lit.A[2U][2U] = ZERO_ef_7d(); + lit.A[0U][0U] = ZERO_20_7d(); + lit.A[0U][1U] = ZERO_20_7d(); + lit.A[0U][2U] = ZERO_20_7d(); + lit.A[1U][0U] = ZERO_20_7d(); + lit.A[1U][1U] = ZERO_20_7d(); + lit.A[1U][2U] = ZERO_20_7d(); + lit.A[2U][0U] = ZERO_20_7d(); + lit.A[2U][1U] = ZERO_20_7d(); + lit.A[2U][2U] = ZERO_20_7d(); return lit; } @@ -1414,7 +1425,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 3 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_7e1( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_0e1( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -1717,18 +1728,17 @@ static KRML_MUSTINLINE bool sample_from_uniform_distribution_next_744( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -from_i16_array_ef_14(Eurydice_slice a) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); +from_i16_array_20_14(Eurydice_slice a) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -1747,7 +1757,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e41( int16_t s[272U]) { - return from_i16_array_ef_14( + return from_i16_array_20_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -1932,7 +1942,7 @@ sample_from_binomial_distribution_2_80(Eurydice_slice randomness) { sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_ef_14( + return from_i16_array_20_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -1976,7 +1986,7 @@ sample_from_binomial_distribution_3_05(Eurydice_slice randomness) { sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_ef_14( + return from_i16_array_20_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -2127,16 +2137,15 @@ static KRML_MUSTINLINE void ntt_at_layer_1_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void poly_barrett_reduce_ef_09( +static KRML_MUSTINLINE void poly_barrett_reduce_20_09( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -2162,7 +2171,7 @@ static KRML_MUSTINLINE void ntt_binomially_sampled_ring_element_5c( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** @@ -2219,7 +2228,7 @@ static KRML_MUSTINLINE tuple_b0 sample_vector_cbd_then_ntt_out_d71( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_7d();); + re_as_ntt[i] = ZERO_20_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -2240,19 +2249,18 @@ static KRML_MUSTINLINE tuple_b0 sample_vector_cbd_then_ntt_out_d71( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -ntt_multiply_ef_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, +ntt_multiply_20_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = ZERO_20_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -2271,16 +2279,15 @@ ntt_multiply_ef_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_311( +static KRML_MUSTINLINE void add_to_ring_element_20_311( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -2307,16 +2314,15 @@ static __m256i to_standard_domain_c1(__m256i v) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void add_standard_error_reduce_ef_ba( +static KRML_MUSTINLINE void add_standard_error_reduce_20_ba( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -2350,7 +2356,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_671( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -2363,10 +2369,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_671( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_311(&t_as_ntt[i0], &product); + ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_311(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -2384,7 +2390,7 @@ static void generate_keypair_unpacked_4a1( IndCpaPrivateKeyUnpacked_a0 *private_key, IndCpaPublicKeyUnpacked_a0 *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_7e1(key_generation_seed, hashed); + cpa_keygen_seed_d8_0e1(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -2419,7 +2425,7 @@ static void generate_keypair_unpacked_4a1( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -2435,18 +2441,18 @@ with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_1c1( +static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_1e1( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_a0 private_key = default_1a_191(); - IndCpaPublicKeyUnpacked_a0 public_key = default_8d_801(); + IndCpaPrivateKeyUnpacked_a0 private_key = default_f6_191(); + IndCpaPublicKeyUnpacked_a0 public_key = default_85_801(); generate_keypair_unpacked_4a1(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - serialize_public_key_391( + serialize_public_key_f71( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - serialize_secret_key_721(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_051(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -2470,7 +2476,7 @@ with const generics - K= 3 - SERIALIZED_KEY_LEN= 2400 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_281( +static KRML_MUSTINLINE void serialize_kem_secret_key_7b1( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[2400U]) { uint8_t out[2400U] = {0U}; @@ -2526,7 +2532,7 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a1(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_dd1(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -2535,13 +2541,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a1(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - generate_keypair_1c1(ind_cpa_keypair_randomness); + generate_keypair_1e1(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - serialize_kem_secret_key_281( + serialize_kem_secret_key_7b1( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -2550,13 +2556,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a1(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_720(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c0(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d0( - uu____2, libcrux_ml_kem_types_from_5a_c60(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f60( + uu____2, libcrux_ml_kem_types_from_5a_450(copy_of_public_key)); } /** @@ -2569,7 +2575,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 3 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_7b1(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_441(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -2586,10 +2592,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_b0 -sample_ring_element_cbd_461(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_2d1(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - error_1[i] = ZERO_ef_7d();); + error_1[i] = ZERO_20_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -2654,7 +2660,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_1_f8( +static KRML_MUSTINLINE void invert_ntt_at_layer_1_92( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; @@ -2675,7 +2681,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_2_de( +static KRML_MUSTINLINE void invert_ntt_at_layer_2_7a( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; @@ -2694,7 +2700,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_3_0f( +static KRML_MUSTINLINE void invert_ntt_at_layer_3_2e( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { KRML_MAYBE_FOR16(i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; zeta_i[0U] = zeta_i[0U] - (size_t)1U; @@ -2711,7 +2717,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_vector_avx2_SIMD256Vector_x2 -inv_ntt_layer_int_vec_step_reduce_cb(__m256i a, __m256i b, int16_t zeta_r) { +inv_ntt_layer_int_vec_step_reduce_57(__m256i a, __m256i b, int16_t zeta_r) { __m256i a_minus_b = libcrux_ml_kem_vector_avx2_sub_09(b, &a); a = libcrux_ml_kem_vector_avx2_barrett_reduce_09( libcrux_ml_kem_vector_avx2_add_09(a, &b)); @@ -2741,7 +2747,7 @@ static KRML_MUSTINLINE void invert_ntt_at_layer_4_plus_0f( for (size_t i = offset_vec; i < offset_vec + step_vec; i++) { size_t j = i; libcrux_ml_kem_vector_avx2_SIMD256Vector_x2 uu____0 = - inv_ntt_layer_int_vec_step_reduce_cb( + inv_ntt_layer_int_vec_step_reduce_57( re->coefficients[j], re->coefficients[j + step_vec], libcrux_ml_kem_polynomial_get_zeta(zeta_i[0U])); __m256i x = uu____0.fst; @@ -2758,32 +2764,31 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_4a1( +static KRML_MUSTINLINE void invert_ntt_montgomery_0c1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_f8(&zeta_i, re); - invert_ntt_at_layer_2_de(&zeta_i, re); - invert_ntt_at_layer_3_0f(&zeta_i, re); + invert_ntt_at_layer_1_92(&zeta_i, re); + invert_ntt_at_layer_2_7a(&zeta_i, re); + invert_ntt_at_layer_3_2e(&zeta_i, re); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)4U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void add_error_reduce_ef_84( +static KRML_MUSTINLINE void add_error_reduce_20_a2( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -2804,14 +2809,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void compute_vector_u_a91( +static KRML_MUSTINLINE void compute_vector_u_7f1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 (*a_as_ntt)[3U], libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - result0[i] = ZERO_ef_7d();); + result0[i] = ZERO_20_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -2831,11 +2836,11 @@ static KRML_MUSTINLINE void compute_vector_u_a91( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_311(&result0[i1], &product); + ntt_multiply_20_63(a_element, &r_as_ntt[j]); + add_to_ring_element_20_311(&result0[i1], &product); } - invert_ntt_montgomery_4a1(&result0[i1]); - add_error_reduce_ef_84(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_0c1(&result0[i1]); + add_error_reduce_20_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[3U]; memcpy( @@ -2852,7 +2857,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static __m256i decompress_1_14(__m256i vec) { +static __m256i decompress_1_46(__m256i vec) { __m256i z = libcrux_ml_kem_vector_avx2_ZERO_09(); __m256i s = libcrux_ml_kem_vector_avx2_sub_09(z, &vec); return libcrux_ml_kem_vector_avx2_bitwise_and_with_constant_09(s, @@ -2866,8 +2871,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_message_a6(uint8_t serialized[32U]) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_then_decompress_message_4f(uint8_t serialized[32U]) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; __m256i coefficient_compressed = @@ -2875,23 +2880,22 @@ deserialize_then_decompress_message_a6(uint8_t serialized[32U]) { Eurydice_array_to_subslice2(serialized, (size_t)2U * i0, (size_t)2U * i0 + (size_t)2U, uint8_t)); - re.coefficients[i0] = decompress_1_14(coefficient_compressed);); + re.coefficients[i0] = decompress_1_46(coefficient_compressed);); return re; } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -add_message_error_reduce_ef_b0( +add_message_error_reduce_20_df( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result) { @@ -2918,18 +2922,18 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_ring_element_v_e61( +compute_ring_element_v_ac1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_311(&result, &product);); - invert_ntt_montgomery_4a1(&result); - result = add_message_error_reduce_ef_b0(error_2, message, result); + ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_311(&result, &product);); + invert_ntt_montgomery_0c1(&result); + result = add_message_error_reduce_20_df(error_2, message, result); return result; } @@ -2940,7 +2944,7 @@ generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE __m256i -compress_ciphertext_coefficient_57(__m256i vector) { +compress_ciphertext_coefficient_b6(__m256i vector) { __m256i field_modulus_halved = mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / (int32_t)2); @@ -2987,8 +2991,8 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.compress_09 with const generics - COEFFICIENT_BITS= 10 */ -static __m256i compress_09_a1(__m256i vector) { - return compress_ciphertext_coefficient_57(vector); +static __m256i compress_09_46(__m256i vector) { + return compress_ciphertext_coefficient_b6(vector); } /** @@ -2997,14 +3001,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - OUT_LEN= 320 */ -static KRML_MUSTINLINE void compress_then_serialize_10_0a0( +static KRML_MUSTINLINE void compress_then_serialize_10_6b0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; __m256i coefficient = - compress_09_a1(to_unsigned_representative_b5(re->coefficients[i0])); + compress_09_46(to_unsigned_field_modulus_88(re->coefficients[i0])); uint8_t bytes[20U]; libcrux_ml_kem_vector_avx2_serialize_10_09(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -3012,7 +3016,9 @@ static KRML_MUSTINLINE void compress_then_serialize_10_0a0( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)20U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)320U * sizeof(uint8_t)); + uint8_t result[320U]; + memcpy(result, serialized, (size_t)320U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)320U * sizeof(uint8_t)); } /** @@ -3022,7 +3028,7 @@ generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE __m256i -compress_ciphertext_coefficient_570(__m256i vector) { +compress_ciphertext_coefficient_b60(__m256i vector) { __m256i field_modulus_halved = mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / (int32_t)2); @@ -3069,8 +3075,8 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.compress_09 with const generics - COEFFICIENT_BITS= 11 */ -static __m256i compress_09_a10(__m256i vector) { - return compress_ciphertext_coefficient_570(vector); +static __m256i compress_09_460(__m256i vector) { + return compress_ciphertext_coefficient_b60(vector); } /** @@ -3080,10 +3086,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 10 - OUT_LEN= 320 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_130( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_430( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[320U]) { uint8_t uu____0[320U]; - compress_then_serialize_10_0a0(re, uu____0); + compress_then_serialize_10_6b0(re, uu____0); memcpy(ret, uu____0, (size_t)320U * sizeof(uint8_t)); } @@ -3096,7 +3102,7 @@ with const generics - COMPRESSION_FACTOR= 10 - BLOCK_LEN= 320 */ -static void compress_then_serialize_u_491( +static void compress_then_serialize_u_6d1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 input[3U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -3112,7 +3118,7 @@ static void compress_then_serialize_u_491( out, i0 * ((size_t)960U / (size_t)3U), (i0 + (size_t)1U) * ((size_t)960U / (size_t)3U), uint8_t); uint8_t ret[320U]; - compress_then_serialize_ring_element_u_130(&re, ret); + compress_then_serialize_ring_element_u_430(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); } @@ -3125,7 +3131,7 @@ generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE __m256i -compress_ciphertext_coefficient_571(__m256i vector) { +compress_ciphertext_coefficient_b61(__m256i vector) { __m256i field_modulus_halved = mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / (int32_t)2); @@ -3172,8 +3178,8 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.compress_09 with const generics - COEFFICIENT_BITS= 4 */ -static __m256i compress_09_a11(__m256i vector) { - return compress_ciphertext_coefficient_571(vector); +static __m256i compress_09_461(__m256i vector) { + return compress_ciphertext_coefficient_b61(vector); } /** @@ -3182,16 +3188,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_4_22( +static KRML_MUSTINLINE void compress_then_serialize_4_85( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; __m256i coefficient = - compress_09_a11(to_unsigned_representative_b5(re.coefficients[i0])); + compress_09_461(to_unsigned_field_modulus_88(re.coefficients[i0])); uint8_t bytes[8U]; libcrux_ml_kem_vector_avx2_serialize_4_09(coefficient, bytes); Eurydice_slice_copy( @@ -3208,7 +3212,7 @@ generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE __m256i -compress_ciphertext_coefficient_572(__m256i vector) { +compress_ciphertext_coefficient_b62(__m256i vector) { __m256i field_modulus_halved = mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / (int32_t)2); @@ -3255,8 +3259,8 @@ A monomorphic instance of libcrux_ml_kem.vector.avx2.compress_09 with const generics - COEFFICIENT_BITS= 5 */ -static __m256i compress_09_a12(__m256i vector) { - return compress_ciphertext_coefficient_572(vector); +static __m256i compress_09_462(__m256i vector) { + return compress_ciphertext_coefficient_b62(vector); } /** @@ -3265,16 +3269,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_5_10( +static KRML_MUSTINLINE void compress_then_serialize_5_c3( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; __m256i coefficients = - compress_09_a12(to_unsigned_representative_b5(re.coefficients[i0])); + compress_09_462(to_unsigned_representative_b5(re.coefficients[i0])); uint8_t bytes[10U]; libcrux_ml_kem_vector_avx2_serialize_5_09(coefficients, bytes); Eurydice_slice_copy( @@ -3291,9 +3293,9 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 4 - OUT_LEN= 128 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_460( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_610( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice out) { - compress_then_serialize_4_22(re, out); + compress_then_serialize_4_85(re, out); } /** @@ -3313,7 +3315,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_671(IndCpaPublicKeyUnpacked_a0 *public_key, +static void encrypt_unpacked_721(IndCpaPublicKeyUnpacked_a0 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { @@ -3332,7 +3334,7 @@ static void encrypt_unpacked_671(IndCpaPublicKeyUnpacked_a0 *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_b0 uu____3 = - sample_ring_element_cbd_461(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_2d1(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; memcpy( error_1, uu____3.fst, @@ -3346,25 +3348,25 @@ static void encrypt_unpacked_671(IndCpaPublicKeyUnpacked_a0 *public_key, sample_from_binomial_distribution_73( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u[3U]; - compute_vector_u_a91(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_7f1(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message_as_ring_element = - deserialize_then_decompress_message_a6(copy_of_message); + deserialize_then_decompress_message_4f(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - compute_ring_element_v_e61(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_ac1(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1088U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____5[3U]; memcpy( uu____5, u, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); - compress_then_serialize_u_491( + compress_then_serialize_u_6d1( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)960U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____6 = v; - compress_then_serialize_ring_element_v_460( + compress_then_serialize_ring_element_v_610( uu____6, Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1088U * sizeof(uint8_t)); @@ -3387,10 +3389,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_601(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_691(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { - IndCpaPublicKeyUnpacked_a0 unpacked_public_key = default_8d_801(); - deserialize_ring_elements_reduced_3d1( + IndCpaPublicKeyUnpacked_a0 unpacked_public_key = default_85_801(); + deserialize_ring_elements_reduced_fb1( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -3405,7 +3407,7 @@ static void encrypt_601(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1088U]; - encrypt_unpacked_671(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_721(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1088U * sizeof(uint8_t)); } @@ -3420,7 +3422,7 @@ with const generics - K= 3 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE void kdf_d8_5a1(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_541(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -3447,11 +3449,11 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c61( +tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c21( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_7b1( + entropy_preprocess_d8_441( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -3461,7 +3463,7 @@ tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c61( size_t); uint8_t ret[32U]; H_a9_161(Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cc1(public_key), + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cf1(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -3475,19 +3477,19 @@ tuple_3c libcrux_ml_kem_ind_cca_encapsulate_c61( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cc1(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cf1(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - encrypt_601(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_691(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_fc1(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f1(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_5a1(shared_secret, shared_secret_array); + kdf_d8_541(shared_secret, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -3507,8 +3509,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_to_uncompressed_ring_element_d1(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_to_uncompressed_ring_element_59(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -3525,12 +3527,12 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_secret_key_941( +static KRML_MUSTINLINE void deserialize_secret_key_181( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_7d();); + secret_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -3542,7 +3544,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_941( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_uncompressed_ring_element_d1(secret_bytes); + deserialize_to_uncompressed_ring_element_59(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[3U]; @@ -3561,7 +3563,7 @@ generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE __m256i -decompress_ciphertext_coefficient_c7(__m256i vector) { +decompress_ciphertext_coefficient_74(__m256i vector) { __m256i field_modulus = mm256_set1_epi32((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); __m256i two_pow_coefficient_bits = @@ -3605,8 +3607,8 @@ libcrux_ml_kem.vector.avx2.decompress_ciphertext_coefficient_09 with const generics - COEFFICIENT_BITS= 10 */ -static __m256i decompress_ciphertext_coefficient_09_79(__m256i vector) { - return decompress_ciphertext_coefficient_c7(vector); +static __m256i decompress_ciphertext_coefficient_09_da(__m256i vector) { + return decompress_ciphertext_coefficient_74(vector); } /** @@ -3616,8 +3618,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_10_2d(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_then_decompress_10_3d(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice((size_t)16U, re.coefficients, __m256i), @@ -3629,7 +3631,7 @@ deserialize_then_decompress_10_2d(Eurydice_slice serialized) { Eurydice_slice bytes = Eurydice_slice_subslice2( serialized, i0 * (size_t)20U, i0 * (size_t)20U + (size_t)20U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_10_09(bytes); - re.coefficients[i0] = decompress_ciphertext_coefficient_09_79(coefficient); + re.coefficients[i0] = decompress_ciphertext_coefficient_09_da(coefficient); } return re; } @@ -3641,7 +3643,7 @@ generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE __m256i -decompress_ciphertext_coefficient_c70(__m256i vector) { +decompress_ciphertext_coefficient_740(__m256i vector) { __m256i field_modulus = mm256_set1_epi32((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); __m256i two_pow_coefficient_bits = @@ -3685,8 +3687,8 @@ libcrux_ml_kem.vector.avx2.decompress_ciphertext_coefficient_09 with const generics - COEFFICIENT_BITS= 11 */ -static __m256i decompress_ciphertext_coefficient_09_790(__m256i vector) { - return decompress_ciphertext_coefficient_c70(vector); +static __m256i decompress_ciphertext_coefficient_09_da0(__m256i vector) { + return decompress_ciphertext_coefficient_740(vector); } /** @@ -3696,15 +3698,15 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_11_57(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_then_decompress_11_1a(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; Eurydice_slice bytes = Eurydice_slice_subslice2( serialized, i0 * (size_t)22U, i0 * (size_t)22U + (size_t)22U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_11_09(bytes); - re.coefficients[i0] = decompress_ciphertext_coefficient_09_790(coefficient); + re.coefficients[i0] = decompress_ciphertext_coefficient_09_da0(coefficient); } return re; } @@ -3716,8 +3718,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_ring_element_u_cc0(Eurydice_slice serialized) { - return deserialize_then_decompress_10_2d(serialized); +deserialize_then_decompress_ring_element_u_880(Eurydice_slice serialized) { + return deserialize_then_decompress_10_3d(serialized); } /** @@ -3726,7 +3728,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - VECTOR_U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void ntt_vector_u_600( +static KRML_MUSTINLINE void ntt_vector_u_2c0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = (size_t)0U; ntt_at_layer_4_plus_1d(&zeta_i, re, (size_t)7U); @@ -3736,7 +3738,7 @@ static KRML_MUSTINLINE void ntt_vector_u_600( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** @@ -3747,12 +3749,12 @@ with const generics - CIPHERTEXT_SIZE= 1088 - U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_841( +static KRML_MUSTINLINE void deserialize_then_decompress_u_a81( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_7d();); + u_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1088U, ciphertext, uint8_t), @@ -3770,8 +3772,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_841( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)10U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_cc0(u_bytes); - ntt_vector_u_600(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_880(u_bytes); + ntt_vector_u_2c0(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -3785,7 +3787,7 @@ generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE __m256i -decompress_ciphertext_coefficient_c71(__m256i vector) { +decompress_ciphertext_coefficient_741(__m256i vector) { __m256i field_modulus = mm256_set1_epi32((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); __m256i two_pow_coefficient_bits = @@ -3829,8 +3831,8 @@ libcrux_ml_kem.vector.avx2.decompress_ciphertext_coefficient_09 with const generics - COEFFICIENT_BITS= 4 */ -static __m256i decompress_ciphertext_coefficient_09_791(__m256i vector) { - return decompress_ciphertext_coefficient_c71(vector); +static __m256i decompress_ciphertext_coefficient_09_da1(__m256i vector) { + return decompress_ciphertext_coefficient_741(vector); } /** @@ -3840,15 +3842,15 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_4_39(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_then_decompress_4_f1(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; Eurydice_slice bytes = Eurydice_slice_subslice2( serialized, i0 * (size_t)8U, i0 * (size_t)8U + (size_t)8U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_4_09(bytes); - re.coefficients[i0] = decompress_ciphertext_coefficient_09_791(coefficient); + re.coefficients[i0] = decompress_ciphertext_coefficient_09_da1(coefficient); } return re; } @@ -3860,7 +3862,7 @@ generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE __m256i -decompress_ciphertext_coefficient_c72(__m256i vector) { +decompress_ciphertext_coefficient_742(__m256i vector) { __m256i field_modulus = mm256_set1_epi32((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); __m256i two_pow_coefficient_bits = @@ -3904,8 +3906,8 @@ libcrux_ml_kem.vector.avx2.decompress_ciphertext_coefficient_09 with const generics - COEFFICIENT_BITS= 5 */ -static __m256i decompress_ciphertext_coefficient_09_792(__m256i vector) { - return decompress_ciphertext_coefficient_c72(vector); +static __m256i decompress_ciphertext_coefficient_09_da2(__m256i vector) { + return decompress_ciphertext_coefficient_742(vector); } /** @@ -3915,8 +3917,8 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_5_7b(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); +deserialize_then_decompress_5_7e(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -3924,7 +3926,7 @@ deserialize_then_decompress_5_7b(Eurydice_slice serialized) { serialized, i0 * (size_t)10U, i0 * (size_t)10U + (size_t)10U, uint8_t); re.coefficients[i0] = libcrux_ml_kem_vector_avx2_deserialize_5_09(bytes); re.coefficients[i0] = - decompress_ciphertext_coefficient_09_792(re.coefficients[i0]); + decompress_ciphertext_coefficient_09_da2(re.coefficients[i0]); } return re; } @@ -3936,23 +3938,22 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_ring_element_v_800(Eurydice_slice serialized) { - return deserialize_then_decompress_4_39(serialized); +deserialize_then_decompress_ring_element_v_050(Eurydice_slice serialized) { + return deserialize_then_decompress_4_f1(serialized); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -subtract_reduce_ef_79(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, +subtract_reduce_20_27(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 b) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -3974,17 +3975,17 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_message_781( +compute_message_a41( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_311(&result, &product);); - invert_ntt_montgomery_4a1(&result); - result = subtract_reduce_ef_79(v, result); + ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_311(&result, &product);); + invert_ntt_montgomery_0c1(&result); + result = subtract_reduce_20_27(v, result); return result; } @@ -3994,12 +3995,12 @@ libcrux_ml_kem.serialize.compress_then_serialize_message with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_message_e4( +static KRML_MUSTINLINE void compress_then_serialize_message_d2( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, uint8_t ret[32U]) { uint8_t serialized[32U] = {0U}; KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; - __m256i coefficient = to_unsigned_representative_b5(re.coefficients[i0]); + __m256i coefficient = to_unsigned_field_modulus_88(re.coefficients[i0]); __m256i coefficient_compressed = libcrux_ml_kem_vector_avx2_compress_1_09(coefficient); uint8_t bytes[2U]; @@ -4009,7 +4010,9 @@ static KRML_MUSTINLINE void compress_then_serialize_message_e4( Eurydice_slice_copy(uu____0, Eurydice_array_to_slice((size_t)2U, bytes, uint8_t), uint8_t);); - memcpy(ret, serialized, (size_t)32U * sizeof(uint8_t)); + uint8_t result[32U]; + memcpy(result, serialized, (size_t)32U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } /** @@ -4022,18 +4025,18 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_unpacked_cb1(IndCpaPrivateKeyUnpacked_a0 *secret_key, +static void decrypt_unpacked_e51(IndCpaPrivateKeyUnpacked_a0 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; - deserialize_then_decompress_u_841(ciphertext, u_as_ntt); + deserialize_then_decompress_u_a81(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - deserialize_then_decompress_ring_element_v_800( + deserialize_then_decompress_ring_element_v_050( Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message = - compute_message_781(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_a41(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_e4(message, ret0); + compress_then_serialize_message_d2(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -4047,10 +4050,10 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_b81(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_981(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; - deserialize_secret_key_941(secret_key, secret_as_ntt); + deserialize_secret_key_181(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_d2 copy_of_secret_as_ntt[3U]; memcpy( @@ -4061,7 +4064,7 @@ static void decrypt_b81(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); uint8_t result[32U]; - decrypt_unpacked_cb1(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_e51(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -4113,7 +4116,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab1( +void libcrux_ml_kem_ind_cca_decapsulate_0b1( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -4131,7 +4134,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab1( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_b81(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_981(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -4153,7 +4156,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab1( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_471(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_491(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_a9_423(Eurydice_array_to_slice((size_t)1120U, to_hash, uint8_t), @@ -4163,17 +4166,17 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab1( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - encrypt_601(uu____5, copy_of_decrypted, pseudorandomness, + encrypt_691(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_5a1(Eurydice_array_to_slice( + kdf_d8_541(Eurydice_array_to_slice( (size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_5a1(shared_secret0, shared_secret1); + kdf_d8_541(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_471(ciphertext), + libcrux_ml_kem_types_as_ref_00_491(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -4188,7 +4191,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_fb( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -4202,7 +4205,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_reduced_ring_element_ec(ring_element); + deserialize_to_reduced_ring_element_b8(ring_element); deserialized_pk[i0] = uu____0; } } @@ -4213,13 +4216,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_850( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf0( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_7d();); - deserialize_ring_elements_reduced_3d(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_7d();); + deserialize_ring_elements_reduced_fb(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); @@ -4232,7 +4235,7 @@ with const generics - K= 4 - OUT_LEN= 1536 */ -static KRML_MUSTINLINE void serialize_secret_key_72( +static KRML_MUSTINLINE void serialize_secret_key_05( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *key, uint8_t ret[1536U]) { uint8_t out[1536U] = {0U}; @@ -4250,7 +4253,7 @@ static KRML_MUSTINLINE void serialize_secret_key_72( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_88(&re, ret0); + serialize_uncompressed_ring_element_b8(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -4265,13 +4268,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE void serialize_public_key_mut_82( +static KRML_MUSTINLINE void serialize_public_key_mut_7b( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1536U, uint8_t); uint8_t ret[1536U]; - serialize_secret_key_72(t_as_ntt, ret); + serialize_secret_key_05(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1536U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -4288,11 +4291,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE void serialize_public_key_39( +static KRML_MUSTINLINE void serialize_public_key_f7( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1568U]) { uint8_t public_key_serialized[1568U] = {0U}; - serialize_public_key_mut_82(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_7b(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1568U]; memcpy(result, public_key_serialized, (size_t)1568U * sizeof(uint8_t)); memcpy(ret, result, (size_t)1568U * sizeof(uint8_t)); @@ -4306,15 +4309,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_950(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_2e0(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[4U]; - deserialize_ring_elements_reduced_out_850( + deserialize_ring_elements_reduced_out_bf0( Eurydice_array_to_subslice_to((size_t)1568U, public_key, (size_t)1536U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1568U]; - serialize_public_key_39( + serialize_public_key_f7( uu____0, Eurydice_array_to_subslice_from((size_t)1568U, public_key, (size_t)1536U, uint8_t, size_t), @@ -4344,7 +4347,7 @@ with const generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca0( +bool libcrux_ml_kem_ind_cca_validate_private_key_c60( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *_ciphertext) { uint8_t t[32U]; @@ -4372,20 +4375,20 @@ typedef struct IndCpaPrivateKeyUnpacked_01_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static IndCpaPrivateKeyUnpacked_01 default_1a_19(void) { +static IndCpaPrivateKeyUnpacked_01 default_f6_19(void) { IndCpaPrivateKeyUnpacked_01 lit; - lit.secret_as_ntt[0U] = ZERO_ef_7d(); - lit.secret_as_ntt[1U] = ZERO_ef_7d(); - lit.secret_as_ntt[2U] = ZERO_ef_7d(); - lit.secret_as_ntt[3U] = ZERO_ef_7d(); + lit.secret_as_ntt[0U] = ZERO_20_7d(); + lit.secret_as_ntt[1U] = ZERO_20_7d(); + lit.secret_as_ntt[2U] = ZERO_20_7d(); + lit.secret_as_ntt[3U] = ZERO_20_7d(); return lit; } @@ -4404,40 +4407,40 @@ typedef struct IndCpaPublicKeyUnpacked_01_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static IndCpaPublicKeyUnpacked_01 default_8d_80(void) { +static IndCpaPublicKeyUnpacked_01 default_85_80(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - uu____0[i] = ZERO_ef_7d();); + uu____0[i] = ZERO_20_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_01 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_7d(); - lit.A[0U][1U] = ZERO_ef_7d(); - lit.A[0U][2U] = ZERO_ef_7d(); - lit.A[0U][3U] = ZERO_ef_7d(); - lit.A[1U][0U] = ZERO_ef_7d(); - lit.A[1U][1U] = ZERO_ef_7d(); - lit.A[1U][2U] = ZERO_ef_7d(); - lit.A[1U][3U] = ZERO_ef_7d(); - lit.A[2U][0U] = ZERO_ef_7d(); - lit.A[2U][1U] = ZERO_ef_7d(); - lit.A[2U][2U] = ZERO_ef_7d(); - lit.A[2U][3U] = ZERO_ef_7d(); - lit.A[3U][0U] = ZERO_ef_7d(); - lit.A[3U][1U] = ZERO_ef_7d(); - lit.A[3U][2U] = ZERO_ef_7d(); - lit.A[3U][3U] = ZERO_ef_7d(); + lit.A[0U][0U] = ZERO_20_7d(); + lit.A[0U][1U] = ZERO_20_7d(); + lit.A[0U][2U] = ZERO_20_7d(); + lit.A[0U][3U] = ZERO_20_7d(); + lit.A[1U][0U] = ZERO_20_7d(); + lit.A[1U][1U] = ZERO_20_7d(); + lit.A[1U][2U] = ZERO_20_7d(); + lit.A[1U][3U] = ZERO_20_7d(); + lit.A[2U][0U] = ZERO_20_7d(); + lit.A[2U][1U] = ZERO_20_7d(); + lit.A[2U][2U] = ZERO_20_7d(); + lit.A[2U][3U] = ZERO_20_7d(); + lit.A[3U][0U] = ZERO_20_7d(); + lit.A[3U][1U] = ZERO_20_7d(); + lit.A[3U][2U] = ZERO_20_7d(); + lit.A[3U][3U] = ZERO_20_7d(); return lit; } @@ -4464,7 +4467,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 4 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_7e( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_0e( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -4779,7 +4782,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e4( int16_t s[272U]) { - return from_i16_array_ef_14( + return from_i16_array_20_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -4980,7 +4983,7 @@ static KRML_MUSTINLINE tuple_71 sample_vector_cbd_then_ntt_out_d7( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_7d();); + re_as_ntt[i] = ZERO_20_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -5001,16 +5004,15 @@ static KRML_MUSTINLINE tuple_71 sample_vector_cbd_then_ntt_out_d7( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_31( +static KRML_MUSTINLINE void add_to_ring_element_20_31( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -5044,7 +5046,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_67( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -5057,10 +5059,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_67( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_31(&t_as_ntt[i0], &product); + ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_31(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -5078,7 +5080,7 @@ static void generate_keypair_unpacked_4a( IndCpaPrivateKeyUnpacked_01 *private_key, IndCpaPublicKeyUnpacked_01 *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_7e(key_generation_seed, hashed); + cpa_keygen_seed_d8_0e(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -5113,7 +5115,7 @@ static void generate_keypair_unpacked_4a( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5129,18 +5131,18 @@ with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_1c0( +static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_1e0( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_01 private_key = default_1a_19(); - IndCpaPublicKeyUnpacked_01 public_key = default_8d_80(); + IndCpaPrivateKeyUnpacked_01 private_key = default_f6_19(); + IndCpaPublicKeyUnpacked_01 public_key = default_85_80(); generate_keypair_unpacked_4a(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1568U]; - serialize_public_key_39( + serialize_public_key_f7( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1536U]; - serialize_secret_key_72(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_05(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1536U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -5164,7 +5166,7 @@ with const generics - K= 4 - SERIALIZED_KEY_LEN= 3168 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_280( +static KRML_MUSTINLINE void serialize_kem_secret_key_7b0( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[3168U]) { uint8_t out[3168U] = {0U}; @@ -5220,7 +5222,7 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem1024_MlKem1024KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_dd0(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -5229,13 +5231,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair1024 uu____0 = - generate_keypair_1c0(ind_cpa_keypair_randomness); + generate_keypair_1e0(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1536U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1536U * sizeof(uint8_t)); uint8_t public_key[1568U]; memcpy(public_key, uu____0.snd, (size_t)1568U * sizeof(uint8_t)); uint8_t secret_key_serialized[3168U]; - serialize_kem_secret_key_280( + serialize_kem_secret_key_7b0( Eurydice_array_to_slice((size_t)1536U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1568U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -5244,13 +5246,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)3168U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_95 private_key = - libcrux_ml_kem_types_from_7f_721(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c1(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_95 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1568U]; memcpy(copy_of_public_key, public_key, (size_t)1568U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d1( - uu____2, libcrux_ml_kem_types_from_5a_c61(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f61( + uu____2, libcrux_ml_kem_types_from_5a_451(copy_of_public_key)); } /** @@ -5263,7 +5265,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 4 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_7b0(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_440(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -5280,10 +5282,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_71 -sample_ring_element_cbd_46(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_2d(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - error_1[i] = ZERO_ef_7d();); + error_1[i] = ZERO_20_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -5336,18 +5338,18 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_4a( +static KRML_MUSTINLINE void invert_ntt_montgomery_0c( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_f8(&zeta_i, re); - invert_ntt_at_layer_2_de(&zeta_i, re); - invert_ntt_at_layer_3_0f(&zeta_i, re); + invert_ntt_at_layer_1_92(&zeta_i, re); + invert_ntt_at_layer_2_7a(&zeta_i, re); + invert_ntt_at_layer_3_2e(&zeta_i, re); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)4U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** @@ -5356,14 +5358,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void compute_vector_u_a9( +static KRML_MUSTINLINE void compute_vector_u_7f( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 (*a_as_ntt)[4U], libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - result0[i] = ZERO_ef_7d();); + result0[i] = ZERO_20_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -5383,11 +5385,11 @@ static KRML_MUSTINLINE void compute_vector_u_a9( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_31(&result0[i1], &product); + ntt_multiply_20_63(a_element, &r_as_ntt[j]); + add_to_ring_element_20_31(&result0[i1], &product); } - invert_ntt_montgomery_4a(&result0[i1]); - add_error_reduce_ef_84(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_0c(&result0[i1]); + add_error_reduce_20_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[4U]; memcpy( @@ -5405,18 +5407,18 @@ with const generics - K= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_ring_element_v_e6( +compute_ring_element_v_ac( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_31(&result, &product);); - invert_ntt_montgomery_4a(&result); - result = add_message_error_reduce_ef_b0(error_2, message, result); + ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_31(&result, &product);); + invert_ntt_montgomery_0c(&result); + result = add_message_error_reduce_20_df(error_2, message, result); return result; } @@ -5426,14 +5428,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - OUT_LEN= 352 */ -static KRML_MUSTINLINE void compress_then_serialize_11_78( +static KRML_MUSTINLINE void compress_then_serialize_11_99( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[352U]) { uint8_t serialized[352U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; __m256i coefficient = - compress_09_a10(to_unsigned_representative_b5(re->coefficients[i0])); + compress_09_460(to_unsigned_representative_b5(re->coefficients[i0])); uint8_t bytes[22U]; libcrux_ml_kem_vector_avx2_serialize_11_09(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -5451,10 +5453,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 11 - OUT_LEN= 352 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_13( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_43( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[352U]) { uint8_t uu____0[352U]; - compress_then_serialize_11_78(re, uu____0); + compress_then_serialize_11_99(re, uu____0); memcpy(ret, uu____0, (size_t)352U * sizeof(uint8_t)); } @@ -5467,7 +5469,7 @@ with const generics - COMPRESSION_FACTOR= 11 - BLOCK_LEN= 352 */ -static void compress_then_serialize_u_49( +static void compress_then_serialize_u_6d( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 input[4U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -5483,7 +5485,7 @@ static void compress_then_serialize_u_49( out, i0 * ((size_t)1408U / (size_t)4U), (i0 + (size_t)1U) * ((size_t)1408U / (size_t)4U), uint8_t); uint8_t ret[352U]; - compress_then_serialize_ring_element_u_13(&re, ret); + compress_then_serialize_ring_element_u_43(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)352U, ret, uint8_t), uint8_t); } @@ -5496,9 +5498,9 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 5 - OUT_LEN= 160 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_46( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_61( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice out) { - compress_then_serialize_5_10(re, out); + compress_then_serialize_5_c3(re, out); } /** @@ -5518,7 +5520,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_67(IndCpaPublicKeyUnpacked_01 *public_key, +static void encrypt_unpacked_72(IndCpaPublicKeyUnpacked_01 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { uint8_t prf_input[33U]; @@ -5536,7 +5538,7 @@ static void encrypt_unpacked_67(IndCpaPublicKeyUnpacked_01 *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_71 uu____3 = - sample_ring_element_cbd_46(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_2d(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[4U]; memcpy( error_1, uu____3.fst, @@ -5550,25 +5552,25 @@ static void encrypt_unpacked_67(IndCpaPublicKeyUnpacked_01 *public_key, sample_from_binomial_distribution_73( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u[4U]; - compute_vector_u_a9(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_7f(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message_as_ring_element = - deserialize_then_decompress_message_a6(copy_of_message); + deserialize_then_decompress_message_4f(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - compute_ring_element_v_e6(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_ac(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1568U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____5[4U]; memcpy( uu____5, u, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); - compress_then_serialize_u_49( + compress_then_serialize_u_6d( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)1408U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____6 = v; - compress_then_serialize_ring_element_v_46( + compress_then_serialize_ring_element_v_61( uu____6, Eurydice_array_to_subslice_from((size_t)1568U, ciphertext, (size_t)1408U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1568U * sizeof(uint8_t)); @@ -5591,10 +5593,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_600(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_690(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { - IndCpaPublicKeyUnpacked_01 unpacked_public_key = default_8d_80(); - deserialize_ring_elements_reduced_3d( + IndCpaPublicKeyUnpacked_01 unpacked_public_key = default_85_80(); + deserialize_ring_elements_reduced_fb( Eurydice_slice_subslice_to(public_key, (size_t)1536U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -5609,7 +5611,7 @@ static void encrypt_600(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1568U]; - encrypt_unpacked_67(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_72(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1568U * sizeof(uint8_t)); } @@ -5624,7 +5626,7 @@ with const generics - K= 4 - CIPHERTEXT_SIZE= 1568 */ -static KRML_MUSTINLINE void kdf_d8_5a0(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_540(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -5651,11 +5653,11 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c60( +tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c20( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_7b0( + entropy_preprocess_d8_440( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5665,7 +5667,7 @@ tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c60( size_t); uint8_t ret[32U]; H_a9_16(Eurydice_array_to_slice( - (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cc(public_key), + (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cf(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -5679,19 +5681,19 @@ tuple_21 libcrux_ml_kem_ind_cca_encapsulate_c60( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cc(public_key), uint8_t); + (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cf(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1568U]; - encrypt_600(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_690(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1568U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1568U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemCiphertext_1f ciphertext0 = - libcrux_ml_kem_types_from_01_fc(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_5a0(shared_secret, shared_secret_array); + kdf_d8_540(shared_secret, shared_secret_array); libcrux_ml_kem_types_MlKemCiphertext_1f uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -5710,12 +5712,12 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_secret_key_940( +static KRML_MUSTINLINE void deserialize_secret_key_180( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_7d();); + secret_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -5727,7 +5729,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_940( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_uncompressed_ring_element_d1(secret_bytes); + deserialize_to_uncompressed_ring_element_59(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[4U]; @@ -5746,8 +5748,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_ring_element_u_cc(Eurydice_slice serialized) { - return deserialize_then_decompress_11_57(serialized); +deserialize_then_decompress_ring_element_u_88(Eurydice_slice serialized) { + return deserialize_then_decompress_11_1a(serialized); } /** @@ -5756,7 +5758,7 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - VECTOR_U_COMPRESSION_FACTOR= 11 */ -static KRML_MUSTINLINE void ntt_vector_u_60( +static KRML_MUSTINLINE void ntt_vector_u_2c( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = (size_t)0U; ntt_at_layer_4_plus_1d(&zeta_i, re, (size_t)7U); @@ -5766,7 +5768,7 @@ static KRML_MUSTINLINE void ntt_vector_u_60( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** @@ -5777,12 +5779,12 @@ with const generics - CIPHERTEXT_SIZE= 1568 - U_COMPRESSION_FACTOR= 11 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_84( +static KRML_MUSTINLINE void deserialize_then_decompress_u_a8( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_7d();); + u_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1568U, ciphertext, uint8_t), @@ -5800,8 +5802,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_84( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)11U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_cc(u_bytes); - ntt_vector_u_60(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_88(u_bytes); + ntt_vector_u_2c(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -5815,8 +5817,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - COMPRESSION_FACTOR= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -deserialize_then_decompress_ring_element_v_80(Eurydice_slice serialized) { - return deserialize_then_decompress_5_7b(serialized); +deserialize_then_decompress_ring_element_v_05(Eurydice_slice serialized) { + return deserialize_then_decompress_5_7e(serialized); } /** @@ -5826,17 +5828,17 @@ with const generics - K= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_message_78( +compute_message_a4( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_31(&result, &product);); - invert_ntt_montgomery_4a(&result); - result = subtract_reduce_ef_79(v, result); + ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_31(&result, &product);); + invert_ntt_montgomery_0c(&result); + result = subtract_reduce_20_27(v, result); return result; } @@ -5850,18 +5852,18 @@ with const generics - U_COMPRESSION_FACTOR= 11 - V_COMPRESSION_FACTOR= 5 */ -static void decrypt_unpacked_cb(IndCpaPrivateKeyUnpacked_01 *secret_key, +static void decrypt_unpacked_e5(IndCpaPrivateKeyUnpacked_01 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[4U]; - deserialize_then_decompress_u_84(ciphertext, u_as_ntt); + deserialize_then_decompress_u_a8(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - deserialize_then_decompress_ring_element_v_80( + deserialize_then_decompress_ring_element_v_05( Eurydice_array_to_subslice_from((size_t)1568U, ciphertext, (size_t)1408U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message = - compute_message_78(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_a4(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_e4(message, ret0); + compress_then_serialize_message_d2(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -5875,10 +5877,10 @@ with const generics - U_COMPRESSION_FACTOR= 11 - V_COMPRESSION_FACTOR= 5 */ -static void decrypt_b80(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_980(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[4U]; - deserialize_secret_key_940(secret_key, secret_as_ntt); + deserialize_secret_key_180(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_d2 copy_of_secret_as_ntt[4U]; memcpy( @@ -5889,7 +5891,7 @@ static void decrypt_b80(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); uint8_t result[32U]; - decrypt_unpacked_cb(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_e5(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -5929,7 +5931,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab0( +void libcrux_ml_kem_ind_cca_decapsulate_0b0( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -5947,7 +5949,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab0( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_b80(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_980(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -5969,7 +5971,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab0( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1600U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_47(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_49(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_a9_42(Eurydice_array_to_slice((size_t)1600U, to_hash, uint8_t), @@ -5979,17 +5981,17 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab0( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1568U]; - encrypt_600(uu____5, copy_of_decrypted, pseudorandomness, + encrypt_690(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_5a0(Eurydice_array_to_slice( + kdf_d8_540(Eurydice_array_to_slice( (size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_5a0(shared_secret0, shared_secret1); + kdf_d8_540(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_47(ciphertext), + libcrux_ml_kem_types_as_ref_00_49(ciphertext), Eurydice_array_to_slice((size_t)1568U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -6004,7 +6006,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d0( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_fb0( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -6018,7 +6020,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_3d0( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_reduced_ring_element_ec(ring_element); + deserialize_to_reduced_ring_element_b8(ring_element); deserialized_pk[i0] = uu____0; } } @@ -6029,13 +6031,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_85( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_7d();); - deserialize_ring_elements_reduced_3d0(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_7d();); + deserialize_ring_elements_reduced_fb0(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); @@ -6048,7 +6050,7 @@ with const generics - K= 2 - OUT_LEN= 768 */ -static KRML_MUSTINLINE void serialize_secret_key_720( +static KRML_MUSTINLINE void serialize_secret_key_050( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *key, uint8_t ret[768U]) { uint8_t out[768U] = {0U}; @@ -6066,7 +6068,7 @@ static KRML_MUSTINLINE void serialize_secret_key_720( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_88(&re, ret0); + serialize_uncompressed_ring_element_b8(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -6081,13 +6083,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE void serialize_public_key_mut_820( +static KRML_MUSTINLINE void serialize_public_key_mut_7b0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)768U, uint8_t); uint8_t ret[768U]; - serialize_secret_key_720(t_as_ntt, ret); + serialize_secret_key_050(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)768U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -6104,11 +6106,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE void serialize_public_key_390( +static KRML_MUSTINLINE void serialize_public_key_f70( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[800U]) { uint8_t public_key_serialized[800U] = {0U}; - serialize_public_key_mut_820(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_7b0(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[800U]; memcpy(result, public_key_serialized, (size_t)800U * sizeof(uint8_t)); memcpy(ret, result, (size_t)800U * sizeof(uint8_t)); @@ -6122,15 +6124,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_95(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_2e(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[2U]; - deserialize_ring_elements_reduced_out_85( + deserialize_ring_elements_reduced_out_bf( Eurydice_array_to_subslice_to((size_t)800U, public_key, (size_t)768U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = deserialized_pk; uint8_t public_key_serialized[800U]; - serialize_public_key_390( + serialize_public_key_f70( uu____0, Eurydice_array_to_subslice_from((size_t)800U, public_key, (size_t)768U, uint8_t, size_t), @@ -6160,7 +6162,7 @@ with const generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_ca( +bool libcrux_ml_kem_ind_cca_validate_private_key_c6( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext) { uint8_t t[32U]; @@ -6188,18 +6190,18 @@ typedef struct IndCpaPrivateKeyUnpacked_d6_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static IndCpaPrivateKeyUnpacked_d6 default_1a_190(void) { +static IndCpaPrivateKeyUnpacked_d6 default_f6_190(void) { IndCpaPrivateKeyUnpacked_d6 lit; - lit.secret_as_ntt[0U] = ZERO_ef_7d(); - lit.secret_as_ntt[1U] = ZERO_ef_7d(); + lit.secret_as_ntt[0U] = ZERO_20_7d(); + lit.secret_as_ntt[1U] = ZERO_20_7d(); return lit; } @@ -6218,28 +6220,28 @@ typedef struct IndCpaPublicKeyUnpacked_d6_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static IndCpaPublicKeyUnpacked_d6 default_8d_800(void) { +static IndCpaPublicKeyUnpacked_d6 default_85_800(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - uu____0[i] = ZERO_ef_7d();); + uu____0[i] = ZERO_20_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_d6 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_7d(); - lit.A[0U][1U] = ZERO_ef_7d(); - lit.A[1U][0U] = ZERO_ef_7d(); - lit.A[1U][1U] = ZERO_ef_7d(); + lit.A[0U][0U] = ZERO_20_7d(); + lit.A[0U][1U] = ZERO_20_7d(); + lit.A[1U][0U] = ZERO_20_7d(); + lit.A[1U][1U] = ZERO_20_7d(); return lit; } @@ -6266,7 +6268,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 2 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_7e0( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_0e0( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -6569,7 +6571,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e40( int16_t s[272U]) { - return from_i16_array_ef_14( + return from_i16_array_20_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -6775,7 +6777,7 @@ static KRML_MUSTINLINE tuple_74 sample_vector_cbd_then_ntt_out_d70( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_7d();); + re_as_ntt[i] = ZERO_20_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6796,16 +6798,15 @@ static KRML_MUSTINLINE tuple_74 sample_vector_cbd_then_ntt_out_d70( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_310( +static KRML_MUSTINLINE void add_to_ring_element_20_310( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -6839,7 +6840,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_670( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -6852,10 +6853,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_670( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_310(&t_as_ntt[i0], &product); + ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_310(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -6873,7 +6874,7 @@ static void generate_keypair_unpacked_4a0( IndCpaPrivateKeyUnpacked_d6 *private_key, IndCpaPublicKeyUnpacked_d6 *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_7e0(key_generation_seed, hashed); + cpa_keygen_seed_d8_0e0(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -6908,7 +6909,7 @@ static void generate_keypair_unpacked_4a0( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6924,18 +6925,18 @@ with const generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_1c( +static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_1e( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_d6 private_key = default_1a_190(); - IndCpaPublicKeyUnpacked_d6 public_key = default_8d_800(); + IndCpaPrivateKeyUnpacked_d6 private_key = default_f6_190(); + IndCpaPublicKeyUnpacked_d6 public_key = default_85_800(); generate_keypair_unpacked_4a0(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[800U]; - serialize_public_key_390( + serialize_public_key_f70( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[768U]; - serialize_secret_key_720(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_050(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[768U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -6959,7 +6960,7 @@ with const generics - K= 2 - SERIALIZED_KEY_LEN= 1632 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_28( +static KRML_MUSTINLINE void serialize_kem_secret_key_7b( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[1632U]) { uint8_t out[1632U] = {0U}; @@ -7014,7 +7015,7 @@ with const generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_2a( +libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_dd( uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, @@ -7024,13 +7025,13 @@ libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_2a( LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair512 uu____0 = - generate_keypair_1c(ind_cpa_keypair_randomness); + generate_keypair_1e(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[768U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)768U * sizeof(uint8_t)); uint8_t public_key[800U]; memcpy(public_key, uu____0.snd, (size_t)800U * sizeof(uint8_t)); uint8_t secret_key_serialized[1632U]; - serialize_kem_secret_key_28( + serialize_kem_secret_key_7b( Eurydice_array_to_slice((size_t)768U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)800U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -7039,13 +7040,13 @@ libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_2a( memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)1632U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_5e private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_5e uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[800U]; memcpy(copy_of_public_key, public_key, (size_t)800U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -7058,7 +7059,7 @@ with types libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - K= 2 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_7b(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_44(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -7121,10 +7122,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_74 -sample_ring_element_cbd_460(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_2d0(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - error_1[i] = ZERO_ef_7d();); + error_1[i] = ZERO_20_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -7177,18 +7178,18 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_4a0( +static KRML_MUSTINLINE void invert_ntt_montgomery_0c0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_f8(&zeta_i, re); - invert_ntt_at_layer_2_de(&zeta_i, re); - invert_ntt_at_layer_3_0f(&zeta_i, re); + invert_ntt_at_layer_1_92(&zeta_i, re); + invert_ntt_at_layer_2_7a(&zeta_i, re); + invert_ntt_at_layer_3_2e(&zeta_i, re); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)4U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_09(re); + poly_barrett_reduce_20_09(re); } /** @@ -7197,14 +7198,14 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void compute_vector_u_a90( +static KRML_MUSTINLINE void compute_vector_u_7f0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 (*a_as_ntt)[2U], libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - result0[i] = ZERO_ef_7d();); + result0[i] = ZERO_20_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -7224,11 +7225,11 @@ static KRML_MUSTINLINE void compute_vector_u_a90( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_310(&result0[i1], &product); + ntt_multiply_20_63(a_element, &r_as_ntt[j]); + add_to_ring_element_20_310(&result0[i1], &product); } - invert_ntt_montgomery_4a0(&result0[i1]); - add_error_reduce_ef_84(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_0c0(&result0[i1]); + add_error_reduce_20_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[2U]; memcpy( @@ -7246,18 +7247,18 @@ with const generics - K= 2 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_ring_element_v_e60( +compute_ring_element_v_ac0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_310(&result, &product);); - invert_ntt_montgomery_4a0(&result); - result = add_message_error_reduce_ef_b0(error_2, message, result); + ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_310(&result, &product);); + invert_ntt_montgomery_0c0(&result); + result = add_message_error_reduce_20_df(error_2, message, result); return result; } @@ -7270,7 +7271,7 @@ with const generics - COMPRESSION_FACTOR= 10 - BLOCK_LEN= 320 */ -static void compress_then_serialize_u_490( +static void compress_then_serialize_u_6d0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 input[2U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -7286,7 +7287,7 @@ static void compress_then_serialize_u_490( out, i0 * ((size_t)640U / (size_t)2U), (i0 + (size_t)1U) * ((size_t)640U / (size_t)2U), uint8_t); uint8_t ret[320U]; - compress_then_serialize_ring_element_u_130(&re, ret); + compress_then_serialize_ring_element_u_430(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); } @@ -7309,7 +7310,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_670(IndCpaPublicKeyUnpacked_d6 *public_key, +static void encrypt_unpacked_720(IndCpaPublicKeyUnpacked_d6 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { uint8_t prf_input[33U]; @@ -7327,7 +7328,7 @@ static void encrypt_unpacked_670(IndCpaPublicKeyUnpacked_d6 *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_74 uu____3 = - sample_ring_element_cbd_460(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_2d0(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[2U]; memcpy( error_1, uu____3.fst, @@ -7341,25 +7342,25 @@ static void encrypt_unpacked_670(IndCpaPublicKeyUnpacked_d6 *public_key, sample_from_binomial_distribution_73( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u[2U]; - compute_vector_u_a90(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_7f0(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message_as_ring_element = - deserialize_then_decompress_message_a6(copy_of_message); + deserialize_then_decompress_message_4f(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - compute_ring_element_v_e60(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_ac0(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[768U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____5[2U]; memcpy( uu____5, u, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); - compress_then_serialize_u_490( + compress_then_serialize_u_6d0( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)640U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____6 = v; - compress_then_serialize_ring_element_v_460( + compress_then_serialize_ring_element_v_610( uu____6, Eurydice_array_to_subslice_from((size_t)768U, ciphertext, (size_t)640U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)768U * sizeof(uint8_t)); @@ -7382,10 +7383,10 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_60(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_69(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { - IndCpaPublicKeyUnpacked_d6 unpacked_public_key = default_8d_800(); - deserialize_ring_elements_reduced_3d0( + IndCpaPublicKeyUnpacked_d6 unpacked_public_key = default_85_800(); + deserialize_ring_elements_reduced_fb0( Eurydice_slice_subslice_to(public_key, (size_t)768U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -7400,7 +7401,7 @@ static void encrypt_60(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[768U]; - encrypt_unpacked_670(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_720(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)768U * sizeof(uint8_t)); } @@ -7415,7 +7416,7 @@ with const generics - K= 2 - CIPHERTEXT_SIZE= 768 */ -static KRML_MUSTINLINE void kdf_d8_5a(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_54(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -7442,11 +7443,11 @@ with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c6( +tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c2( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_7b( + entropy_preprocess_d8_44( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -7456,7 +7457,7 @@ tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c6( size_t); uint8_t ret[32U]; H_a9_160(Eurydice_array_to_slice( - (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cc0(public_key), + (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cf0(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -7470,19 +7471,19 @@ tuple_ec libcrux_ml_kem_ind_cca_encapsulate_c6( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cc0(public_key), uint8_t); + (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cf0(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[768U]; - encrypt_60(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_69(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[768U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)768U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemCiphertext_e8 ciphertext0 = - libcrux_ml_kem_types_from_01_fc0(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f0(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_5a(shared_secret, shared_secret_array); + kdf_d8_54(shared_secret, shared_secret_array); libcrux_ml_kem_types_MlKemCiphertext_e8 uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -7501,12 +7502,12 @@ with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_secret_key_94( +static KRML_MUSTINLINE void deserialize_secret_key_18( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_7d();); + secret_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -7518,7 +7519,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_94( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - deserialize_to_uncompressed_ring_element_d1(secret_bytes); + deserialize_to_uncompressed_ring_element_59(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[2U]; @@ -7538,12 +7539,12 @@ with const generics - CIPHERTEXT_SIZE= 768 - U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_840( +static KRML_MUSTINLINE void deserialize_then_decompress_u_a80( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_7d();); + u_as_ntt[i] = ZERO_20_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)768U, ciphertext, uint8_t), @@ -7561,8 +7562,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_840( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)10U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_cc0(u_bytes); - ntt_vector_u_600(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_880(u_bytes); + ntt_vector_u_2c0(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -7576,17 +7577,17 @@ with const generics - K= 2 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -compute_message_780( +compute_message_a40( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_310(&result, &product);); - invert_ntt_montgomery_4a0(&result); - result = subtract_reduce_ef_79(v, result); + ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_310(&result, &product);); + invert_ntt_montgomery_0c0(&result); + result = subtract_reduce_20_27(v, result); return result; } @@ -7600,18 +7601,18 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_unpacked_cb0(IndCpaPrivateKeyUnpacked_d6 *secret_key, +static void decrypt_unpacked_e50(IndCpaPrivateKeyUnpacked_d6 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[2U]; - deserialize_then_decompress_u_840(ciphertext, u_as_ntt); + deserialize_then_decompress_u_a80(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - deserialize_then_decompress_ring_element_v_800( + deserialize_then_decompress_ring_element_v_050( Eurydice_array_to_subslice_from((size_t)768U, ciphertext, (size_t)640U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message = - compute_message_780(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_a40(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_e4(message, ret0); + compress_then_serialize_message_d2(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -7625,10 +7626,10 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_b8(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_98(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[2U]; - deserialize_secret_key_94(secret_key, secret_as_ntt); + deserialize_secret_key_18(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_d2 copy_of_secret_as_ntt[2U]; memcpy( @@ -7639,7 +7640,7 @@ static void decrypt_b8(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); uint8_t result[32U]; - decrypt_unpacked_cb0(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_e50(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -7679,7 +7680,7 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -void libcrux_ml_kem_ind_cca_decapsulate_ab( +void libcrux_ml_kem_ind_cca_decapsulate_0b( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -7697,7 +7698,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_b8(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_98(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -7719,7 +7720,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)800U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_470(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_490(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_a9_421(Eurydice_array_to_slice((size_t)800U, to_hash, uint8_t), @@ -7729,16 +7730,16 @@ void libcrux_ml_kem_ind_cca_decapsulate_ab( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[768U]; - encrypt_60(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); + encrypt_69(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_5a(Eurydice_array_to_slice((size_t)32U, + kdf_d8_54(Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_5a(shared_secret0, shared_secret1); + kdf_d8_54(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_470(ciphertext), + libcrux_ml_kem_types_as_ref_00_490(ciphertext), Eurydice_array_to_slice((size_t)768U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, diff --git a/libcrux-ml-kem/c/libcrux_mlkem_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem_avx2.h index 679ea6f82..b1d46ac81 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem_portable.c b/libcrux-ml-kem/c/libcrux_mlkem_portable.c index ccc6f3b26..f54504354 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "internal/libcrux_mlkem_portable.h" @@ -79,7 +79,7 @@ libcrux_ml_kem_vector_portable_vector_type_from_i16_array( Eurydice_slice_to_array2( &dst, Eurydice_slice_subslice2(array, (size_t)0U, (size_t)16U, int16_t), Eurydice_slice, int16_t[16U]); - core_result_unwrap_26_30(dst, ret); + core_result_unwrap_41_30(dst, ret); memcpy(lit.elements, ret, (size_t)16U * sizeof(int16_t)); return lit; } @@ -1146,15 +1146,15 @@ uint8_t libcrux_ml_kem_vector_portable_compress_compress_message_coefficient( KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_compress_1( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; - v.elements[i0] = (int16_t) + a.elements[i0] = (int16_t) libcrux_ml_kem_vector_portable_compress_compress_message_coefficient( - (uint16_t)v.elements[i0]); + (uint16_t)a.elements[i0]); } - return v; + return a; } /** @@ -1163,8 +1163,8 @@ libcrux_ml_kem::vector::portable::vector_type::PortableVector)} */ libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_1_0d( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_1(v); + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_1(a); } KRML_MUSTINLINE uint32_t @@ -2281,16 +2281,15 @@ libcrux_ml_kem_vector_portable_vector_type_clone_3b( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ZERO_ef_19(void) { +static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ZERO_20_19(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_portable_ZERO_0d(); lit.coefficients[1U] = libcrux_ml_kem_vector_portable_ZERO_0d(); @@ -2318,8 +2317,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_to_reduced_ring_element_d3(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_to_reduced_ring_element_8a(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2340,7 +2339,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_bb( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -2354,7 +2353,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_reduced_ring_element_d3(ring_element); + deserialize_to_reduced_ring_element_8a(ring_element); deserialized_pk[i0] = uu____0; } } @@ -2365,13 +2364,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_581( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_611( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_19();); - deserialize_ring_elements_reduced_8b(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_19();); + deserialize_ring_elements_reduced_bb(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); @@ -2383,7 +2382,7 @@ with const generics - SHIFT_BY= 15 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -shift_right_95(libcrux_ml_kem_vector_portable_vector_type_PortableVector vec) { +shift_right_3c(libcrux_ml_kem_vector_portable_vector_type_PortableVector vec) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; @@ -2402,8 +2401,8 @@ with const generics - SHIFT_BY= 15 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -shift_right_0d_64(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return shift_right_95(v); +shift_right_0d_3e(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { + return shift_right_3c(v); } /** @@ -2416,27 +2415,41 @@ static libcrux_ml_kem_vector_portable_vector_type_PortableVector to_unsigned_representative_9f( libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { libcrux_ml_kem_vector_portable_vector_type_PortableVector t = - shift_right_0d_64(a); + shift_right_0d_3e(a); libcrux_ml_kem_vector_portable_vector_type_PortableVector fm = libcrux_ml_kem_vector_portable_bitwise_and_with_constant_0d( t, LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); return libcrux_ml_kem_vector_portable_add_0d(a, &fm); } +/** +A monomorphic instance of libcrux_ml_kem.serialize.to_unsigned_field_modulus +with types libcrux_ml_kem_vector_portable_vector_type_PortableVector +with const generics + +*/ +static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector +to_unsigned_field_modulus_c4( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + libcrux_ml_kem_vector_portable_vector_type_PortableVector result = + to_unsigned_representative_9f(a); + return result; +} + /** A monomorphic instance of libcrux_ml_kem.serialize.serialize_uncompressed_ring_element with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void serialize_uncompressed_ring_element_c4( +static KRML_MUSTINLINE void serialize_uncompressed_ring_element_c6( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[384U]) { uint8_t serialized[384U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - to_unsigned_representative_9f(re->coefficients[i0]); + to_unsigned_field_modulus_c4(re->coefficients[i0]); uint8_t bytes[24U]; libcrux_ml_kem_vector_portable_serialize_12_0d(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -2444,7 +2457,9 @@ static KRML_MUSTINLINE void serialize_uncompressed_ring_element_c4( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)24U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)384U * sizeof(uint8_t)); + uint8_t result[384U]; + memcpy(result, serialized, (size_t)384U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)384U * sizeof(uint8_t)); } /** @@ -2454,7 +2469,7 @@ with const generics - K= 4 - OUT_LEN= 1536 */ -static KRML_MUSTINLINE void serialize_secret_key_80( +static KRML_MUSTINLINE void serialize_secret_key_1d( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *key, uint8_t ret[1536U]) { uint8_t out[1536U] = {0U}; @@ -2472,7 +2487,7 @@ static KRML_MUSTINLINE void serialize_secret_key_80( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_c4(&re, ret0); + serialize_uncompressed_ring_element_c6(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -2487,13 +2502,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE void serialize_public_key_mut_1d( +static KRML_MUSTINLINE void serialize_public_key_mut_0d( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1536U, uint8_t); uint8_t ret[1536U]; - serialize_secret_key_80(t_as_ntt, ret); + serialize_secret_key_1d(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1536U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -2510,11 +2525,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -static KRML_MUSTINLINE void serialize_public_key_96( +static KRML_MUSTINLINE void serialize_public_key_8c( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1568U]) { uint8_t public_key_serialized[1568U] = {0U}; - serialize_public_key_mut_1d(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_0d(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1568U]; memcpy(result, public_key_serialized, (size_t)1568U * sizeof(uint8_t)); memcpy(ret, result, (size_t)1568U * sizeof(uint8_t)); @@ -2528,15 +2543,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1536 - PUBLIC_KEY_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c1(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_f71(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[4U]; - deserialize_ring_elements_reduced_out_581( + deserialize_ring_elements_reduced_out_611( Eurydice_array_to_subslice_to((size_t)1568U, public_key, (size_t)1536U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1568U]; - serialize_public_key_96( + serialize_public_key_8c( uu____0, Eurydice_array_to_subslice_from((size_t)1568U, public_key, (size_t)1536U, uint8_t, size_t), @@ -2566,7 +2581,7 @@ with const generics - SECRET_KEY_SIZE= 3168 - CIPHERTEXT_SIZE= 1568 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_53( +bool libcrux_ml_kem_ind_cca_validate_private_key_ed( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *_ciphertext) { uint8_t t[32U]; @@ -2594,20 +2609,20 @@ typedef struct IndCpaPrivateKeyUnpacked_42_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static IndCpaPrivateKeyUnpacked_42 default_1a_a3(void) { +static IndCpaPrivateKeyUnpacked_42 default_f6_a3(void) { IndCpaPrivateKeyUnpacked_42 lit; - lit.secret_as_ntt[0U] = ZERO_ef_19(); - lit.secret_as_ntt[1U] = ZERO_ef_19(); - lit.secret_as_ntt[2U] = ZERO_ef_19(); - lit.secret_as_ntt[3U] = ZERO_ef_19(); + lit.secret_as_ntt[0U] = ZERO_20_19(); + lit.secret_as_ntt[1U] = ZERO_20_19(); + lit.secret_as_ntt[2U] = ZERO_20_19(); + lit.secret_as_ntt[3U] = ZERO_20_19(); return lit; } @@ -2626,40 +2641,40 @@ typedef struct IndCpaPublicKeyUnpacked_42_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static IndCpaPublicKeyUnpacked_42 default_8d_6b(void) { +static IndCpaPublicKeyUnpacked_42 default_85_6b(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - uu____0[i] = ZERO_ef_19();); + uu____0[i] = ZERO_20_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_42 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_19(); - lit.A[0U][1U] = ZERO_ef_19(); - lit.A[0U][2U] = ZERO_ef_19(); - lit.A[0U][3U] = ZERO_ef_19(); - lit.A[1U][0U] = ZERO_ef_19(); - lit.A[1U][1U] = ZERO_ef_19(); - lit.A[1U][2U] = ZERO_ef_19(); - lit.A[1U][3U] = ZERO_ef_19(); - lit.A[2U][0U] = ZERO_ef_19(); - lit.A[2U][1U] = ZERO_ef_19(); - lit.A[2U][2U] = ZERO_ef_19(); - lit.A[2U][3U] = ZERO_ef_19(); - lit.A[3U][0U] = ZERO_ef_19(); - lit.A[3U][1U] = ZERO_ef_19(); - lit.A[3U][2U] = ZERO_ef_19(); - lit.A[3U][3U] = ZERO_ef_19(); + lit.A[0U][0U] = ZERO_20_19(); + lit.A[0U][1U] = ZERO_20_19(); + lit.A[0U][2U] = ZERO_20_19(); + lit.A[0U][3U] = ZERO_20_19(); + lit.A[1U][0U] = ZERO_20_19(); + lit.A[1U][1U] = ZERO_20_19(); + lit.A[1U][2U] = ZERO_20_19(); + lit.A[1U][3U] = ZERO_20_19(); + lit.A[2U][0U] = ZERO_20_19(); + lit.A[2U][1U] = ZERO_20_19(); + lit.A[2U][2U] = ZERO_20_19(); + lit.A[2U][3U] = ZERO_20_19(); + lit.A[3U][0U] = ZERO_20_19(); + lit.A[3U][1U] = ZERO_20_19(); + lit.A[3U][2U] = ZERO_20_19(); + lit.A[3U][3U] = ZERO_20_19(); return lit; } @@ -2686,7 +2701,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$4size_t]] with const generics - K= 4 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_61( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_39( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -2981,18 +2996,17 @@ static KRML_MUSTINLINE bool sample_from_uniform_distribution_next_fb0( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -from_i16_array_ef_bb(Eurydice_slice a) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); +from_i16_array_20_bb(Eurydice_slice a) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3014,7 +3028,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba( int16_t s[272U]) { - return from_i16_array_ef_bb( + return from_i16_array_20_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -3183,7 +3197,7 @@ sample_from_binomial_distribution_2_1b(Eurydice_slice randomness) { sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_ef_bb( + return from_i16_array_20_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3227,7 +3241,7 @@ sample_from_binomial_distribution_3_ee(Eurydice_slice randomness) { sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_ef_bb( + return from_i16_array_20_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3393,16 +3407,15 @@ static KRML_MUSTINLINE void ntt_at_layer_1_21( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void poly_barrett_reduce_ef_0a( +static KRML_MUSTINLINE void poly_barrett_reduce_20_0a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -3430,7 +3443,7 @@ static KRML_MUSTINLINE void ntt_binomially_sampled_ring_element_b3( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_ef_0a(re); + poly_barrett_reduce_20_0a(re); } /** @@ -3489,7 +3502,7 @@ static KRML_MUSTINLINE tuple_710 sample_vector_cbd_then_ntt_out_44( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_19();); + re_as_ntt[i] = ZERO_20_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -3510,19 +3523,18 @@ static KRML_MUSTINLINE tuple_710 sample_vector_cbd_then_ntt_out_44( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -ntt_multiply_ef_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, +ntt_multiply_20_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = ZERO_20_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3543,16 +3555,15 @@ ntt_multiply_ef_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_3a( +static KRML_MUSTINLINE void add_to_ring_element_20_3a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -3585,16 +3596,15 @@ to_standard_domain_73( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void add_standard_error_reduce_ef_69( +static KRML_MUSTINLINE void add_standard_error_reduce_20_69( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -3630,7 +3640,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f0( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -3643,10 +3653,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_3a(&t_as_ntt[i0], &product); + ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_3a(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -3664,7 +3674,7 @@ static void generate_keypair_unpacked_86( IndCpaPrivateKeyUnpacked_42 *private_key, IndCpaPublicKeyUnpacked_42 *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_61(key_generation_seed, hashed); + cpa_keygen_seed_d8_39(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -3699,7 +3709,7 @@ static void generate_keypair_unpacked_86( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -3715,18 +3725,18 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_ea1( +static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_791( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_42 private_key = default_1a_a3(); - IndCpaPublicKeyUnpacked_42 public_key = default_8d_6b(); + IndCpaPrivateKeyUnpacked_42 private_key = default_f6_a3(); + IndCpaPublicKeyUnpacked_42 public_key = default_85_6b(); generate_keypair_unpacked_86(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1568U]; - serialize_public_key_96( + serialize_public_key_8c( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1536U]; - serialize_secret_key_80(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_1d(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1536U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -3750,7 +3760,7 @@ with const generics - K= 4 - SERIALIZED_KEY_LEN= 3168 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_bb( +static KRML_MUSTINLINE void serialize_kem_secret_key_64( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[3168U]) { uint8_t out[3168U] = {0U}; @@ -3806,7 +3816,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem1024_MlKem1024KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b21(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_911(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -3815,13 +3825,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b21(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair1024 uu____0 = - generate_keypair_ea1(ind_cpa_keypair_randomness); + generate_keypair_791(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1536U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1536U * sizeof(uint8_t)); uint8_t public_key[1568U]; memcpy(public_key, uu____0.snd, (size_t)1568U * sizeof(uint8_t)); uint8_t secret_key_serialized[3168U]; - serialize_kem_secret_key_bb( + serialize_kem_secret_key_64( Eurydice_array_to_slice((size_t)1536U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1568U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -3830,13 +3840,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b21(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)3168U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_95 private_key = - libcrux_ml_kem_types_from_7f_721(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c1(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_95 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1568U]; memcpy(copy_of_public_key, public_key, (size_t)1568U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d1( - uu____2, libcrux_ml_kem_types_from_5a_c61(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f61( + uu____2, libcrux_ml_kem_types_from_5a_451(copy_of_public_key)); } /** @@ -3849,7 +3859,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$4size_t]] with const generics - K= 4 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_f3(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_8d(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -3867,10 +3877,10 @@ generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_710 -sample_ring_element_cbd_72(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_f9(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - error_1[i] = ZERO_ef_19();); + error_1[i] = ZERO_20_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -3935,7 +3945,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_1_2e( +static KRML_MUSTINLINE void invert_ntt_at_layer_1_9d( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; @@ -3956,7 +3966,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_2_42( +static KRML_MUSTINLINE void invert_ntt_at_layer_2_82( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; @@ -3975,7 +3985,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_3_0c( +static KRML_MUSTINLINE void invert_ntt_at_layer_3_be( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t round = i; @@ -3995,7 +4005,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector_x2 - inv_ntt_layer_int_vec_step_reduce_1b( + inv_ntt_layer_int_vec_step_reduce_66( libcrux_ml_kem_vector_portable_vector_type_PortableVector a, libcrux_ml_kem_vector_portable_vector_type_PortableVector b, int16_t zeta_r) { @@ -4015,7 +4025,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void invert_ntt_at_layer_4_plus_6a( +static KRML_MUSTINLINE void invert_ntt_at_layer_4_plus_8c( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, size_t layer) { size_t step = (size_t)1U << (uint32_t)layer; @@ -4030,7 +4040,7 @@ static KRML_MUSTINLINE void invert_ntt_at_layer_4_plus_6a( for (size_t i = offset_vec; i < offset_vec + step_vec; i++) { size_t j = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector_x2 uu____0 = - inv_ntt_layer_int_vec_step_reduce_1b( + inv_ntt_layer_int_vec_step_reduce_66( re->coefficients[j], re->coefficients[j + step_vec], libcrux_ml_kem_polynomial_get_zeta(zeta_i[0U])); libcrux_ml_kem_vector_portable_vector_type_PortableVector x = uu____0.fst; @@ -4047,32 +4057,31 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_04( +static KRML_MUSTINLINE void invert_ntt_montgomery_45( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_2e(&zeta_i, re); - invert_ntt_at_layer_2_42(&zeta_i, re); - invert_ntt_at_layer_3_0c(&zeta_i, re); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)4U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)5U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)6U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_0a(re); + invert_ntt_at_layer_1_9d(&zeta_i, re); + invert_ntt_at_layer_2_82(&zeta_i, re); + invert_ntt_at_layer_3_be(&zeta_i, re); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)4U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); + poly_barrett_reduce_20_0a(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void add_error_reduce_ef_15( +static KRML_MUSTINLINE void add_error_reduce_20_bd( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -4096,14 +4105,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void compute_vector_u_02( +static KRML_MUSTINLINE void compute_vector_u_cc( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 (*a_as_ntt)[4U], libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - result0[i] = ZERO_ef_19();); + result0[i] = ZERO_20_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -4123,11 +4132,11 @@ static KRML_MUSTINLINE void compute_vector_u_02( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_3a(&result0[i1], &product); + ntt_multiply_20_76(a_element, &r_as_ntt[j]); + add_to_ring_element_20_3a(&result0[i1], &product); } - invert_ntt_montgomery_04(&result0[i1]); - add_error_reduce_ef_15(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_45(&result0[i1]); + add_error_reduce_20_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[4U]; memcpy( @@ -4163,8 +4172,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_message_c9(uint8_t serialized[32U]) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_then_decompress_message_52(uint8_t serialized[32U]) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector @@ -4181,17 +4190,16 @@ deserialize_then_decompress_message_c9(uint8_t serialized[32U]) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -add_message_error_reduce_ef_f0( +add_message_error_reduce_20_42( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result) { @@ -4221,18 +4229,18 @@ with const generics - K= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_ring_element_v_c7( +compute_ring_element_v_14( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_3a(&result, &product);); - invert_ntt_montgomery_04(&result); - result = add_message_error_reduce_ef_f0(error_2, message, result); + ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_3a(&result, &product);); + invert_ntt_montgomery_45(&result); + result = add_message_error_reduce_20_42(error_2, message, result); return result; } @@ -4242,16 +4250,16 @@ with const generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_6c(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +compress_c5(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)10, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)10, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4263,9 +4271,9 @@ A monomorphic instance of libcrux_ml_kem.vector.portable.compress_0d with const generics - COEFFICIENT_BITS= 10 */ -static libcrux_ml_kem_vector_portable_vector_type_PortableVector compress_0d_20( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return compress_6c(v); +static libcrux_ml_kem_vector_portable_vector_type_PortableVector compress_0d_4f( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return compress_c5(a); } /** @@ -4274,16 +4282,16 @@ with const generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_6c0(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +compress_c50(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)11, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)11, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4296,8 +4304,8 @@ with const generics - COEFFICIENT_BITS= 11 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_0d_200(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return compress_6c0(v); +compress_0d_4f0(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return compress_c50(a); } /** @@ -4306,14 +4314,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - OUT_LEN= 352 */ -static KRML_MUSTINLINE void compress_then_serialize_11_ba( +static KRML_MUSTINLINE void compress_then_serialize_11_8b( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[352U]) { uint8_t serialized[352U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - compress_0d_200(to_unsigned_representative_9f(re->coefficients[i0])); + compress_0d_4f0(to_unsigned_representative_9f(re->coefficients[i0])); uint8_t bytes[22U]; libcrux_ml_kem_vector_portable_serialize_11_0d(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -4331,10 +4339,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 11 - OUT_LEN= 352 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_ed( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_03( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[352U]) { uint8_t uu____0[352U]; - compress_then_serialize_11_ba(re, uu____0); + compress_then_serialize_11_8b(re, uu____0); memcpy(ret, uu____0, (size_t)352U * sizeof(uint8_t)); } @@ -4347,7 +4355,7 @@ with const generics - COMPRESSION_FACTOR= 11 - BLOCK_LEN= 352 */ -static void compress_then_serialize_u_bf( +static void compress_then_serialize_u_7a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 input[4U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -4363,7 +4371,7 @@ static void compress_then_serialize_u_bf( out, i0 * ((size_t)1408U / (size_t)4U), (i0 + (size_t)1U) * ((size_t)1408U / (size_t)4U), uint8_t); uint8_t ret[352U]; - compress_then_serialize_ring_element_u_ed(&re, ret); + compress_then_serialize_ring_element_u_03(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)352U, ret, uint8_t), uint8_t); } @@ -4375,16 +4383,16 @@ with const generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_6c1(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +compress_c51(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)4, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)4, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4397,8 +4405,8 @@ with const generics - COEFFICIENT_BITS= 4 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_0d_201(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return compress_6c1(v); +compress_0d_4f1(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return compress_c51(a); } /** @@ -4407,16 +4415,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_4_b7( +static KRML_MUSTINLINE void compress_then_serialize_4_51( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - compress_0d_201(to_unsigned_representative_9f(re.coefficients[i0])); + compress_0d_4f1(to_unsigned_field_modulus_c4(re.coefficients[i0])); uint8_t bytes[8U]; libcrux_ml_kem_vector_portable_serialize_4_0d(coefficient, bytes); Eurydice_slice_copy( @@ -4432,16 +4438,16 @@ with const generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_6c2(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +compress_c52(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)5, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)5, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4454,8 +4460,8 @@ with const generics - COEFFICIENT_BITS= 5 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -compress_0d_202(libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return compress_6c2(v); +compress_0d_4f2(libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return compress_c52(a); } /** @@ -4464,16 +4470,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_5_96( +static KRML_MUSTINLINE void compress_then_serialize_5_32( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients = - compress_0d_202(to_unsigned_representative_9f(re.coefficients[i0])); + compress_0d_4f2(to_unsigned_representative_9f(re.coefficients[i0])); uint8_t bytes[10U]; libcrux_ml_kem_vector_portable_serialize_5_0d(coefficients, bytes); Eurydice_slice_copy( @@ -4490,9 +4494,9 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 5 - OUT_LEN= 160 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_de( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_8f( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice out) { - compress_then_serialize_5_96(re, out); + compress_then_serialize_5_32(re, out); } /** @@ -4513,7 +4517,7 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_0d(IndCpaPublicKeyUnpacked_42 *public_key, +static void encrypt_unpacked_ad(IndCpaPublicKeyUnpacked_42 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { uint8_t prf_input[33U]; @@ -4531,7 +4535,7 @@ static void encrypt_unpacked_0d(IndCpaPublicKeyUnpacked_42 *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_710 uu____3 = - sample_ring_element_cbd_72(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_f9(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[4U]; memcpy( error_1, uu____3.fst, @@ -4545,25 +4549,25 @@ static void encrypt_unpacked_0d(IndCpaPublicKeyUnpacked_42 *public_key, sample_from_binomial_distribution_ce( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u[4U]; - compute_vector_u_02(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_cc(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message_as_ring_element = - deserialize_then_decompress_message_c9(copy_of_message); + deserialize_then_decompress_message_52(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - compute_ring_element_v_c7(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_14(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1568U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____5[4U]; memcpy( uu____5, u, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); - compress_then_serialize_u_bf( + compress_then_serialize_u_7a( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)1408U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____6 = v; - compress_then_serialize_ring_element_v_de( + compress_then_serialize_ring_element_v_8f( uu____6, Eurydice_array_to_subslice_from((size_t)1568U, ciphertext, (size_t)1408U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1568U * sizeof(uint8_t)); @@ -4587,10 +4591,10 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_5f1(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_f41(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { - IndCpaPublicKeyUnpacked_42 unpacked_public_key = default_8d_6b(); - deserialize_ring_elements_reduced_8b( + IndCpaPublicKeyUnpacked_42 unpacked_public_key = default_85_6b(); + deserialize_ring_elements_reduced_bb( Eurydice_slice_subslice_to(public_key, (size_t)1536U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -4605,7 +4609,7 @@ static void encrypt_5f1(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1568U]; - encrypt_unpacked_0d(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_ad(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1568U * sizeof(uint8_t)); } @@ -4620,7 +4624,7 @@ with const generics - K= 4 - CIPHERTEXT_SIZE= 1568 */ -static KRML_MUSTINLINE void kdf_d8_cf(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_f0(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -4647,11 +4651,11 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_21 libcrux_ml_kem_ind_cca_encapsulate_131( +tuple_21 libcrux_ml_kem_ind_cca_encapsulate_361( libcrux_ml_kem_types_MlKemPublicKey_1f *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_f3( + entropy_preprocess_d8_8d( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -4661,7 +4665,7 @@ tuple_21 libcrux_ml_kem_ind_cca_encapsulate_131( size_t); uint8_t ret[32U]; H_f1_c6(Eurydice_array_to_slice( - (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cc(public_key), + (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cf(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -4675,19 +4679,19 @@ tuple_21 libcrux_ml_kem_ind_cca_encapsulate_131( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cc(public_key), uint8_t); + (size_t)1568U, libcrux_ml_kem_types_as_slice_fd_cf(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1568U]; - encrypt_5f1(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_f41(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1568U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1568U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemCiphertext_1f ciphertext0 = - libcrux_ml_kem_types_from_01_fc(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_cf(shared_secret, shared_secret_array); + kdf_d8_f0(shared_secret, shared_secret_array); libcrux_ml_kem_types_MlKemCiphertext_1f uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -4707,8 +4711,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_to_uncompressed_ring_element_0b(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_to_uncompressed_ring_element_7a(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -4727,12 +4731,12 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void deserialize_secret_key_e71( +static KRML_MUSTINLINE void deserialize_secret_key_a71( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_19();); + secret_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -4744,7 +4748,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_e71( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_uncompressed_ring_element_0b(secret_bytes); + deserialize_to_uncompressed_ring_element_7a(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[4U]; @@ -4763,7 +4767,7 @@ const generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_be( +decompress_ciphertext_coefficient_b4( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -4788,9 +4792,9 @@ generics - COEFFICIENT_BITS= 10 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_0d_4f( +decompress_ciphertext_coefficient_0d_4c( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return decompress_ciphertext_coefficient_be(v); + return decompress_ciphertext_coefficient_b4(v); } /** @@ -4800,8 +4804,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_10_c9(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_then_decompress_10_58(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice( @@ -4817,7 +4821,7 @@ deserialize_then_decompress_10_c9(Eurydice_slice serialized) { libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_10_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - decompress_ciphertext_coefficient_0d_4f(coefficient); + decompress_ciphertext_coefficient_0d_4c(coefficient); re.coefficients[i0] = uu____0; } return re; @@ -4830,7 +4834,7 @@ const generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_be0( +decompress_ciphertext_coefficient_b40( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -4855,9 +4859,9 @@ generics - COEFFICIENT_BITS= 11 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_0d_4f0( +decompress_ciphertext_coefficient_0d_4c0( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return decompress_ciphertext_coefficient_be0(v); + return decompress_ciphertext_coefficient_b40(v); } /** @@ -4867,8 +4871,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_11_fe(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_then_decompress_11_5c(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -4877,7 +4881,7 @@ deserialize_then_decompress_11_fe(Eurydice_slice serialized) { libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_11_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - decompress_ciphertext_coefficient_0d_4f0(coefficient); + decompress_ciphertext_coefficient_0d_4c0(coefficient); re.coefficients[i0] = uu____0; } return re; @@ -4890,8 +4894,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_ring_element_u_17(Eurydice_slice serialized) { - return deserialize_then_decompress_11_fe(serialized); +deserialize_then_decompress_ring_element_u_9c(Eurydice_slice serialized) { + return deserialize_then_decompress_11_5c(serialized); } /** @@ -4900,7 +4904,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - VECTOR_U_COMPRESSION_FACTOR= 11 */ -static KRML_MUSTINLINE void ntt_vector_u_2a( +static KRML_MUSTINLINE void ntt_vector_u_72( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = (size_t)0U; ntt_at_layer_4_plus_18(&zeta_i, re, (size_t)7U); @@ -4910,7 +4914,7 @@ static KRML_MUSTINLINE void ntt_vector_u_2a( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_ef_0a(re); + poly_barrett_reduce_20_0a(re); } /** @@ -4921,12 +4925,12 @@ with const generics - CIPHERTEXT_SIZE= 1568 - U_COMPRESSION_FACTOR= 11 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_7c( +static KRML_MUSTINLINE void deserialize_then_decompress_u_1e( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_19();); + u_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1568U, ciphertext, uint8_t), @@ -4944,8 +4948,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_7c( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)11U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_17(u_bytes); - ntt_vector_u_2a(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_9c(u_bytes); + ntt_vector_u_72(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -4959,7 +4963,7 @@ const generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_be1( +decompress_ciphertext_coefficient_b41( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -4984,9 +4988,9 @@ generics - COEFFICIENT_BITS= 4 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_0d_4f1( +decompress_ciphertext_coefficient_0d_4c1( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return decompress_ciphertext_coefficient_be1(v); + return decompress_ciphertext_coefficient_b41(v); } /** @@ -4996,8 +5000,8 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_4_c2(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_then_decompress_4_6c(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -5006,7 +5010,7 @@ deserialize_then_decompress_4_c2(Eurydice_slice serialized) { libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_4_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - decompress_ciphertext_coefficient_0d_4f1(coefficient); + decompress_ciphertext_coefficient_0d_4c1(coefficient); re.coefficients[i0] = uu____0; } return re; @@ -5019,7 +5023,7 @@ const generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_be2( +decompress_ciphertext_coefficient_b42( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -5044,9 +5048,9 @@ generics - COEFFICIENT_BITS= 5 */ static libcrux_ml_kem_vector_portable_vector_type_PortableVector -decompress_ciphertext_coefficient_0d_4f2( +decompress_ciphertext_coefficient_0d_4c2( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return decompress_ciphertext_coefficient_be2(v); + return decompress_ciphertext_coefficient_b42(v); } /** @@ -5056,8 +5060,8 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_5_a7(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); +deserialize_then_decompress_5_96(Eurydice_slice serialized) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -5066,7 +5070,7 @@ deserialize_then_decompress_5_a7(Eurydice_slice serialized) { re.coefficients[i0] = libcrux_ml_kem_vector_portable_deserialize_5_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____1 = - decompress_ciphertext_coefficient_0d_4f2(re.coefficients[i0]); + decompress_ciphertext_coefficient_0d_4c2(re.coefficients[i0]); re.coefficients[i0] = uu____1; } return re; @@ -5079,23 +5083,22 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_ring_element_v_41(Eurydice_slice serialized) { - return deserialize_then_decompress_5_a7(serialized); +deserialize_then_decompress_ring_element_v_ad(Eurydice_slice serialized) { + return deserialize_then_decompress_5_96(serialized); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -subtract_reduce_ef_1e(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, +subtract_reduce_20_87(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 b) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -5120,17 +5123,17 @@ with const generics - K= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_message_b7( +compute_message_7e( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_3a(&result, &product);); - invert_ntt_montgomery_04(&result); - result = subtract_reduce_ef_1e(v, result); + ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_3a(&result, &product);); + invert_ntt_montgomery_45(&result); + result = subtract_reduce_20_87(v, result); return result; } @@ -5140,13 +5143,13 @@ libcrux_ml_kem.serialize.compress_then_serialize_message with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void compress_then_serialize_message_2c( +static KRML_MUSTINLINE void compress_then_serialize_message_4f( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, uint8_t ret[32U]) { uint8_t serialized[32U] = {0U}; KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - to_unsigned_representative_9f(re.coefficients[i0]); + to_unsigned_field_modulus_c4(re.coefficients[i0]); libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient_compressed = libcrux_ml_kem_vector_portable_compress_1_0d(coefficient); @@ -5157,7 +5160,9 @@ static KRML_MUSTINLINE void compress_then_serialize_message_2c( Eurydice_slice_copy(uu____0, Eurydice_array_to_slice((size_t)2U, bytes, uint8_t), uint8_t);); - memcpy(ret, serialized, (size_t)32U * sizeof(uint8_t)); + uint8_t result[32U]; + memcpy(result, serialized, (size_t)32U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } /** @@ -5170,18 +5175,18 @@ with const generics - U_COMPRESSION_FACTOR= 11 - V_COMPRESSION_FACTOR= 5 */ -static void decrypt_unpacked_ed(IndCpaPrivateKeyUnpacked_42 *secret_key, +static void decrypt_unpacked_81(IndCpaPrivateKeyUnpacked_42 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[4U]; - deserialize_then_decompress_u_7c(ciphertext, u_as_ntt); + deserialize_then_decompress_u_1e(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - deserialize_then_decompress_ring_element_v_41( + deserialize_then_decompress_ring_element_v_ad( Eurydice_array_to_subslice_from((size_t)1568U, ciphertext, (size_t)1408U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message = - compute_message_b7(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_7e(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_2c(message, ret0); + compress_then_serialize_message_4f(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -5195,10 +5200,10 @@ with const generics - U_COMPRESSION_FACTOR= 11 - V_COMPRESSION_FACTOR= 5 */ -static void decrypt_1f1(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_411(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[4U]; - deserialize_secret_key_e71(secret_key, secret_as_ntt); + deserialize_secret_key_a71(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_f0 copy_of_secret_as_ntt[4U]; memcpy( @@ -5209,7 +5214,7 @@ static void decrypt_1f1(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); uint8_t result[32U]; - decrypt_unpacked_ed(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_81(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -5261,7 +5266,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600 */ -void libcrux_ml_kem_ind_cca_decapsulate_551( +void libcrux_ml_kem_ind_cca_decapsulate_391( libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key, libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -5279,7 +5284,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_551( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_1f1(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_411(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -5301,7 +5306,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_551( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1600U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_47(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_49(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_f1_9d(Eurydice_array_to_slice((size_t)1600U, to_hash, uint8_t), @@ -5311,17 +5316,17 @@ void libcrux_ml_kem_ind_cca_decapsulate_551( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1568U]; - encrypt_5f1(uu____5, copy_of_decrypted, pseudorandomness, + encrypt_f41(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_cf(Eurydice_array_to_slice((size_t)32U, + kdf_d8_f0(Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_cf(shared_secret0, shared_secret1); + kdf_d8_f0(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_47(ciphertext), + libcrux_ml_kem_types_as_ref_00_49(ciphertext), Eurydice_array_to_slice((size_t)1568U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -5336,7 +5341,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b0( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_bb0( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -5350,7 +5355,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b0( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_reduced_ring_element_d3(ring_element); + deserialize_to_reduced_ring_element_8a(ring_element); deserialized_pk[i0] = uu____0; } } @@ -5361,13 +5366,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_580( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_610( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_19();); - deserialize_ring_elements_reduced_8b0(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_19();); + deserialize_ring_elements_reduced_bb0(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); @@ -5380,7 +5385,7 @@ with const generics - K= 2 - OUT_LEN= 768 */ -static KRML_MUSTINLINE void serialize_secret_key_800( +static KRML_MUSTINLINE void serialize_secret_key_1d0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *key, uint8_t ret[768U]) { uint8_t out[768U] = {0U}; @@ -5398,7 +5403,7 @@ static KRML_MUSTINLINE void serialize_secret_key_800( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_c4(&re, ret0); + serialize_uncompressed_ring_element_c6(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -5413,13 +5418,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE void serialize_public_key_mut_1d0( +static KRML_MUSTINLINE void serialize_public_key_mut_0d0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)768U, uint8_t); uint8_t ret[768U]; - serialize_secret_key_800(t_as_ntt, ret); + serialize_secret_key_1d0(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)768U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -5436,11 +5441,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -static KRML_MUSTINLINE void serialize_public_key_960( +static KRML_MUSTINLINE void serialize_public_key_8c0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[800U]) { uint8_t public_key_serialized[800U] = {0U}; - serialize_public_key_mut_1d0(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_0d0(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[800U]; memcpy(result, public_key_serialized, (size_t)800U * sizeof(uint8_t)); memcpy(ret, result, (size_t)800U * sizeof(uint8_t)); @@ -5454,15 +5459,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 768 - PUBLIC_KEY_SIZE= 800 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c0(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_f70(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[2U]; - deserialize_ring_elements_reduced_out_580( + deserialize_ring_elements_reduced_out_610( Eurydice_array_to_subslice_to((size_t)800U, public_key, (size_t)768U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = deserialized_pk; uint8_t public_key_serialized[800U]; - serialize_public_key_960( + serialize_public_key_8c0( uu____0, Eurydice_array_to_subslice_from((size_t)800U, public_key, (size_t)768U, uint8_t, size_t), @@ -5492,7 +5497,7 @@ with const generics - SECRET_KEY_SIZE= 1632 - CIPHERTEXT_SIZE= 768 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_24( +bool libcrux_ml_kem_ind_cca_validate_private_key_d8( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext) { uint8_t t[32U]; @@ -5520,18 +5525,18 @@ typedef struct IndCpaPrivateKeyUnpacked_ae_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static IndCpaPrivateKeyUnpacked_ae default_1a_a30(void) { +static IndCpaPrivateKeyUnpacked_ae default_f6_a30(void) { IndCpaPrivateKeyUnpacked_ae lit; - lit.secret_as_ntt[0U] = ZERO_ef_19(); - lit.secret_as_ntt[1U] = ZERO_ef_19(); + lit.secret_as_ntt[0U] = ZERO_20_19(); + lit.secret_as_ntt[1U] = ZERO_20_19(); return lit; } @@ -5550,28 +5555,28 @@ typedef struct IndCpaPublicKeyUnpacked_ae_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static IndCpaPublicKeyUnpacked_ae default_8d_6b0(void) { +static IndCpaPublicKeyUnpacked_ae default_85_6b0(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - uu____0[i] = ZERO_ef_19();); + uu____0[i] = ZERO_20_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_ae lit; memcpy( lit.t_as_ntt, uu____0, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_19(); - lit.A[0U][1U] = ZERO_ef_19(); - lit.A[1U][0U] = ZERO_ef_19(); - lit.A[1U][1U] = ZERO_ef_19(); + lit.A[0U][0U] = ZERO_20_19(); + lit.A[0U][1U] = ZERO_20_19(); + lit.A[1U][0U] = ZERO_20_19(); + lit.A[1U][1U] = ZERO_20_19(); return lit; } @@ -5598,7 +5603,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$2size_t]] with const generics - K= 2 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_c9( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_eb( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -5900,7 +5905,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba0( int16_t s[272U]) { - return from_i16_array_ef_bb( + return from_i16_array_20_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -6095,7 +6100,7 @@ static KRML_MUSTINLINE tuple_740 sample_vector_cbd_then_ntt_out_440( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_19();); + re_as_ntt[i] = ZERO_20_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6116,16 +6121,15 @@ static KRML_MUSTINLINE tuple_740 sample_vector_cbd_then_ntt_out_440( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_3a0( +static KRML_MUSTINLINE void add_to_ring_element_20_3a0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -6163,7 +6167,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f00( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -6176,10 +6180,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f00( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_3a0(&t_as_ntt[i0], &product); + ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_3a0(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -6197,7 +6201,7 @@ static void generate_keypair_unpacked_860( IndCpaPrivateKeyUnpacked_ae *private_key, IndCpaPublicKeyUnpacked_ae *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_c9(key_generation_seed, hashed); + cpa_keygen_seed_d8_eb(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -6232,7 +6236,7 @@ static void generate_keypair_unpacked_860( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6248,18 +6252,18 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1= 3 - ETA1_RANDOMNESS_SIZE= 192 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_ea0( +static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_790( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_ae private_key = default_1a_a30(); - IndCpaPublicKeyUnpacked_ae public_key = default_8d_6b0(); + IndCpaPrivateKeyUnpacked_ae private_key = default_f6_a30(); + IndCpaPublicKeyUnpacked_ae public_key = default_85_6b0(); generate_keypair_unpacked_860(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[800U]; - serialize_public_key_960( + serialize_public_key_8c0( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[768U]; - serialize_secret_key_800(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_1d0(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[768U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -6283,7 +6287,7 @@ with const generics - K= 2 - SERIALIZED_KEY_LEN= 1632 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_ad( +static KRML_MUSTINLINE void serialize_kem_secret_key_ee( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[1632U]) { uint8_t out[1632U] = {0U}; @@ -6339,7 +6343,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 192 */ libcrux_ml_kem_types_MlKemKeyPair_cb -libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_910(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -6348,13 +6352,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair512 uu____0 = - generate_keypair_ea0(ind_cpa_keypair_randomness); + generate_keypair_790(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[768U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)768U * sizeof(uint8_t)); uint8_t public_key[800U]; memcpy(public_key, uu____0.snd, (size_t)800U * sizeof(uint8_t)); uint8_t secret_key_serialized[1632U]; - serialize_kem_secret_key_ad( + serialize_kem_secret_key_ee( Eurydice_array_to_slice((size_t)768U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)800U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -6363,13 +6367,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)1632U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_5e private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_5e uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[800U]; memcpy(copy_of_public_key, public_key, (size_t)800U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -6382,7 +6386,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$2size_t]] with const generics - K= 2 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_64(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_91(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -6432,10 +6436,10 @@ generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_740 -sample_ring_element_cbd_720(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_f90(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - error_1[i] = ZERO_ef_19();); + error_1[i] = ZERO_20_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6488,18 +6492,18 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_040( +static KRML_MUSTINLINE void invert_ntt_montgomery_450( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_2e(&zeta_i, re); - invert_ntt_at_layer_2_42(&zeta_i, re); - invert_ntt_at_layer_3_0c(&zeta_i, re); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)4U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)5U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)6U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_0a(re); + invert_ntt_at_layer_1_9d(&zeta_i, re); + invert_ntt_at_layer_2_82(&zeta_i, re); + invert_ntt_at_layer_3_be(&zeta_i, re); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)4U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); + poly_barrett_reduce_20_0a(re); } /** @@ -6508,14 +6512,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void compute_vector_u_020( +static KRML_MUSTINLINE void compute_vector_u_cc0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 (*a_as_ntt)[2U], libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - result0[i] = ZERO_ef_19();); + result0[i] = ZERO_20_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -6535,11 +6539,11 @@ static KRML_MUSTINLINE void compute_vector_u_020( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_3a0(&result0[i1], &product); + ntt_multiply_20_76(a_element, &r_as_ntt[j]); + add_to_ring_element_20_3a0(&result0[i1], &product); } - invert_ntt_montgomery_040(&result0[i1]); - add_error_reduce_ef_15(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_450(&result0[i1]); + add_error_reduce_20_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[2U]; memcpy( @@ -6557,18 +6561,18 @@ with const generics - K= 2 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_ring_element_v_c70( +compute_ring_element_v_140( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_3a0(&result, &product);); - invert_ntt_montgomery_040(&result); - result = add_message_error_reduce_ef_f0(error_2, message, result); + ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_3a0(&result, &product);); + invert_ntt_montgomery_450(&result); + result = add_message_error_reduce_20_42(error_2, message, result); return result; } @@ -6578,14 +6582,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - OUT_LEN= 320 */ -static KRML_MUSTINLINE void compress_then_serialize_10_7e0( +static KRML_MUSTINLINE void compress_then_serialize_10_630( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - compress_0d_20(to_unsigned_representative_9f(re->coefficients[i0])); + compress_0d_4f(to_unsigned_field_modulus_c4(re->coefficients[i0])); uint8_t bytes[20U]; libcrux_ml_kem_vector_portable_serialize_10_0d(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -6593,7 +6597,9 @@ static KRML_MUSTINLINE void compress_then_serialize_10_7e0( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)20U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)320U * sizeof(uint8_t)); + uint8_t result[320U]; + memcpy(result, serialized, (size_t)320U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)320U * sizeof(uint8_t)); } /** @@ -6603,10 +6609,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 10 - OUT_LEN= 320 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_ed0( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_u_030( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[320U]) { uint8_t uu____0[320U]; - compress_then_serialize_10_7e0(re, uu____0); + compress_then_serialize_10_630(re, uu____0); memcpy(ret, uu____0, (size_t)320U * sizeof(uint8_t)); } @@ -6619,7 +6625,7 @@ with const generics - COMPRESSION_FACTOR= 10 - BLOCK_LEN= 320 */ -static void compress_then_serialize_u_bf0( +static void compress_then_serialize_u_7a0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 input[2U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -6635,7 +6641,7 @@ static void compress_then_serialize_u_bf0( out, i0 * ((size_t)640U / (size_t)2U), (i0 + (size_t)1U) * ((size_t)640U / (size_t)2U), uint8_t); uint8_t ret[320U]; - compress_then_serialize_ring_element_u_ed0(&re, ret); + compress_then_serialize_ring_element_u_030(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); } @@ -6648,9 +6654,9 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 4 - OUT_LEN= 128 */ -static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_de0( +static KRML_MUSTINLINE void compress_then_serialize_ring_element_v_8f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice out) { - compress_then_serialize_4_b7(re, out); + compress_then_serialize_4_51(re, out); } /** @@ -6671,7 +6677,7 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_0d0(IndCpaPublicKeyUnpacked_ae *public_key, +static void encrypt_unpacked_ad0(IndCpaPublicKeyUnpacked_ae *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { uint8_t prf_input[33U]; @@ -6690,7 +6696,7 @@ static void encrypt_unpacked_0d0(IndCpaPublicKeyUnpacked_ae *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_740 uu____3 = - sample_ring_element_cbd_720(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_f90(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[2U]; memcpy( error_1, uu____3.fst, @@ -6704,25 +6710,25 @@ static void encrypt_unpacked_0d0(IndCpaPublicKeyUnpacked_ae *public_key, sample_from_binomial_distribution_ce( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u[2U]; - compute_vector_u_020(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_cc0(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message_as_ring_element = - deserialize_then_decompress_message_c9(copy_of_message); + deserialize_then_decompress_message_52(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - compute_ring_element_v_c70(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_140(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[768U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____5[2U]; memcpy( uu____5, u, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); - compress_then_serialize_u_bf0( + compress_then_serialize_u_7a0( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)640U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____6 = v; - compress_then_serialize_ring_element_v_de0( + compress_then_serialize_ring_element_v_8f0( uu____6, Eurydice_array_to_subslice_from((size_t)768U, ciphertext, (size_t)640U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)768U * sizeof(uint8_t)); @@ -6746,10 +6752,10 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_5f0(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_f40(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { - IndCpaPublicKeyUnpacked_ae unpacked_public_key = default_8d_6b0(); - deserialize_ring_elements_reduced_8b0( + IndCpaPublicKeyUnpacked_ae unpacked_public_key = default_85_6b0(); + deserialize_ring_elements_reduced_bb0( Eurydice_slice_subslice_to(public_key, (size_t)768U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -6764,7 +6770,7 @@ static void encrypt_5f0(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[768U]; - encrypt_unpacked_0d0(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_ad0(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)768U * sizeof(uint8_t)); } @@ -6779,7 +6785,7 @@ with const generics - K= 2 - CIPHERTEXT_SIZE= 768 */ -static KRML_MUSTINLINE void kdf_d8_c2(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_3b(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -6806,11 +6812,11 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_ec libcrux_ml_kem_ind_cca_encapsulate_130( +tuple_ec libcrux_ml_kem_ind_cca_encapsulate_360( libcrux_ml_kem_types_MlKemPublicKey_be *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_64( + entropy_preprocess_d8_91( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -6820,7 +6826,7 @@ tuple_ec libcrux_ml_kem_ind_cca_encapsulate_130( size_t); uint8_t ret[32U]; H_f1_c60(Eurydice_array_to_slice( - (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cc0(public_key), + (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cf0(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -6834,19 +6840,19 @@ tuple_ec libcrux_ml_kem_ind_cca_encapsulate_130( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cc0(public_key), uint8_t); + (size_t)800U, libcrux_ml_kem_types_as_slice_fd_cf0(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[768U]; - encrypt_5f0(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_f40(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[768U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)768U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemCiphertext_e8 ciphertext0 = - libcrux_ml_kem_types_from_01_fc0(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f0(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_c2(shared_secret, shared_secret_array); + kdf_d8_3b(shared_secret, shared_secret_array); libcrux_ml_kem_types_MlKemCiphertext_e8 uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -6865,12 +6871,12 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void deserialize_secret_key_e70( +static KRML_MUSTINLINE void deserialize_secret_key_a70( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_19();); + secret_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -6882,7 +6888,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_e70( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_uncompressed_ring_element_0b(secret_bytes); + deserialize_to_uncompressed_ring_element_7a(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[2U]; @@ -6901,8 +6907,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_ring_element_u_170(Eurydice_slice serialized) { - return deserialize_then_decompress_10_c9(serialized); +deserialize_then_decompress_ring_element_u_9c0(Eurydice_slice serialized) { + return deserialize_then_decompress_10_58(serialized); } /** @@ -6911,7 +6917,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - VECTOR_U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void ntt_vector_u_2a0( +static KRML_MUSTINLINE void ntt_vector_u_720( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = (size_t)0U; ntt_at_layer_4_plus_18(&zeta_i, re, (size_t)7U); @@ -6921,7 +6927,7 @@ static KRML_MUSTINLINE void ntt_vector_u_2a0( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_ef_0a(re); + poly_barrett_reduce_20_0a(re); } /** @@ -6932,12 +6938,12 @@ with const generics - CIPHERTEXT_SIZE= 768 - U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_7c0( +static KRML_MUSTINLINE void deserialize_then_decompress_u_1e0( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_19();); + u_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)768U, ciphertext, uint8_t), @@ -6955,8 +6961,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_7c0( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)10U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_170(u_bytes); - ntt_vector_u_2a0(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_9c0(u_bytes); + ntt_vector_u_720(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -6970,8 +6976,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -deserialize_then_decompress_ring_element_v_410(Eurydice_slice serialized) { - return deserialize_then_decompress_4_c2(serialized); +deserialize_then_decompress_ring_element_v_ad0(Eurydice_slice serialized) { + return deserialize_then_decompress_4_6c(serialized); } /** @@ -6981,17 +6987,17 @@ with const generics - K= 2 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_message_b70( +compute_message_7e0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_3a0(&result, &product);); - invert_ntt_montgomery_040(&result); - result = subtract_reduce_ef_1e(v, result); + ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_3a0(&result, &product);); + invert_ntt_montgomery_450(&result); + result = subtract_reduce_20_87(v, result); return result; } @@ -7005,18 +7011,18 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_unpacked_ed0(IndCpaPrivateKeyUnpacked_ae *secret_key, +static void decrypt_unpacked_810(IndCpaPrivateKeyUnpacked_ae *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[2U]; - deserialize_then_decompress_u_7c0(ciphertext, u_as_ntt); + deserialize_then_decompress_u_1e0(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - deserialize_then_decompress_ring_element_v_410( + deserialize_then_decompress_ring_element_v_ad0( Eurydice_array_to_subslice_from((size_t)768U, ciphertext, (size_t)640U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message = - compute_message_b70(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_7e0(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_2c(message, ret0); + compress_then_serialize_message_4f(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -7030,10 +7036,10 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_1f0(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_410(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[2U]; - deserialize_secret_key_e70(secret_key, secret_as_ntt); + deserialize_secret_key_a70(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_f0 copy_of_secret_as_ntt[2U]; memcpy( @@ -7044,7 +7050,7 @@ static void decrypt_1f0(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); uint8_t result[32U]; - decrypt_unpacked_ed0(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_810(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -7084,7 +7090,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800 */ -void libcrux_ml_kem_ind_cca_decapsulate_550( +void libcrux_ml_kem_ind_cca_decapsulate_390( libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key, libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -7102,7 +7108,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_550( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_1f0(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_410(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -7124,7 +7130,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_550( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)800U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_470(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_490(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_f1_9d1(Eurydice_array_to_slice((size_t)800U, to_hash, uint8_t), @@ -7134,17 +7140,17 @@ void libcrux_ml_kem_ind_cca_decapsulate_550( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[768U]; - encrypt_5f0(uu____5, copy_of_decrypted, pseudorandomness, + encrypt_f40(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_c2(Eurydice_array_to_slice((size_t)32U, + kdf_d8_3b(Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_c2(shared_secret0, shared_secret1); + kdf_d8_3b(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_470(ciphertext), + libcrux_ml_kem_types_as_ref_00_490(ciphertext), Eurydice_array_to_slice((size_t)768U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -7159,7 +7165,7 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b1( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_bb1( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -7173,7 +7179,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_8b1( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_reduced_ring_element_d3(ring_element); + deserialize_to_reduced_ring_element_8a(ring_element); deserialized_pk[i0] = uu____0; } } @@ -7184,13 +7190,13 @@ libcrux_ml_kem.serialize.deserialize_ring_elements_reduced_out with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_58( +static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_61( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - deserialized_pk[i] = ZERO_ef_19();); - deserialize_ring_elements_reduced_8b1(public_key, deserialized_pk); + deserialized_pk[i] = ZERO_20_19();); + deserialize_ring_elements_reduced_bb1(public_key, deserialized_pk); memcpy( ret, deserialized_pk, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); @@ -7203,7 +7209,7 @@ with const generics - K= 3 - OUT_LEN= 1152 */ -static KRML_MUSTINLINE void serialize_secret_key_801( +static KRML_MUSTINLINE void serialize_secret_key_1d1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *key, uint8_t ret[1152U]) { uint8_t out[1152U] = {0U}; @@ -7221,7 +7227,7 @@ static KRML_MUSTINLINE void serialize_secret_key_801( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - serialize_uncompressed_ring_element_c4(&re, ret0); + serialize_uncompressed_ring_element_c6(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -7236,13 +7242,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void serialize_public_key_mut_1d1( +static KRML_MUSTINLINE void serialize_public_key_mut_0d1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1152U, uint8_t); uint8_t ret[1152U]; - serialize_secret_key_801(t_as_ntt, ret); + serialize_secret_key_1d1(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1152U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -7259,11 +7265,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void serialize_public_key_961( +static KRML_MUSTINLINE void serialize_public_key_8c1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1184U]) { uint8_t public_key_serialized[1184U] = {0U}; - serialize_public_key_mut_1d1(t_as_ntt, seed_for_a, public_key_serialized); + serialize_public_key_mut_0d1(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1184U]; memcpy(result, public_key_serialized, (size_t)1184U * sizeof(uint8_t)); memcpy(ret, result, (size_t)1184U * sizeof(uint8_t)); @@ -7277,15 +7283,15 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -bool libcrux_ml_kem_ind_cca_validate_public_key_3c(uint8_t *public_key) { +bool libcrux_ml_kem_ind_cca_validate_public_key_f7(uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; - deserialize_ring_elements_reduced_out_58( + deserialize_ring_elements_reduced_out_61( Eurydice_array_to_subslice_to((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1184U]; - serialize_public_key_961( + serialize_public_key_8c1( uu____0, Eurydice_array_to_subslice_from((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), @@ -7315,7 +7321,7 @@ with const generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -bool libcrux_ml_kem_ind_cca_validate_private_key_9e( +bool libcrux_ml_kem_ind_cca_validate_private_key_c3( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext) { uint8_t t[32U]; @@ -7343,19 +7349,19 @@ typedef struct IndCpaPrivateKeyUnpacked_f8_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static IndCpaPrivateKeyUnpacked_f8 default_1a_a31(void) { +static IndCpaPrivateKeyUnpacked_f8 default_f6_a31(void) { IndCpaPrivateKeyUnpacked_f8 lit; - lit.secret_as_ntt[0U] = ZERO_ef_19(); - lit.secret_as_ntt[1U] = ZERO_ef_19(); - lit.secret_as_ntt[2U] = ZERO_ef_19(); + lit.secret_as_ntt[0U] = ZERO_20_19(); + lit.secret_as_ntt[1U] = ZERO_20_19(); + lit.secret_as_ntt[2U] = ZERO_20_19(); return lit; } @@ -7374,33 +7380,33 @@ typedef struct IndCpaPublicKeyUnpacked_f8_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static IndCpaPublicKeyUnpacked_f8 default_8d_6b1(void) { +static IndCpaPublicKeyUnpacked_f8 default_85_6b1(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - uu____0[i] = ZERO_ef_19();); + uu____0[i] = ZERO_20_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_f8 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_ef_19(); - lit.A[0U][1U] = ZERO_ef_19(); - lit.A[0U][2U] = ZERO_ef_19(); - lit.A[1U][0U] = ZERO_ef_19(); - lit.A[1U][1U] = ZERO_ef_19(); - lit.A[1U][2U] = ZERO_ef_19(); - lit.A[2U][0U] = ZERO_ef_19(); - lit.A[2U][1U] = ZERO_ef_19(); - lit.A[2U][2U] = ZERO_ef_19(); + lit.A[0U][0U] = ZERO_20_19(); + lit.A[0U][1U] = ZERO_20_19(); + lit.A[0U][2U] = ZERO_20_19(); + lit.A[1U][0U] = ZERO_20_19(); + lit.A[1U][1U] = ZERO_20_19(); + lit.A[1U][2U] = ZERO_20_19(); + lit.A[2U][0U] = ZERO_20_19(); + lit.A[2U][1U] = ZERO_20_19(); + lit.A[2U][2U] = ZERO_20_19(); return lit; } @@ -7427,7 +7433,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void cpa_keygen_seed_d8_26( +static KRML_MUSTINLINE void cpa_keygen_seed_d8_99( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -7729,7 +7735,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba1( int16_t s[272U]) { - return from_i16_array_ef_bb( + return from_i16_array_20_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -7913,7 +7919,7 @@ static KRML_MUSTINLINE tuple_b00 sample_vector_cbd_then_ntt_out_441( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - re_as_ntt[i] = ZERO_ef_19();); + re_as_ntt[i] = ZERO_20_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -7934,16 +7940,15 @@ static KRML_MUSTINLINE tuple_b00 sample_vector_cbd_then_ntt_out_441( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void add_to_ring_element_ef_3a1( +static KRML_MUSTINLINE void add_to_ring_element_20_3a1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -7981,7 +7986,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f01( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -7994,10 +7999,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f01( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_ef_3a1(&t_as_ntt[i0], &product); + ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_20_3a1(&t_as_ntt[i0], &product); } - add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -8015,7 +8020,7 @@ static void generate_keypair_unpacked_861( IndCpaPrivateKeyUnpacked_f8 *private_key, IndCpaPublicKeyUnpacked_f8 *public_key) { uint8_t hashed[64U]; - cpa_keygen_seed_d8_26(key_generation_seed, hashed); + cpa_keygen_seed_d8_99(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -8050,7 +8055,7 @@ static void generate_keypair_unpacked_861( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_26_33(dst, uu____5); + core_result_unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -8066,18 +8071,18 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_ea( +static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_79( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_f8 private_key = default_1a_a31(); - IndCpaPublicKeyUnpacked_f8 public_key = default_8d_6b1(); + IndCpaPrivateKeyUnpacked_f8 private_key = default_f6_a31(); + IndCpaPublicKeyUnpacked_f8 public_key = default_85_6b1(); generate_keypair_unpacked_861(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - serialize_public_key_961( + serialize_public_key_8c1( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - serialize_secret_key_801(private_key.secret_as_ntt, secret_key_serialized); + serialize_secret_key_1d1(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; memcpy(copy_of_secret_key_serialized, secret_key_serialized, @@ -8101,7 +8106,7 @@ with const generics - K= 3 - SERIALIZED_KEY_LEN= 2400 */ -static KRML_MUSTINLINE void serialize_kem_secret_key_59( +static KRML_MUSTINLINE void serialize_kem_secret_key_d8( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[2400U]) { uint8_t out[2400U] = {0U}; @@ -8157,7 +8162,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_91(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -8166,13 +8171,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - generate_keypair_ea(ind_cpa_keypair_randomness); + generate_keypair_79(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - serialize_kem_secret_key_59( + serialize_kem_secret_key_d8( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -8181,13 +8186,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_720(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c0(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d0( - uu____2, libcrux_ml_kem_types_from_5a_c60(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f60( + uu____2, libcrux_ml_kem_types_from_5a_450(copy_of_public_key)); } /** @@ -8200,7 +8205,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void entropy_preprocess_d8_b7(Eurydice_slice randomness, +static KRML_MUSTINLINE void entropy_preprocess_d8_03(Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -8218,10 +8223,10 @@ generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_b00 -sample_ring_element_cbd_721(uint8_t prf_input[33U], uint8_t domain_separator) { +sample_ring_element_cbd_f91(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - error_1[i] = ZERO_ef_19();); + error_1[i] = ZERO_20_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -8274,18 +8279,18 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void invert_ntt_montgomery_041( +static KRML_MUSTINLINE void invert_ntt_montgomery_451( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - invert_ntt_at_layer_1_2e(&zeta_i, re); - invert_ntt_at_layer_2_42(&zeta_i, re); - invert_ntt_at_layer_3_0c(&zeta_i, re); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)4U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)5U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)6U); - invert_ntt_at_layer_4_plus_6a(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_ef_0a(re); + invert_ntt_at_layer_1_9d(&zeta_i, re); + invert_ntt_at_layer_2_82(&zeta_i, re); + invert_ntt_at_layer_3_be(&zeta_i, re); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)4U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); + invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); + poly_barrett_reduce_20_0a(re); } /** @@ -8294,14 +8299,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void compute_vector_u_021( +static KRML_MUSTINLINE void compute_vector_u_cc1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 (*a_as_ntt)[3U], libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - result0[i] = ZERO_ef_19();); + result0[i] = ZERO_20_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -8321,11 +8326,11 @@ static KRML_MUSTINLINE void compute_vector_u_021( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(a_element, &r_as_ntt[j]); - add_to_ring_element_ef_3a1(&result0[i1], &product); + ntt_multiply_20_76(a_element, &r_as_ntt[j]); + add_to_ring_element_20_3a1(&result0[i1], &product); } - invert_ntt_montgomery_041(&result0[i1]); - add_error_reduce_ef_15(&result0[i1], &error_1[i1]); + invert_ntt_montgomery_451(&result0[i1]); + add_error_reduce_20_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[3U]; memcpy( @@ -8343,18 +8348,18 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_ring_element_v_c71( +compute_ring_element_v_141( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_ef_3a1(&result, &product);); - invert_ntt_montgomery_041(&result); - result = add_message_error_reduce_ef_f0(error_2, message, result); + ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_20_3a1(&result, &product);); + invert_ntt_montgomery_451(&result); + result = add_message_error_reduce_20_42(error_2, message, result); return result; } @@ -8367,7 +8372,7 @@ with const generics - COMPRESSION_FACTOR= 10 - BLOCK_LEN= 320 */ -static void compress_then_serialize_u_bf1( +static void compress_then_serialize_u_7a1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 input[3U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -8383,7 +8388,7 @@ static void compress_then_serialize_u_bf1( out, i0 * ((size_t)960U / (size_t)3U), (i0 + (size_t)1U) * ((size_t)960U / (size_t)3U), uint8_t); uint8_t ret[320U]; - compress_then_serialize_ring_element_u_ed0(&re, ret); + compress_then_serialize_ring_element_u_030(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); } @@ -8407,7 +8412,7 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_unpacked_0d1(IndCpaPublicKeyUnpacked_f8 *public_key, +static void encrypt_unpacked_ad1(IndCpaPublicKeyUnpacked_f8 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { @@ -8427,7 +8432,7 @@ static void encrypt_unpacked_0d1(IndCpaPublicKeyUnpacked_f8 *public_key, uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); tuple_b00 uu____3 = - sample_ring_element_cbd_721(copy_of_prf_input, domain_separator0); + sample_ring_element_cbd_f91(copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; memcpy( error_1, uu____3.fst, @@ -8441,25 +8446,25 @@ static void encrypt_unpacked_0d1(IndCpaPublicKeyUnpacked_f8 *public_key, sample_from_binomial_distribution_ce( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u[3U]; - compute_vector_u_021(public_key->A, r_as_ntt, error_1, u); + compute_vector_u_cc1(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message_as_ring_element = - deserialize_then_decompress_message_c9(copy_of_message); + deserialize_then_decompress_message_52(copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - compute_ring_element_v_c71(public_key->t_as_ntt, r_as_ntt, &error_2, + compute_ring_element_v_141(public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1088U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____5[3U]; memcpy( uu____5, u, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); - compress_then_serialize_u_bf1( + compress_then_serialize_u_7a1( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)960U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____6 = v; - compress_then_serialize_ring_element_v_de0( + compress_then_serialize_ring_element_v_8f0( uu____6, Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1088U * sizeof(uint8_t)); @@ -8483,10 +8488,10 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static void encrypt_5f(Eurydice_slice public_key, uint8_t message[32U], +static void encrypt_f4(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { - IndCpaPublicKeyUnpacked_f8 unpacked_public_key = default_8d_6b1(); - deserialize_ring_elements_reduced_8b1( + IndCpaPublicKeyUnpacked_f8 unpacked_public_key = default_85_6b1(); + deserialize_ring_elements_reduced_bb1( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -8501,7 +8506,7 @@ static void encrypt_5f(Eurydice_slice public_key, uint8_t message[32U], uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1088U]; - encrypt_unpacked_0d1(uu____1, copy_of_message, randomness, result); + encrypt_unpacked_ad1(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1088U * sizeof(uint8_t)); } @@ -8516,7 +8521,7 @@ with const generics - K= 3 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE void kdf_d8_1a(Eurydice_slice shared_secret, +static KRML_MUSTINLINE void kdf_d8_b2(Eurydice_slice shared_secret, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -8543,11 +8548,11 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -tuple_3c libcrux_ml_kem_ind_cca_encapsulate_13( +tuple_3c libcrux_ml_kem_ind_cca_encapsulate_36( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - entropy_preprocess_d8_b7( + entropy_preprocess_d8_03( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -8557,7 +8562,7 @@ tuple_3c libcrux_ml_kem_ind_cca_encapsulate_13( size_t); uint8_t ret[32U]; H_f1_c61(Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cc1(public_key), + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cf1(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -8571,19 +8576,19 @@ tuple_3c libcrux_ml_kem_ind_cca_encapsulate_13( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cc1(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_cf1(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - encrypt_5f(uu____2, copy_of_randomness, pseudorandomness, ciphertext); + encrypt_f4(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_fc1(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_1f1(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - kdf_d8_1a(shared_secret, shared_secret_array); + kdf_d8_b2(shared_secret, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; @@ -8602,12 +8607,12 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void deserialize_secret_key_e7( +static KRML_MUSTINLINE void deserialize_secret_key_a7( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - secret_as_ntt[i] = ZERO_ef_19();); + secret_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -8619,7 +8624,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_e7( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - deserialize_to_uncompressed_ring_element_0b(secret_bytes); + deserialize_to_uncompressed_ring_element_7a(secret_bytes); secret_as_ntt[i0] = uu____0; } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[3U]; @@ -8639,12 +8644,12 @@ with const generics - CIPHERTEXT_SIZE= 1088 - U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void deserialize_then_decompress_u_7c1( +static KRML_MUSTINLINE void deserialize_then_decompress_u_1e1( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - u_as_ntt[i] = ZERO_ef_19();); + u_as_ntt[i] = ZERO_20_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1088U, ciphertext, uint8_t), @@ -8662,8 +8667,8 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_7c1( LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT * (size_t)10U / (size_t)8U, uint8_t); - u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_170(u_bytes); - ntt_vector_u_2a0(&u_as_ntt[i0]); + u_as_ntt[i0] = deserialize_then_decompress_ring_element_u_9c0(u_bytes); + ntt_vector_u_720(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -8677,17 +8682,17 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -compute_message_b71( +compute_message_7e1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_ef_3a1(&result, &product);); - invert_ntt_montgomery_041(&result); - result = subtract_reduce_ef_1e(v, result); + ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_20_3a1(&result, &product);); + invert_ntt_montgomery_451(&result); + result = subtract_reduce_20_87(v, result); return result; } @@ -8701,18 +8706,18 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_unpacked_ed1(IndCpaPrivateKeyUnpacked_f8 *secret_key, +static void decrypt_unpacked_811(IndCpaPrivateKeyUnpacked_f8 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; - deserialize_then_decompress_u_7c1(ciphertext, u_as_ntt); + deserialize_then_decompress_u_1e1(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - deserialize_then_decompress_ring_element_v_410( + deserialize_then_decompress_ring_element_v_ad0( Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message = - compute_message_b71(&v, secret_key->secret_as_ntt, u_as_ntt); + compute_message_7e1(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - compress_then_serialize_message_2c(message, ret0); + compress_then_serialize_message_4f(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -8726,10 +8731,10 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static void decrypt_1f(Eurydice_slice secret_key, uint8_t *ciphertext, +static void decrypt_41(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; - deserialize_secret_key_e7(secret_key, secret_as_ntt); + deserialize_secret_key_a7(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_f0 copy_of_secret_as_ntt[3U]; memcpy( @@ -8740,7 +8745,7 @@ static void decrypt_1f(Eurydice_slice secret_key, uint8_t *ciphertext, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); uint8_t result[32U]; - decrypt_unpacked_ed1(&secret_key_unpacked, ciphertext, result); + decrypt_unpacked_811(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -8780,7 +8785,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -void libcrux_ml_kem_ind_cca_decapsulate_55( +void libcrux_ml_kem_ind_cca_decapsulate_39( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -8798,7 +8803,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_55( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - decrypt_1f(ind_cpa_secret_key, ciphertext->value, decrypted); + decrypt_41(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( Eurydice_array_to_slice((size_t)32U, decrypted, uint8_t), to_hash0); @@ -8820,7 +8825,7 @@ void libcrux_ml_kem_ind_cca_decapsulate_55( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_471(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_491(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; PRF_f1_9d3(Eurydice_array_to_slice((size_t)1120U, to_hash, uint8_t), @@ -8830,16 +8835,16 @@ void libcrux_ml_kem_ind_cca_decapsulate_55( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - encrypt_5f(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); + encrypt_f4(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - kdf_d8_1a(Eurydice_array_to_slice((size_t)32U, + kdf_d8_b2(Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - kdf_d8_1a(shared_secret0, shared_secret1); + kdf_d8_b2(shared_secret0, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_471(ciphertext), + libcrux_ml_kem_types_as_ref_00_491(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, diff --git a/libcrux-ml-kem/c/libcrux_mlkem_portable.h b/libcrux-ml-kem/c/libcrux_mlkem_portable.h index 626edaff4..148c73ed6 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem_portable_H @@ -312,7 +312,7 @@ uint8_t libcrux_ml_kem_vector_portable_compress_compress_message_coefficient( libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_compress_1( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v); + libcrux_ml_kem_vector_portable_vector_type_PortableVector a); /** This function found in impl {(libcrux_ml_kem::vector::traits::Operations for @@ -320,7 +320,7 @@ libcrux_ml_kem::vector::portable::vector_type::PortableVector)} */ libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_1_0d( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v); + libcrux_ml_kem_vector_portable_vector_type_PortableVector a); uint32_t libcrux_ml_kem_vector_portable_arithmetic_get_n_least_significant_bits( uint8_t n, uint32_t value); diff --git a/libcrux-ml-kem/c/libcrux_sha3.h b/libcrux-ml-kem/c/libcrux_sha3.h index 3ae00514c..7c2339260 100644 --- a/libcrux-ml-kem/c/libcrux_sha3.h +++ b/libcrux-ml-kem/c/libcrux_sha3.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_H diff --git a/libcrux-ml-kem/c/libcrux_sha3_avx2.c b/libcrux-ml-kem/c/libcrux_sha3_avx2.c index 467def628..1ff80c854 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_avx2.c +++ b/libcrux-ml-kem/c/libcrux_sha3_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "internal/libcrux_sha3_avx2.h" @@ -167,16 +167,16 @@ split_at_mut_n_ef(Eurydice_slice a[4U], size_t mid) { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0, TraitClause@1]#1} +N>[TraitClause@0]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_89 +A monomorphic instance of libcrux_sha3.generic_keccak.new_1e with types core_core_arch_x86___m256i with const generics - N= 4 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 -new_89_71(void) { +new_1e_71(void) { libcrux_sha3_generic_keccak_KeccakState_29 lit; lit.st[0U][0U] = zero_ef(); lit.st[0U][1U] = zero_ef(); @@ -1679,7 +1679,7 @@ with const generics */ static KRML_MUSTINLINE void keccak_b9(Eurydice_slice data[4U], Eurydice_slice out[4U]) { - libcrux_sha3_generic_keccak_KeccakState_29 s = new_89_71(); + libcrux_sha3_generic_keccak_KeccakState_29 s = new_1e_71(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -1719,7 +1719,7 @@ static KRML_MUSTINLINE void keccak_b9(Eurydice_slice data[4U], .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1757,7 +1757,7 @@ void libcrux_sha3_avx2_x4_shake256(Eurydice_slice input0, Eurydice_slice input1, */ libcrux_sha3_generic_keccak_KeccakState_29 libcrux_sha3_avx2_x4_incremental_init(void) { - return new_89_71(); + return new_1e_71(); } /** diff --git a/libcrux-ml-kem/c/libcrux_sha3_avx2.h b/libcrux-ml-kem/c/libcrux_sha3_avx2.h index 47d070cdc..4a83c4c39 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/c/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_sha3_internal.h b/libcrux-ml-kem/c/libcrux_sha3_internal.h index 3678325cd..2986801bc 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_internal.h +++ b/libcrux-ml-kem/c/libcrux_sha3_internal.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_internal_H @@ -192,16 +192,16 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_48_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0, TraitClause@1]#1} +N>[TraitClause@0]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_89 +A monomorphic instance of libcrux_sha3.generic_keccak.new_1e with types uint64_t with const generics - N= 1 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 -libcrux_sha3_generic_keccak_new_89_cf(void) { +libcrux_sha3_generic_keccak_new_1e_cf(void) { libcrux_sha3_generic_keccak_KeccakState_48 lit; lit.st[0U][0U] = libcrux_sha3_portable_keccak_zero_5a(); lit.st[0U][1U] = libcrux_sha3_portable_keccak_zero_5a(); @@ -247,7 +247,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_65( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, uu____0); + core_result_unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1465,7 +1465,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_650( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, uu____0); + core_result_unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1740,7 +1740,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)168U; i++) { size_t i0 = i; @@ -1781,7 +1781,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1832,7 +1832,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_653( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, uu____0); + core_result_unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2089,7 +2089,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)104U; i++) { size_t i0 = i; @@ -2130,7 +2130,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2181,7 +2181,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_652( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, uu____0); + core_result_unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2438,7 +2438,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)144U; i++) { size_t i0 = i; @@ -2479,7 +2479,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2627,7 +2627,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2668,7 +2668,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2745,7 +2745,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2786,7 +2786,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2837,7 +2837,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_651( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_26_0e(dst, uu____0); + core_result_unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -3093,7 +3093,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)72U; i++) { size_t i0 = i; @@ -3134,7 +3134,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; diff --git a/libcrux-ml-kem/c/libcrux_sha3_neon.c b/libcrux-ml-kem/c/libcrux_sha3_neon.c index f0331c49a..ebfa2320d 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_neon.c +++ b/libcrux-ml-kem/c/libcrux_sha3_neon.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #include "libcrux_sha3_neon.h" diff --git a/libcrux-ml-kem/c/libcrux_sha3_neon.h b/libcrux-ml-kem/c/libcrux_sha3_neon.h index ec5a84fa2..6756fcc4b 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_neon.h +++ b/libcrux-ml-kem/c/libcrux_sha3_neon.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_neon_H diff --git a/libcrux-ml-kem/cg/code_gen.txt b/libcrux-ml-kem/cg/code_gen.txt index 12d9d454e..21d1a541d 100644 --- a/libcrux-ml-kem/cg/code_gen.txt +++ b/libcrux-ml-kem/cg/code_gen.txt @@ -1,6 +1,6 @@ This code was generated with the following revisions: -Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 -Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac -Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 -F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty -Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 +Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d +Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 +Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 +F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd +Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d diff --git a/libcrux-ml-kem/cg/libcrux_core.h b/libcrux-ml-kem/cg/libcrux_core.h index ad3b32845..a68cda013 100644 --- a/libcrux-ml-kem/cg/libcrux_core.h +++ b/libcrux-ml-kem/cg/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_core_H @@ -97,15 +97,14 @@ typedef struct Result_6f_s { } Result_6f; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[24size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_76(Result_6f self, uint8_t ret[24U]) { +static inline void unwrap_41_76(Result_6f self, uint8_t ret[24U]) { if (self.tag == Ok) { uint8_t f0[24U]; memcpy(f0, self.val.case_Ok, (size_t)24U * sizeof(uint8_t)); @@ -131,15 +130,14 @@ typedef struct Result_7a_s { } Result_7a; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[20size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_ea(Result_7a self, uint8_t ret[20U]) { +static inline void unwrap_41_ea(Result_7a self, uint8_t ret[20U]) { if (self.tag == Ok) { uint8_t f0[20U]; memcpy(f0, self.val.case_Ok, (size_t)20U * sizeof(uint8_t)); @@ -165,15 +163,14 @@ typedef struct Result_cd_s { } Result_cd; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[10size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_07(Result_cd self, uint8_t ret[10U]) { +static inline void unwrap_41_07(Result_cd self, uint8_t ret[10U]) { if (self.tag == Ok) { uint8_t f0[10U]; memcpy(f0, self.val.case_Ok, (size_t)10U * sizeof(uint8_t)); @@ -221,7 +218,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_d4 with const generics - SIZE= 1088 */ -static inline uint8_t *libcrux_ml_kem_types_as_slice_d4_4c( +static inline uint8_t *libcrux_ml_kem_types_as_slice_d4_e2( libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self) { return self->value; } @@ -245,7 +242,7 @@ with const generics - SIZE= 1184 */ static inline libcrux_ml_kem_types_MlKemPublicKey_15 -libcrux_ml_kem_types_from_5a_c6(uint8_t value[1184U]) { +libcrux_ml_kem_types_from_5a_45(uint8_t value[1184U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1184U]; memcpy(copy_of_value, value, (size_t)1184U * sizeof(uint8_t)); @@ -279,7 +276,7 @@ with const generics - PUBLIC_KEY_SIZE= 1184 */ static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_types_from_3a_8d(libcrux_ml_kem_types_MlKemPrivateKey_55 sk, +libcrux_ml_kem_types_from_3a_f6(libcrux_ml_kem_types_MlKemPrivateKey_55 sk, libcrux_ml_kem_types_MlKemPublicKey_15 pk) { return ( CLITERAL(libcrux_ml_kem_mlkem768_MlKem768KeyPair){.sk = sk, .pk = pk}); @@ -295,7 +292,7 @@ with const generics - SIZE= 2400 */ static inline libcrux_ml_kem_types_MlKemPrivateKey_55 -libcrux_ml_kem_types_from_7f_72(uint8_t value[2400U]) { +libcrux_ml_kem_types_from_7f_8c(uint8_t value[2400U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[2400U]; memcpy(copy_of_value, value, (size_t)2400U * sizeof(uint8_t)); @@ -318,15 +315,14 @@ typedef struct Result_00_s { } Result_00; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[32size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_33(Result_00 self, uint8_t ret[32U]) { +static inline void unwrap_41_33(Result_00 self, uint8_t ret[32U]) { if (self.tag == Ok) { uint8_t f0[32U]; memcpy(f0, self.val.case_Ok, (size_t)32U * sizeof(uint8_t)); @@ -359,7 +355,7 @@ with const generics - SIZE= 1088 */ static inline libcrux_ml_kem_mlkem768_MlKem768Ciphertext -libcrux_ml_kem_types_from_01_c4(uint8_t value[1088U]) { +libcrux_ml_kem_types_from_01_6e(uint8_t value[1088U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_value[1088U]; memcpy(copy_of_value, value, (size_t)1088U * sizeof(uint8_t)); @@ -376,7 +372,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_fd with const generics - SIZE= 1184 */ -static inline uint8_t *libcrux_ml_kem_types_as_slice_fd_e0( +static inline uint8_t *libcrux_ml_kem_types_as_slice_fd_0e( libcrux_ml_kem_types_MlKemPublicKey_15 *self) { return self->value; } @@ -428,7 +424,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_00 with const generics - SIZE= 1088 */ -static inline Eurydice_slice libcrux_ml_kem_types_as_ref_00_d9( +static inline Eurydice_slice libcrux_ml_kem_types_as_ref_00_b6( libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self) { return Eurydice_array_to_slice((size_t)1088U, self->value, uint8_t); } @@ -485,15 +481,14 @@ typedef struct Result_c0_s { } Result_c0; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types int16_t[16size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_30(Result_c0 self, int16_t ret[16U]) { +static inline void unwrap_41_30(Result_c0 self, int16_t ret[16U]) { if (self.tag == Ok) { int16_t f0[16U]; memcpy(f0, self.val.case_Ok, (size_t)16U * sizeof(int16_t)); @@ -519,15 +514,14 @@ typedef struct Result_56_s { } Result_56; /** -This function found in impl {core::result::Result[TraitClause@0, -TraitClause@1]} +This function found in impl {core::result::Result} */ /** -A monomorphic instance of core.result.unwrap_26 +A monomorphic instance of core.result.unwrap_41 with types uint8_t[8size_t], core_array_TryFromSliceError */ -static inline void unwrap_26_0e(Result_56 self, uint8_t ret[8U]) { +static inline void unwrap_41_0e(Result_56 self, uint8_t ret[8U]) { if (self.tag == Ok) { uint8_t f0[8U]; memcpy(f0, self.val.case_Ok, (size_t)8U * sizeof(uint8_t)); diff --git a/libcrux-ml-kem/cg/libcrux_ct_ops.h b/libcrux-ml-kem/cg/libcrux_ct_ops.h index f3a831536..525ed90e5 100644 --- a/libcrux-ml-kem/cg/libcrux_ct_ops.h +++ b/libcrux-ml-kem/cg/libcrux_ct_ops.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_ct_ops_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h index 674633a41..d84185894 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_avx2_H @@ -723,7 +723,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_4( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, ret0); + unwrap_41_0e(dst, ret0); memcpy(ret, ret0, (size_t)8U * sizeof(uint8_t)); } @@ -823,7 +823,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_5( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)10U, uint8_t), Eurydice_slice, uint8_t[10U]); - unwrap_26_07(dst, ret0); + unwrap_41_07(dst, ret0); memcpy(ret, ret0, (size_t)10U * sizeof(uint8_t)); } @@ -936,7 +936,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_10( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)20U, uint8_t), Eurydice_slice, uint8_t[20U]); - unwrap_26_ea(dst, ret0); + unwrap_41_ea(dst, ret0); memcpy(ret, ret0, (size_t)20U * sizeof(uint8_t)); } @@ -1081,7 +1081,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_12( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)24U, uint8_t), Eurydice_slice, uint8_t[24U]); - unwrap_26_76(dst, ret0); + unwrap_41_76(dst, ret0); memcpy(ret, ret0, (size_t)24U * sizeof(uint8_t)); } @@ -1196,18 +1196,17 @@ static inline size_t libcrux_ml_kem_vector_avx2_rej_sample_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_ZERO_ef_7d(void) { +libcrux_ml_kem_polynomial_ZERO_20_7d(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_avx2_ZERO_09(); lit.coefficients[1U] = libcrux_ml_kem_vector_avx2_ZERO_09(); @@ -1236,8 +1235,8 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_3a(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); +libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_b0(size_t _) { + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -1248,10 +1247,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_81( +libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_60( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -1269,12 +1268,12 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_06( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_33( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / @@ -1287,7 +1286,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_06( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_81( + libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_60( secret_bytes); secret_as_ntt[i0] = uu____0; } @@ -1310,8 +1309,8 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_56(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); +libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_e9(size_t _) { + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -1322,7 +1321,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_88( +libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e( __m256i vector) { __m256i field_modulus = libcrux_intrinsics_avx2_mm256_set1_epi32( (int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); @@ -1374,9 +1373,9 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline __m256i -libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e6( +libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_75( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_88( + return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e( vector); } @@ -1388,10 +1387,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_10_1c( +libcrux_ml_kem_serialize_deserialize_then_decompress_10_d9( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice((size_t)16U, re.coefficients, __m256i), @@ -1404,7 +1403,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_10_1c( serialized, i0 * (size_t)20U, i0 * (size_t)20U + (size_t)20U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_10_09(bytes); re.coefficients[i0] = - libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e6( + libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_75( coefficient); } return re; @@ -1418,7 +1417,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_880( +libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e0( __m256i vector) { __m256i field_modulus = libcrux_intrinsics_avx2_mm256_set1_epi32( (int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); @@ -1470,9 +1469,9 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline __m256i -libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e60( +libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_750( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_880( + return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e0( vector); } @@ -1484,10 +1483,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_11_6e( +libcrux_ml_kem_serialize_deserialize_then_decompress_11_5d( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -1495,7 +1494,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_11_6e( serialized, i0 * (size_t)22U, i0 * (size_t)22U + (size_t)22U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_11_09(bytes); re.coefficients[i0] = - libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e60( + libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_750( coefficient); } return re; @@ -1509,9 +1508,9 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_f1( +libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_75( Eurydice_slice serialized) { - return libcrux_ml_kem_serialize_deserialize_then_decompress_10_1c(serialized); + return libcrux_ml_kem_serialize_deserialize_then_decompress_10_d9(serialized); } typedef struct libcrux_ml_kem_vector_avx2_SIMD256Vector_x2_s { @@ -1642,17 +1641,16 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_at_layer_1_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -1669,7 +1667,7 @@ with const generics - VECTOR_U_COMPRESSION_FACTOR= 10 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_61( +static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_88( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = (size_t)0U; libcrux_ml_kem_ntt_ntt_at_layer_4_plus_1d(&zeta_i, re, (size_t)7U, @@ -1686,7 +1684,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_61( (size_t)6U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_09(&zeta_i, re, (size_t)1U, (size_t)7U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); } /** @@ -1699,12 +1697,12 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_84( +libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_37( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len( @@ -1724,9 +1722,9 @@ libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_84( (size_t)10U / (size_t)8U, uint8_t); u_as_ntt[i0] = - libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_f1( + libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_75( u_bytes); - libcrux_ml_kem_ntt_ntt_vector_u_61(&u_as_ntt[i0]); + libcrux_ml_kem_ntt_ntt_vector_u_88(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -1741,7 +1739,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_881( +libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e1( __m256i vector) { __m256i field_modulus = libcrux_intrinsics_avx2_mm256_set1_epi32( (int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); @@ -1793,9 +1791,9 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline __m256i -libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e61( +libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_751( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_881( + return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e1( vector); } @@ -1807,10 +1805,10 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_4_44( +libcrux_ml_kem_serialize_deserialize_then_decompress_4_2e( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -1818,7 +1816,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_4_44( serialized, i0 * (size_t)8U, i0 * (size_t)8U + (size_t)8U, uint8_t); __m256i coefficient = libcrux_ml_kem_vector_avx2_deserialize_4_09(bytes); re.coefficients[i0] = - libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e61( + libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_751( coefficient); } return re; @@ -1832,7 +1830,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_882( +libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e2( __m256i vector) { __m256i field_modulus = libcrux_intrinsics_avx2_mm256_set1_epi32( (int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); @@ -1884,9 +1882,9 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline __m256i -libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e62( +libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_752( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_882( + return libcrux_ml_kem_vector_avx2_compress_decompress_ciphertext_coefficient_3e2( vector); } @@ -1898,10 +1896,10 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_5_c7( +libcrux_ml_kem_serialize_deserialize_then_decompress_5_d5( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -1909,7 +1907,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_5_c7( serialized, i0 * (size_t)10U, i0 * (size_t)10U + (size_t)10U, uint8_t); re.coefficients[i0] = libcrux_ml_kem_vector_avx2_deserialize_5_09(bytes); re.coefficients[i0] = - libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_e62( + libcrux_ml_kem_vector_avx2_decompress_ciphertext_coefficient_09_752( re.coefficients[i0]); } return re; @@ -1923,29 +1921,28 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_da( +libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_51( Eurydice_slice serialized) { - return libcrux_ml_kem_serialize_deserialize_then_decompress_4_44(serialized); + return libcrux_ml_kem_serialize_deserialize_then_decompress_4_2e(serialized); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_ntt_multiply_ef_63( +libcrux_ml_kem_polynomial_ntt_multiply_20_63( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -1964,17 +1961,16 @@ libcrux_ml_kem_polynomial_ntt_multiply_ef_63( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_ef_31( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_20_31( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -1995,7 +1991,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_02( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_ee( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -2019,7 +2015,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_28( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_9c( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -2041,7 +2037,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_b8( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_2f( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -2062,7 +2058,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_vector_avx2_SIMD256Vector_x2 -libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_60(__m256i a, +libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_e3(__m256i a, __m256i b, int16_t zeta_r) { __m256i a_minus_b = libcrux_ml_kem_vector_avx2_sub_09(b, &a); @@ -2081,7 +2077,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19( +libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, size_t layer) { size_t step = (size_t)1U << (uint32_t)layer; @@ -2096,7 +2092,7 @@ libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19( for (size_t i = offset_vec; i < offset_vec + step_vec; i++) { size_t j = i; libcrux_ml_kem_vector_avx2_SIMD256Vector_x2 uu____0 = - libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_60( + libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_e3( re->coefficients[j], re->coefficients[j + step_vec], libcrux_ml_kem_polynomial_get_zeta(zeta_i[0U])); __m256i x = uu____0.fst; @@ -2114,38 +2110,37 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_b2( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_02(&zeta_i, re, (size_t)1U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_28(&zeta_i, re, (size_t)2U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_b8(&zeta_i, re, (size_t)3U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_ee(&zeta_i, re, (size_t)1U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_9c(&zeta_i, re, (size_t)2U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_2f(&zeta_i, re, (size_t)3U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c(&zeta_i, re, (size_t)4U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c(&zeta_i, re, (size_t)5U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c(&zeta_i, re, (size_t)6U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_19(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c(&zeta_i, re, (size_t)7U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_subtract_reduce_ef_70( +libcrux_ml_kem_polynomial_subtract_reduce_20_6f( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 b) { for (size_t i = (size_t)0U; @@ -2169,21 +2164,21 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_matrix_compute_message_52( +libcrux_ml_kem_matrix_compute_message_74( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_63(&secret_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result, &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_b2(&result); - result = libcrux_ml_kem_polynomial_subtract_reduce_ef_70(v, result); + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result); + result = libcrux_ml_kem_polynomial_subtract_reduce_20_6f(v, result); return result; } @@ -2194,7 +2189,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_arithmetic_shift_right_aa(__m256i vector) { +libcrux_ml_kem_vector_avx2_arithmetic_shift_right_d4(__m256i vector) { return libcrux_intrinsics_avx2_mm256_srai_epi16((int32_t)15, vector, __m256i); } @@ -2208,9 +2203,9 @@ with const generics - SHIFT_BY= 15 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_avx2_shift_right_09_dc( +static inline __m256i libcrux_ml_kem_vector_avx2_shift_right_09_16( __m256i vector) { - return libcrux_ml_kem_vector_avx2_arithmetic_shift_right_aa(vector); + return libcrux_ml_kem_vector_avx2_arithmetic_shift_right_d4(vector); } /** @@ -2222,12 +2217,24 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline __m256i libcrux_ml_kem_vector_traits_to_unsigned_representative_b5(__m256i a) { - __m256i t = libcrux_ml_kem_vector_avx2_shift_right_09_dc(a); + __m256i t = libcrux_ml_kem_vector_avx2_shift_right_09_16(a); __m256i fm = libcrux_ml_kem_vector_avx2_bitwise_and_with_constant_09( t, LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); return libcrux_ml_kem_vector_avx2_add_09(a, &fm); } +/** +A monomorphic instance of libcrux_ml_kem.serialize.to_unsigned_field_modulus +with types libcrux_ml_kem_vector_avx2_SIMD256Vector +with const generics + +*/ +KRML_ATTRIBUTE_TARGET("avx2") +static KRML_MUSTINLINE __m256i +libcrux_ml_kem_serialize_to_unsigned_field_modulus_88(__m256i a) { + return libcrux_ml_kem_vector_traits_to_unsigned_representative_b5(a); +} + /** A monomorphic instance of libcrux_ml_kem.serialize.compress_then_serialize_message with types @@ -2236,14 +2243,13 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_message_da( +libcrux_ml_kem_serialize_compress_then_serialize_message_bc( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, uint8_t ret[32U]) { uint8_t serialized[32U] = {0U}; for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; - __m256i coefficient = - libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( - re.coefficients[i0]); + __m256i coefficient = libcrux_ml_kem_serialize_to_unsigned_field_modulus_88( + re.coefficients[i0]); __m256i coefficient_compressed = libcrux_ml_kem_vector_avx2_compress_1_09(coefficient); uint8_t bytes[2U]; @@ -2253,7 +2259,9 @@ libcrux_ml_kem_serialize_compress_then_serialize_message_da( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)2U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)32U * sizeof(uint8_t)); + uint8_t result[32U]; + memcpy(result, serialized, (size_t)32U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } /** @@ -2267,20 +2275,20 @@ with const generics - V_COMPRESSION_FACTOR= 4 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cpa_decrypt_unpacked_88( +static inline void libcrux_ml_kem_ind_cpa_decrypt_unpacked_69( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; - libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_84(ciphertext, u_as_ntt); + libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_37(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_da( + libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_51( Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message = - libcrux_ml_kem_matrix_compute_message_52(&v, secret_key->secret_as_ntt, + libcrux_ml_kem_matrix_compute_message_74(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - libcrux_ml_kem_serialize_compress_then_serialize_message_da(message, ret0); + libcrux_ml_kem_serialize_compress_then_serialize_message_bc(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -2295,11 +2303,11 @@ with const generics - V_COMPRESSION_FACTOR= 4 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cpa_decrypt_b7(Eurydice_slice secret_key, +static inline void libcrux_ml_kem_ind_cpa_decrypt_2a(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; - libcrux_ml_kem_ind_cpa_deserialize_secret_key_06(secret_key, secret_as_ntt); + libcrux_ml_kem_ind_cpa_deserialize_secret_key_33(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_d2 copy_of_secret_as_ntt[3U]; memcpy( @@ -2311,7 +2319,7 @@ static inline void libcrux_ml_kem_ind_cpa_decrypt_b7(Eurydice_slice secret_key, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); uint8_t result[32U]; - libcrux_ml_kem_ind_cpa_decrypt_unpacked_88(&secret_key_unpacked, ciphertext, + libcrux_ml_kem_ind_cpa_decrypt_unpacked_69(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -2364,20 +2372,20 @@ static KRML_MUSTINLINE void libcrux_ml_kem_hash_functions_avx2_PRF_a9_42( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_85_80(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - uu____0[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + uu____0[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } uint8_t uu____1[32U] = {0U}; libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 lit; @@ -2385,15 +2393,15 @@ libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(void) { lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); return lit; } @@ -2405,10 +2413,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_26( +libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_5a( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2429,7 +2437,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_4f( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -2443,7 +2451,7 @@ libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_4f( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_26( + libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_5a( ring_element); deserialized_pk[i0] = uu____0; } @@ -2764,20 +2772,19 @@ libcrux_ml_kem_sampling_sample_from_uniform_distribution_next_740( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_from_i16_array_ef_14(Eurydice_slice a) { +libcrux_ml_kem_polynomial_from_i16_array_20_14(Eurydice_slice a) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -2797,7 +2804,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_sampling_sample_from_xof_closure_e4(int16_t s[272U]) { - return libcrux_ml_kem_polynomial_from_i16_array_ef_14( + return libcrux_ml_kem_polynomial_from_i16_array_20_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -2925,7 +2932,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_closure_2d(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -3022,7 +3029,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_2_80( sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_ef_14( + return libcrux_ml_kem_polynomial_from_i16_array_20_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3068,7 +3075,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_3_05( sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_ef_14( + return libcrux_ml_kem_polynomial_from_i16_array_20_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3131,7 +3138,7 @@ libcrux_ml_kem_ntt_ntt_binomially_sampled_ring_element_5c( &zeta_i, re, (size_t)2U, (size_t)11207U + (size_t)4U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_09( &zeta_i, re, (size_t)1U, (size_t)11207U + (size_t)5U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); } /** @@ -3185,7 +3192,7 @@ libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_d7( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; @@ -3215,8 +3222,8 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_d4(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); +libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_93(size_t _i) { + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -3229,11 +3236,11 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE tuple_b00 -libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_8c(uint8_t prf_input[33U], +libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_66(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - error_1[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + error_1[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; @@ -3307,23 +3314,22 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_matrix_compute_vector_u_closure_4e(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); +libcrux_ml_kem_matrix_compute_vector_u_closure_83(size_t _i) { + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_ef_cf( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_20_9e( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -3345,14 +3351,14 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_52( +static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_38( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 (*a_as_ntt)[3U], libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - result0[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + result0[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( @@ -3373,12 +3379,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_52( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_63(a_element, &r_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result0[i1], + libcrux_ml_kem_polynomial_ntt_multiply_20_63(a_element, &r_as_ntt[j]); + libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result0[i1], &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_b2(&result0[i1]); - libcrux_ml_kem_polynomial_add_error_reduce_ef_cf(&result0[i1], + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result0[i1]); + libcrux_ml_kem_polynomial_add_error_reduce_20_9e(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[3U]; @@ -3397,7 +3403,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_traits_decompress_1_28( +static inline __m256i libcrux_ml_kem_vector_traits_decompress_1_fd( __m256i vec) { __m256i z = libcrux_ml_kem_vector_avx2_ZERO_09(); __m256i s = libcrux_ml_kem_vector_avx2_sub_09(z, &vec); @@ -3413,10 +3419,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_then_decompress_message_b0( +libcrux_ml_kem_serialize_deserialize_then_decompress_message_03( uint8_t serialized[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; __m256i coefficient_compressed = @@ -3424,25 +3430,24 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_message_b0( Eurydice_array_to_subslice2(serialized, (size_t)2U * i0, (size_t)2U * i0 + (size_t)2U, uint8_t)); re.coefficients[i0] = - libcrux_ml_kem_vector_traits_decompress_1_28(coefficient_compressed); + libcrux_ml_kem_vector_traits_decompress_1_fd(coefficient_compressed); } return re; } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_add_message_error_reduce_ef_62( +libcrux_ml_kem_polynomial_add_message_error_reduce_20_c6( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result) { @@ -3470,22 +3475,22 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_matrix_compute_ring_element_v_c3( +libcrux_ml_kem_matrix_compute_ring_element_v_af( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_63(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result, &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_b2(&result); - result = libcrux_ml_kem_polynomial_add_message_error_reduce_ef_62( + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result); + result = libcrux_ml_kem_polynomial_add_message_error_reduce_20_c6( error_2, message, result); return result; } @@ -3498,7 +3503,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf( +libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f( __m256i vector) { __m256i field_modulus_halved = libcrux_intrinsics_avx2_mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / @@ -3553,9 +3558,9 @@ with const generics - COEFFICIENT_BITS= 10 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_dc( +static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_b7( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf( + return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f( vector); } @@ -3567,14 +3572,14 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_10_2b( +libcrux_ml_kem_serialize_compress_then_serialize_10_33( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_dc( - libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( + __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_b7( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_88( re->coefficients[i0])); uint8_t bytes[20U]; libcrux_ml_kem_vector_avx2_serialize_10_09(coefficient, bytes); @@ -3583,7 +3588,9 @@ libcrux_ml_kem_serialize_compress_then_serialize_10_2b( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)20U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)320U * sizeof(uint8_t)); + uint8_t result[320U]; + memcpy(result, serialized, (size_t)320U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)320U * sizeof(uint8_t)); } /** @@ -3594,7 +3601,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf0( +libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f0( __m256i vector) { __m256i field_modulus_halved = libcrux_intrinsics_avx2_mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / @@ -3649,9 +3656,9 @@ with const generics - COEFFICIENT_BITS= 11 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_dc0( +static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_b70( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf0( + return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f0( vector); } @@ -3663,13 +3670,13 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_11_86( +libcrux_ml_kem_serialize_compress_then_serialize_11_5d( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_dc0( + __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_b70( libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( re->coefficients[i0])); uint8_t bytes[22U]; @@ -3691,10 +3698,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_4d( +libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_25( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[320U]) { uint8_t uu____0[320U]; - libcrux_ml_kem_serialize_compress_then_serialize_10_2b(re, uu____0); + libcrux_ml_kem_serialize_compress_then_serialize_10_33(re, uu____0); memcpy(ret, uu____0, (size_t)320U * sizeof(uint8_t)); } @@ -3708,7 +3715,7 @@ with const generics - BLOCK_LEN= 320 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_83( +static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_98( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 input[3U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -3724,7 +3731,7 @@ static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_83( out, i0 * ((size_t)960U / (size_t)3U), (i0 + (size_t)1U) * ((size_t)960U / (size_t)3U), uint8_t); uint8_t ret[320U]; - libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_4d(&re, + libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_25(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); @@ -3739,7 +3746,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf1( +libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f1( __m256i vector) { __m256i field_modulus_halved = libcrux_intrinsics_avx2_mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / @@ -3794,9 +3801,9 @@ with const generics - COEFFICIENT_BITS= 4 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_dc1( +static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_b71( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf1( + return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f1( vector); } @@ -3808,16 +3815,14 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_4_fd( +libcrux_ml_kem_serialize_compress_then_serialize_4_7a( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_dc1( - libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( + __m256i coefficient = libcrux_ml_kem_vector_avx2_compress_09_b71( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_88( re.coefficients[i0])); uint8_t bytes[8U]; libcrux_ml_kem_vector_avx2_serialize_4_09(coefficient, bytes); @@ -3836,7 +3841,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE __m256i -libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf2( +libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f2( __m256i vector) { __m256i field_modulus_halved = libcrux_intrinsics_avx2_mm256_set1_epi32( ((int32_t)LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS - (int32_t)1) / @@ -3891,9 +3896,9 @@ with const generics - COEFFICIENT_BITS= 5 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_dc2( +static inline __m256i libcrux_ml_kem_vector_avx2_compress_09_b72( __m256i vector) { - return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_bf2( + return libcrux_ml_kem_vector_avx2_compress_compress_ciphertext_coefficient_8f2( vector); } @@ -3905,15 +3910,13 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_5_60( +libcrux_ml_kem_serialize_compress_then_serialize_5_15( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficients = libcrux_ml_kem_vector_avx2_compress_09_dc2( + __m256i coefficients = libcrux_ml_kem_vector_avx2_compress_09_b72( libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( re.coefficients[i0])); uint8_t bytes[10U]; @@ -3934,9 +3937,9 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_3c( +libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_dc( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re, Eurydice_slice out) { - libcrux_ml_kem_serialize_compress_then_serialize_4_fd(re, out); + libcrux_ml_kem_serialize_compress_then_serialize_4_7a(re, out); } /** @@ -3957,7 +3960,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_25( +static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_7b( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { uint8_t prf_input[33U]; @@ -3975,7 +3978,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_25( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); - tuple_b00 uu____3 = libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_8c( + tuple_b00 uu____3 = libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_66( copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; memcpy( @@ -3990,27 +3993,27 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_25( libcrux_ml_kem_sampling_sample_from_binomial_distribution_73( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u[3U]; - libcrux_ml_kem_matrix_compute_vector_u_52(public_key->A, r_as_ntt, error_1, + libcrux_ml_kem_matrix_compute_vector_u_38(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 message_as_ring_element = - libcrux_ml_kem_serialize_deserialize_then_decompress_message_b0( + libcrux_ml_kem_serialize_deserialize_then_decompress_message_03( copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 v = - libcrux_ml_kem_matrix_compute_ring_element_v_c3( + libcrux_ml_kem_matrix_compute_ring_element_v_af( public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1088U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____5[3U]; memcpy( uu____5, u, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); - libcrux_ml_kem_ind_cpa_compress_then_serialize_u_83( + libcrux_ml_kem_ind_cpa_compress_then_serialize_u_98( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)960U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____6 = v; - libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_3c( + libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_dc( uu____6, Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1088U * sizeof(uint8_t)); @@ -4034,13 +4037,13 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cpa_encrypt_88(Eurydice_slice public_key, +static inline void libcrux_ml_kem_ind_cpa_encrypt_65(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 - unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_4f( + unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -4056,7 +4059,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_88(Eurydice_slice public_key, uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_25(uu____1, copy_of_message, + libcrux_ml_kem_ind_cpa_encrypt_unpacked_7b(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1088U * sizeof(uint8_t)); } @@ -4073,7 +4076,7 @@ with const generics - CIPHERTEXT_SIZE= 1088 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_d8_5a( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_d8_54( Eurydice_slice shared_secret, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; @@ -4105,7 +4108,7 @@ with const generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_decapsulate_c5( +static inline void libcrux_ml_kem_ind_cca_decapsulate_82( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -4123,7 +4126,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c5( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_b7(ind_cpa_secret_key, ciphertext->value, + libcrux_ml_kem_ind_cpa_decrypt_2a(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -4147,7 +4150,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c5( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; libcrux_ml_kem_hash_functions_avx2_PRF_a9_42( @@ -4158,18 +4161,18 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c5( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_88(uu____5, copy_of_decrypted, + libcrux_ml_kem_ind_cpa_encrypt_65(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - libcrux_ml_kem_variant_kdf_d8_5a( + libcrux_ml_kem_variant_kdf_d8_54( Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), ciphertext, implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - libcrux_ml_kem_variant_kdf_d8_5a(shared_secret0, ciphertext, shared_secret1); + libcrux_ml_kem_variant_kdf_d8_54(shared_secret0, ciphertext, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -4199,10 +4202,10 @@ with const generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_instantiations_avx2_decapsulate_0d( +static inline void libcrux_ml_kem_ind_cca_instantiations_avx2_decapsulate_63( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_c5(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_82(private_key, ciphertext, ret); } /** @@ -4216,7 +4219,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_mlkem768_avx2_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_avx2_decapsulate_0d(private_key, + libcrux_ml_kem_ind_cca_instantiations_avx2_decapsulate_63(private_key, ciphertext, ret); } @@ -4231,7 +4234,7 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_d8_7b( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_d8_44( Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -4274,11 +4277,11 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_02( +static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_86( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - libcrux_ml_kem_variant_entropy_preprocess_d8_7b( + libcrux_ml_kem_variant_entropy_preprocess_d8_44( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -4289,7 +4292,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_02( uint8_t ret[32U]; libcrux_ml_kem_hash_functions_avx2_H_a9_16( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -4304,20 +4307,20 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_02( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_e0(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_88(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_65(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - libcrux_ml_kem_variant_kdf_d8_5a(shared_secret, &ciphertext0, + libcrux_ml_kem_variant_kdf_d8_54(shared_secret, &ciphertext0, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ @@ -4350,14 +4353,14 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_avx2_encapsulate_ad( +libcrux_ml_kem_ind_cca_instantiations_avx2_encapsulate_c5( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_02(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_86(uu____0, copy_of_randomness); } /** @@ -4375,28 +4378,28 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_avx2_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_avx2_encapsulate_ad( + return libcrux_ml_kem_ind_cca_instantiations_avx2_encapsulate_c5( uu____0, copy_of_randomness); } /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(void) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 lit; - lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); - lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); return lit; } @@ -4411,7 +4414,7 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_d8_7e( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_d8_0e( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -4442,18 +4445,17 @@ static inline __m256i libcrux_ml_kem_vector_traits_to_standard_domain_c1( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_ba( +libcrux_ml_kem_polynomial_add_standard_error_reduce_20_ba( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -4490,7 +4492,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_67( size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_polynomial_ZERO_ef_7d(); + libcrux_ml_kem_polynomial_ZERO_20_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -4503,12 +4505,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_67( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_63(matrix_element, + libcrux_ml_kem_polynomial_ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&t_as_ntt[i0], &product); } - libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_ba( + libcrux_ml_kem_polynomial_add_standard_error_reduce_20_ba( &t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -4528,7 +4530,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 *private_key, libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 *public_key) { uint8_t hashed[64U]; - libcrux_ml_kem_variant_cpa_keygen_seed_d8_7e(key_generation_seed, hashed); + libcrux_ml_kem_variant_cpa_keygen_seed_d8_0e(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -4566,7 +4568,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____5); + unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -4578,15 +4580,14 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_88( +libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_b8( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *re, uint8_t ret[384U]) { uint8_t serialized[384U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; - __m256i coefficient = - libcrux_ml_kem_vector_traits_to_unsigned_representative_b5( - re->coefficients[i0]); + __m256i coefficient = libcrux_ml_kem_serialize_to_unsigned_field_modulus_88( + re->coefficients[i0]); uint8_t bytes[24U]; libcrux_ml_kem_vector_avx2_serialize_12_09(coefficient, bytes); Eurydice_slice uu____0 = Eurydice_array_to_subslice2( @@ -4594,7 +4595,9 @@ libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_88( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)24U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)384U * sizeof(uint8_t)); + uint8_t result[384U]; + memcpy(result, serialized, (size_t)384U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)384U * sizeof(uint8_t)); } /** @@ -4605,7 +4608,7 @@ with const generics - OUT_LEN= 1152 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_72( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_05( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *key, uint8_t ret[1152U]) { uint8_t out[1152U] = {0U}; @@ -4623,7 +4626,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_72( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_88(&re, ret0); + libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_b8(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -4639,13 +4642,13 @@ with const generics - PUBLIC_KEY_SIZE= 1184 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_mut_82( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_mut_7b( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1152U, uint8_t); uint8_t ret[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_72(t_as_ntt, ret); + libcrux_ml_kem_ind_cpa_serialize_secret_key_05(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1152U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -4663,11 +4666,11 @@ with const generics - PUBLIC_KEY_SIZE= 1184 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_39( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_f7( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1184U]) { uint8_t public_key_serialized[1184U] = {0U}; - libcrux_ml_kem_ind_cpa_serialize_public_key_mut_82(t_as_ntt, seed_for_a, + libcrux_ml_kem_ind_cpa_serialize_public_key_mut_7b(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1184U]; memcpy(result, public_key_serialized, (size_t)1184U * sizeof(uint8_t)); @@ -4688,20 +4691,20 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 -libcrux_ml_kem_ind_cpa_generate_keypair_1c(Eurydice_slice key_generation_seed) { +libcrux_ml_kem_ind_cpa_generate_keypair_1e(Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); + libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); + libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_39( + libcrux_ml_kem_ind_cpa_serialize_public_key_f7( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_72(private_key.secret_as_ntt, + libcrux_ml_kem_ind_cpa_serialize_secret_key_05(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; @@ -4727,7 +4730,7 @@ with const generics - SERIALIZED_KEY_LEN= 2400 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cca_serialize_kem_secret_key_28( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cca_serialize_kem_secret_key_7b( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[2400U]) { uint8_t out[2400U] = {0U}; @@ -4784,7 +4787,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_dd(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -4793,13 +4796,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - libcrux_ml_kem_ind_cpa_generate_keypair_1c(ind_cpa_keypair_randomness); + libcrux_ml_kem_ind_cpa_generate_keypair_1e(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - libcrux_ml_kem_ind_cca_serialize_kem_secret_key_28( + libcrux_ml_kem_ind_cca_serialize_kem_secret_key_7b( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -4808,13 +4811,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -4830,12 +4833,12 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.generate_keypair with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_instantiations_avx2_generate_keypair_96( +libcrux_ml_kem_ind_cca_instantiations_avx2_generate_keypair_ff( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_2a(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_dd(copy_of_randomness); } /** @@ -4847,7 +4850,7 @@ libcrux_ml_kem_mlkem768_avx2_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_avx2_generate_keypair_96( + return libcrux_ml_kem_ind_cca_instantiations_avx2_generate_keypair_ff( copy_of_randomness); } @@ -4863,7 +4866,7 @@ with const generics - CIPHERTEXT_SIZE= 1088 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_08( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_42( Eurydice_slice shared_secret, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { uint8_t kdf_input[64U]; @@ -4874,7 +4877,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_08( uint8_t ret0[32U]; libcrux_ml_kem_hash_functions_avx2_H_a9_16( Eurydice_array_to_slice((size_t)1088U, - libcrux_ml_kem_types_as_slice_d4_4c(ciphertext), + libcrux_ml_kem_types_as_slice_d4_e2(ciphertext), uint8_t), ret0); Eurydice_slice_copy( @@ -4908,7 +4911,7 @@ with const generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_decapsulate_c50( +static inline void libcrux_ml_kem_ind_cca_decapsulate_820( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -4926,7 +4929,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c50( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_b7(ind_cpa_secret_key, ciphertext->value, + libcrux_ml_kem_ind_cpa_decrypt_2a(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -4950,7 +4953,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c50( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; libcrux_ml_kem_hash_functions_avx2_PRF_a9_42( @@ -4961,18 +4964,18 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_c50( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_88(uu____5, copy_of_decrypted, + libcrux_ml_kem_ind_cpa_encrypt_65(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - libcrux_ml_kem_variant_kdf_33_08( + libcrux_ml_kem_variant_kdf_33_42( Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), ciphertext, implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - libcrux_ml_kem_variant_kdf_33_08(shared_secret0, ciphertext, shared_secret1); + libcrux_ml_kem_variant_kdf_33_42(shared_secret0, ciphertext, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -5006,10 +5009,10 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.kyber_decapsulate with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline void -libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_decapsulate_9f( +libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_decapsulate_0b( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_c50(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_820(private_key, ciphertext, ret); } /** @@ -5023,7 +5026,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_mlkem768_avx2_kyber_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_decapsulate_9f( + libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_decapsulate_0b( private_key, ciphertext, ret); } @@ -5038,7 +5041,7 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_33_44( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_33_ad( Eurydice_slice randomness, uint8_t ret[32U]) { libcrux_ml_kem_hash_functions_avx2_H_a9_16(randomness, ret); } @@ -5063,11 +5066,11 @@ with const generics - ETA2_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_020( +static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_860( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - libcrux_ml_kem_variant_entropy_preprocess_33_44( + libcrux_ml_kem_variant_entropy_preprocess_33_ad( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5078,7 +5081,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_020( uint8_t ret[32U]; libcrux_ml_kem_hash_functions_avx2_H_a9_16( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -5093,20 +5096,20 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_020( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_e0(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_88(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_65(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - libcrux_ml_kem_variant_kdf_33_08(shared_secret, &ciphertext0, + libcrux_ml_kem_variant_kdf_33_42(shared_secret, &ciphertext0, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ @@ -5142,14 +5145,14 @@ libcrux_ml_kem.ind_cca.instantiations.avx2.kyber_encapsulate with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_encapsulate_e1( +libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_encapsulate_e7( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_020(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_860(uu____0, copy_of_randomness); } /** @@ -5167,7 +5170,7 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_avx2_kyber_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_encapsulate_e1( + return libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_encapsulate_e7( uu____0, copy_of_randomness); } @@ -5182,7 +5185,7 @@ with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_33_63( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_33_08( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { libcrux_ml_kem_hash_functions_avx2_G_a9_67(key_generation_seed, ret); } @@ -5202,7 +5205,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a0( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 *private_key, libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 *public_key) { uint8_t hashed[64U]; - libcrux_ml_kem_variant_cpa_keygen_seed_33_63(key_generation_seed, hashed); + libcrux_ml_kem_variant_cpa_keygen_seed_33_08(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -5240,7 +5243,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a0( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____5); + unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5258,21 +5261,21 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 -libcrux_ml_kem_ind_cpa_generate_keypair_1c0( +libcrux_ml_kem_ind_cpa_generate_keypair_1e0( Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); + libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); + libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a0( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_39( + libcrux_ml_kem_ind_cpa_serialize_public_key_f7( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_72(private_key.secret_as_ntt, + libcrux_ml_kem_ind_cpa_serialize_secret_key_05(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; @@ -5305,7 +5308,7 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_dd0(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -5314,13 +5317,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - libcrux_ml_kem_ind_cpa_generate_keypair_1c0(ind_cpa_keypair_randomness); + libcrux_ml_kem_ind_cpa_generate_keypair_1e0(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - libcrux_ml_kem_ind_cca_serialize_kem_secret_key_28( + libcrux_ml_kem_ind_cca_serialize_kem_secret_key_7b( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -5329,13 +5332,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_2a0(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -5352,12 +5355,12 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_generate_keypair_0a( +libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_generate_keypair_b1( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_2a0(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_dd0(copy_of_randomness); } /** @@ -5369,7 +5372,7 @@ libcrux_ml_kem_mlkem768_avx2_kyber_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_generate_keypair_0a( + return libcrux_ml_kem_ind_cca_instantiations_avx2_kyber_generate_keypair_b1( copy_of_randomness); } @@ -5382,7 +5385,7 @@ with const generics - CIPHERTEXT_SIZE= 1088 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_private_key_5e( +static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_private_key_e9( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext) { uint8_t t[32U]; @@ -5408,10 +5411,10 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE bool -libcrux_ml_kem_ind_cca_instantiations_avx2_validate_private_key_72( +libcrux_ml_kem_ind_cca_instantiations_avx2_validate_private_key_cf( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_5e(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_e9(private_key, ciphertext); } @@ -5424,7 +5427,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline bool libcrux_ml_kem_mlkem768_avx2_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_instantiations_avx2_validate_private_key_72( + return libcrux_ml_kem_ind_cca_instantiations_avx2_validate_private_key_cf( private_key, ciphertext); } @@ -5436,9 +5439,9 @@ types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_a7( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_3d( size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -5449,14 +5452,14 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_40( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_d1( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_4f( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -5472,16 +5475,16 @@ with const generics - PUBLIC_KEY_SIZE= 1184 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_public_key_c9( +static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_public_key_eb( uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_40( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_d1( Eurydice_array_to_subslice_to((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_39( + libcrux_ml_kem_ind_cpa_serialize_public_key_f7( uu____0, Eurydice_array_to_subslice_from((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), @@ -5500,9 +5503,9 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE bool -libcrux_ml_kem_ind_cca_instantiations_avx2_validate_public_key_fc( +libcrux_ml_kem_ind_cca_instantiations_avx2_validate_public_key_91( uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_c9(public_key); + return libcrux_ml_kem_ind_cca_validate_public_key_eb(public_key); } /** @@ -5513,7 +5516,7 @@ libcrux_ml_kem_ind_cca_instantiations_avx2_validate_public_key_fc( KRML_ATTRIBUTE_TARGET("avx2") static inline bool libcrux_ml_kem_mlkem768_avx2_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key) { - return libcrux_ml_kem_ind_cca_instantiations_avx2_validate_public_key_fc( + return libcrux_ml_kem_ind_cca_instantiations_avx2_validate_public_key_91( public_key->value); } @@ -5539,11 +5542,11 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_c2( +static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_64( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_unpacked_88( + libcrux_ml_kem_ind_cpa_decrypt_unpacked_69( &key_pair->private_key.ind_cpa_private_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5573,7 +5576,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_c2( Eurydice_slice uu____2 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____2, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____2, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret[32U]; libcrux_ml_kem_hash_functions_avx2_PRF_a9_42( @@ -5585,11 +5588,11 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_c2( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_25( + libcrux_ml_kem_ind_cpa_encrypt_unpacked_7b( uu____3, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t selector = libcrux_ml_kem_constant_time_ops_compare_ciphertexts_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t)); uint8_t ret0[32U]; libcrux_ml_kem_constant_time_ops_select_shared_secret_in_constant_time( @@ -5626,10 +5629,10 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline void -libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_decapsulate_0c( +libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_decapsulate_31( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_unpacked_decapsulate_c2(key_pair, ciphertext, ret); + libcrux_ml_kem_ind_cca_unpacked_decapsulate_64(key_pair, ciphertext, ret); } /** @@ -5643,7 +5646,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_decapsulate( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_decapsulate_0c( + libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_decapsulate_31( private_key, ciphertext, ret); } @@ -5666,7 +5669,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics - ETA2_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_e2( +static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_1d( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *public_key, uint8_t randomness[32U]) { uint8_t to_hash[64U]; @@ -5694,7 +5697,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_e2( uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_25(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_unpacked_7b(uu____2, copy_of_randomness, pseudorandomness, ciphertext); uint8_t shared_secret_array[32U] = {0U}; Eurydice_slice_copy( @@ -5704,7 +5707,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_e2( uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; memcpy(copy_of_shared_secret_array, shared_secret_array, @@ -5738,7 +5741,7 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_encapsulate_5c( +libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_encapsulate_ab( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *uu____0 = @@ -5746,7 +5749,7 @@ libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_encapsulate_5c( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_unpacked_encapsulate_e2(uu____0, + return libcrux_ml_kem_ind_cca_unpacked_encapsulate_1d(uu____0, copy_of_randomness); } @@ -5767,7 +5770,7 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_avx2_unpacked_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_encapsulate_5c( + return libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_encapsulate_ab( uu____0, copy_of_randomness); } @@ -5787,8 +5790,8 @@ with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_b0(size_t _j) { - return libcrux_ml_kem_polynomial_ZERO_ef_7d(); +libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_b2(size_t _j) { + return libcrux_ml_kem_polynomial_ZERO_20_7d(); } /** @@ -5806,27 +5809,26 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_81( +static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_64( size_t _i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - ret[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + ret[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); } } /** This function found in impl {(core::clone::Clone for -libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@2])} +libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.clone_8d +A monomorphic instance of libcrux_ml_kem.polynomial.clone_3a with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_clone_8d_c2( +libcrux_ml_kem_polynomial_clone_3a_d3( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; __m256i ret[16U]; @@ -5853,7 +5855,7 @@ with const generics - ETA1_RANDOMNESS_SIZE= 128 */ KRML_ATTRIBUTE_TARGET("avx2") -static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_15( +static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_98( uint8_t randomness[64U], libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *out) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( @@ -5868,14 +5870,14 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_15( &out->public_key.ind_cpa_public_key); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 A[3U][3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_81(i, A[i]); + libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_64(i, A[i]); } for (size_t i0 = (size_t)0U; i0 < (size_t)3U; i0++) { size_t i1 = i0; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_polynomial_clone_8d_c2( + libcrux_ml_kem_polynomial_clone_3a_d3( &out->public_key.ind_cpa_public_key.A[j][i1]); A[i1][j] = uu____0; } @@ -5888,7 +5890,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_15( (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2[3U])); uint8_t pk_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_39( + libcrux_ml_kem_ind_cpa_serialize_public_key_f7( out->public_key.ind_cpa_public_key.t_as_ntt, Eurydice_array_to_slice( (size_t)32U, out->public_key.ind_cpa_public_key.seed_for_A, uint8_t), @@ -5902,7 +5904,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_15( Result_00 dst; Eurydice_slice_to_array2(&dst, implicit_rejection_value, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____3); + unwrap_41_33(dst, uu____3); memcpy(out->private_key.implicit_rejection_value, uu____3, (size_t)32U * sizeof(uint8_t)); } @@ -5924,13 +5926,13 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline void -libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_generate_keypair_56( +libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_generate_keypair_1b( uint8_t randomness[64U], libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *out) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - libcrux_ml_kem_ind_cca_unpacked_generate_keypair_15(copy_of_randomness, out); + libcrux_ml_kem_ind_cca_unpacked_generate_keypair_98(copy_of_randomness, out); } /** @@ -5943,26 +5945,26 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_generate_key_pair( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_generate_keypair_56( + libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_generate_keypair_1b( copy_of_randomness, key_pair); } /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_1c +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6c with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cca_unpacked_default_1c_31(void) { +libcrux_ml_kem_ind_cca_unpacked_default_6c_c5(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 lit; - lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); + lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); lit.public_key_hash[0U] = 0U; lit.public_key_hash[1U] = 0U; lit.public_key_hash[2U] = 0U; @@ -6001,10 +6003,10 @@ libcrux_ml_kem_ind_cca_unpacked_default_1c_31(void) { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1])#3} +K>[TraitClause@0])#3} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_07 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6f with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 @@ -6012,9 +6014,9 @@ with const generics KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked - libcrux_ml_kem_ind_cca_unpacked_default_07_0e(void) { + libcrux_ml_kem_ind_cca_unpacked_default_6f_bb(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 uu____0; - uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); + uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); uu____0.implicit_rejection_value[0U] = 0U; uu____0.implicit_rejection_value[1U] = 0U; uu____0.implicit_rejection_value[2U] = 0U; @@ -6050,7 +6052,7 @@ static KRML_MUSTINLINE return ( CLITERAL(libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked){ .private_key = uu____0, - .public_key = libcrux_ml_kem_ind_cca_unpacked_default_1c_31()}); + .public_key = libcrux_ml_kem_ind_cca_unpacked_default_6c_c5()}); } /** @@ -6059,7 +6061,7 @@ static KRML_MUSTINLINE KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked libcrux_ml_kem_mlkem768_avx2_unpacked_init_key_pair(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_07_0e(); + return libcrux_ml_kem_ind_cca_unpacked_default_6f_bb(); } /** @@ -6068,7 +6070,7 @@ libcrux_ml_kem_mlkem768_avx2_unpacked_init_key_pair(void) { KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 libcrux_ml_kem_mlkem768_avx2_unpacked_init_public_key(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_1c_31(); + return libcrux_ml_kem_ind_cca_unpacked_default_6c_c5(); } /** @@ -6077,11 +6079,11 @@ libcrux_ml_kem_mlkem768_avx2_unpacked_init_public_key(void) { /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@1]} +K>[TraitClause@0]} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_dd with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_a6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 @@ -6089,10 +6091,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_05( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cpa_serialize_public_key_mut_82( + libcrux_ml_kem_ind_cpa_serialize_public_key_mut_7b( self->ind_cpa_public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, self->ind_cpa_public_key.seed_for_A, uint8_t), @@ -6105,11 +6107,11 @@ libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_05( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1]#2} +K>[TraitClause@0]#2} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_de with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_05 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 @@ -6117,10 +6119,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_84( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_b6( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_05( + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b( &self->public_key, serialized); } @@ -6132,24 +6134,24 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_key_pair_serialized_public_key( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_84(key_pair, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_b6(key_pair, serialized); } /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@2])#2} +K>[TraitClause@1])#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_ef +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_d6 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_clone_ef_c1( +libcrux_ml_kem_ind_cpa_unpacked_clone_d6_0d( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( @@ -6176,21 +6178,21 @@ libcrux_ml_kem_ind_cpa_unpacked_clone_ef_c1( /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@2])#4} +K>[TraitClause@1])#4} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_28 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_c7 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cca_unpacked_clone_28_a6( +libcrux_ml_kem_ind_cca_unpacked_clone_c7_56( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *self) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 lit; lit.ind_cpa_public_key = - libcrux_ml_kem_ind_cpa_unpacked_clone_ef_c1(&self->ind_cpa_public_key); + libcrux_ml_kem_ind_cpa_unpacked_clone_d6_0d(&self->ind_cpa_public_key); uint8_t ret[32U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( (size_t)32U, self->public_key_hash, ret, uint8_t, void *); @@ -6204,17 +6206,17 @@ libcrux_ml_kem_ind_cca_unpacked_clone_28_a6( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1]#2} +K>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_de +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_05 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 * -libcrux_ml_kem_ind_cca_unpacked_public_key_de_7a( +libcrux_ml_kem_ind_cca_unpacked_public_key_05_e2( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *self) { return &self->public_key; } @@ -6227,8 +6229,8 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_public_key( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *pk) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 uu____0 = - libcrux_ml_kem_ind_cca_unpacked_clone_28_a6( - libcrux_ml_kem_ind_cca_unpacked_public_key_de_7a(key_pair)); + libcrux_ml_kem_ind_cca_unpacked_clone_c7_56( + libcrux_ml_kem_ind_cca_unpacked_public_key_05_e2(key_pair)); pk[0U] = uu____0; } @@ -6239,7 +6241,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_serialized_public_key( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *public_key, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_05(public_key, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b(public_key, serialized); } @@ -6257,13 +6259,13 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_fe( +libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_ed( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *unpacked_public_key) { Eurydice_slice uu____0 = Eurydice_array_to_subslice_to( (size_t)1184U, public_key->value, (size_t)1152U, uint8_t, size_t); - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_4f( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( uu____0, unpacked_public_key->ind_cpa_public_key.t_as_ntt); uint8_t uu____1[32U]; libcrux_ml_kem_utils_into_padded_array_423( @@ -6283,7 +6285,7 @@ libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_fe( uint8_t uu____3[32U]; libcrux_ml_kem_hash_functions_avx2_H_a9_16( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), uu____3); memcpy(unpacked_public_key->public_key_hash, uu____3, @@ -6304,11 +6306,11 @@ generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline void -libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_unpack_public_key_f1( +libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_unpack_public_key_aa( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *unpacked_public_key) { - libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_fe(public_key, + libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_ed(public_key, unpacked_public_key); } @@ -6320,7 +6322,7 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_unpacked_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *unpacked_public_key) { - libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_unpack_public_key_f1( + libcrux_ml_kem_ind_cca_instantiations_avx2_unpacked_unpack_public_key_aa( public_key, unpacked_public_key); } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h index 34a008cc6..80dd501f6 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_avx2_types_H @@ -20,16 +20,36 @@ extern "C" { #include "eurydice_glue.h" -typedef __m256i libcrux_ml_kem_vector_avx2_SIMD256Vector; +typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 + libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768PublicKeyUnpacked; + +typedef struct libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked_s { + libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 private_key; + libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 public_key; +} libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked; /** -A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked with types libcrux_ml_kem_vector_avx2_SIMD256Vector +with const generics +- $3size_t +*/ +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 ind_cpa_public_key; + uint8_t public_key_hash[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0; +/** +A monomorphic instance of +libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types +libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics +- $3size_t */ -typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_d2_s { - __m256i coefficients[16U]; -} libcrux_ml_kem_polynomial_PolynomialRingElement_d2; +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 + ind_cpa_private_key; + uint8_t implicit_rejection_value[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0; /** A monomorphic instance of @@ -43,20 +63,6 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0_s { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 A[3U][3U]; } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0; -/** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked -with types libcrux_ml_kem_vector_avx2_SIMD256Vector -with const generics -- $3size_t -*/ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 ind_cpa_public_key; - uint8_t public_key_hash[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0; - -typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 - libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768PublicKeyUnpacked; - /** A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.IndCpaPrivateKeyUnpacked with types @@ -68,21 +74,15 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0_s { } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0; /** -A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types -libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics -- $3size_t +A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement +with types libcrux_ml_kem_vector_avx2_SIMD256Vector + */ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 - ind_cpa_private_key; - uint8_t implicit_rejection_value[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0; +typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_d2_s { + __m256i coefficients[16U]; +} libcrux_ml_kem_polynomial_PolynomialRingElement_d2; -typedef struct libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked_s { - libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 private_key; - libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 public_key; -} libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked; +typedef __m256i libcrux_ml_kem_vector_avx2_SIMD256Vector; #if defined(__cplusplus) } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h index 0e3e07dc6..aac1ad359 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_portable_H @@ -115,7 +115,7 @@ libcrux_ml_kem_vector_portable_vector_type_from_i16_array( Eurydice_slice_to_array2( &dst, Eurydice_slice_subslice2(array, (size_t)0U, (size_t)16U, int16_t), Eurydice_slice, int16_t[16U]); - unwrap_26_30(dst, ret); + unwrap_41_30(dst, ret); memcpy(lit.elements, ret, (size_t)16U * sizeof(int16_t)); return lit; } @@ -1226,15 +1226,15 @@ libcrux_ml_kem_vector_portable_compress_compress_message_coefficient( static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_compress_1( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; - v.elements[i0] = (int16_t) + a.elements[i0] = (int16_t) libcrux_ml_kem_vector_portable_compress_compress_message_coefficient( - (uint16_t)v.elements[i0]); + (uint16_t)a.elements[i0]); } - return v; + return a; } /** @@ -1243,8 +1243,8 @@ libcrux_ml_kem::vector::portable::vector_type::PortableVector)} */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_portable_compress_1_0d( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_1(v); + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_1(a); } static KRML_MUSTINLINE uint32_t @@ -2448,17 +2448,16 @@ typedef libcrux_ml_kem_types_MlKemPublicKey_15 /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_ZERO_ef_19(void) { +libcrux_ml_kem_polynomial_ZERO_20_19(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_portable_ZERO_0d(); lit.coefficients[1U] = libcrux_ml_kem_vector_portable_ZERO_0d(); @@ -2486,8 +2485,8 @@ with const generics - K= 3 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_a5(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); +libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_75(size_t _) { + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -2497,10 +2496,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_50( +libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_8f( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2519,12 +2518,12 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_55( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_5f( Eurydice_slice secret_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / @@ -2537,7 +2536,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_55( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_50( + libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_8f( secret_bytes); secret_as_ntt[i0] = uu____0; } @@ -2559,8 +2558,8 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - U_COMPRESSION_FACTOR= 10 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_e3(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); +libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_ef(size_t _) { + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -2570,7 +2569,7 @@ const generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be( +libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b4( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -2595,9 +2594,9 @@ generics - COEFFICIENT_BITS= 10 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f( +libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be( + return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b4( v); } @@ -2608,10 +2607,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_10_c8( +libcrux_ml_kem_serialize_deserialize_then_decompress_10_38( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice( @@ -2627,7 +2626,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_10_c8( libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_10_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f( + libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c( coefficient); re.coefficients[i0] = uu____0; } @@ -2641,7 +2640,7 @@ const generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be0( +libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b40( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -2666,9 +2665,9 @@ generics - COEFFICIENT_BITS= 11 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f0( +libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c0( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be0( + return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b40( v); } @@ -2679,10 +2678,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_11_c6( +libcrux_ml_kem_serialize_deserialize_then_decompress_11_68( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -2691,7 +2690,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_11_c6( libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_11_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f0( + libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c0( coefficient); re.coefficients[i0] = uu____0; } @@ -2705,9 +2704,9 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_a4( +libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_f7( Eurydice_slice serialized) { - return libcrux_ml_kem_serialize_deserialize_then_decompress_10_c8(serialized); + return libcrux_ml_kem_serialize_deserialize_then_decompress_10_38(serialized); } typedef struct libcrux_ml_kem_vector_portable_vector_type_PortableVector_x2_s { @@ -2845,16 +2844,15 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_at_layer_1_21( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -2872,7 +2870,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - VECTOR_U_COMPRESSION_FACTOR= 10 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_ec( +static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_52( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = (size_t)0U; libcrux_ml_kem_ntt_ntt_at_layer_4_plus_18(&zeta_i, re, (size_t)7U, @@ -2889,7 +2887,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_ec( (size_t)6U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_21(&zeta_i, re, (size_t)1U, (size_t)7U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); } /** @@ -2901,12 +2899,12 @@ with const generics - U_COMPRESSION_FACTOR= 10 */ static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_70( +libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_f8( uint8_t *ciphertext, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len( @@ -2926,9 +2924,9 @@ libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_70( (size_t)10U / (size_t)8U, uint8_t); u_as_ntt[i0] = - libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_a4( + libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_u_f7( u_bytes); - libcrux_ml_kem_ntt_ntt_vector_u_ec(&u_as_ntt[i0]); + libcrux_ml_kem_ntt_ntt_vector_u_52(&u_as_ntt[i0]); } memcpy( ret, u_as_ntt, @@ -2942,7 +2940,7 @@ const generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be1( +libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b41( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -2967,9 +2965,9 @@ generics - COEFFICIENT_BITS= 4 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f1( +libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c1( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be1( + return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b41( v); } @@ -2980,10 +2978,10 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_4_c5( +libcrux_ml_kem_serialize_deserialize_then_decompress_4_d2( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -2992,7 +2990,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_4_c5( libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = libcrux_ml_kem_vector_portable_deserialize_4_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f1( + libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c1( coefficient); re.coefficients[i0] = uu____0; } @@ -3006,7 +3004,7 @@ const generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be2( +libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b42( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -3031,9 +3029,9 @@ generics - COEFFICIENT_BITS= 5 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f2( +libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c2( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_be2( + return libcrux_ml_kem_vector_portable_compress_decompress_ciphertext_coefficient_b42( v); } @@ -3044,10 +3042,10 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_5_20( +libcrux_ml_kem_serialize_deserialize_then_decompress_5_57( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -3056,7 +3054,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_5_20( re.coefficients[i0] = libcrux_ml_kem_vector_portable_deserialize_5_0d(bytes); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____1 = - libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4f2( + libcrux_ml_kem_vector_portable_decompress_ciphertext_coefficient_0d_4c2( re.coefficients[i0]); re.coefficients[i0] = uu____1; } @@ -3070,28 +3068,27 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - COMPRESSION_FACTOR= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_7c( +libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_32( Eurydice_slice serialized) { - return libcrux_ml_kem_serialize_deserialize_then_decompress_4_c5(serialized); + return libcrux_ml_kem_serialize_deserialize_then_decompress_4_d2(serialized); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_ntt_multiply_ef_76( +libcrux_ml_kem_polynomial_ntt_multiply_20_76( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3112,16 +3109,15 @@ libcrux_ml_kem_polynomial_ntt_multiply_ef_76( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_20_3a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -3145,7 +3141,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_fe( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_ab( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -3168,7 +3164,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_7c( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_3a( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -3189,7 +3185,7 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_23( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_10( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, size_t _layer) { for (size_t i = (size_t)0U; i < (size_t)16U; i++) { @@ -3211,7 +3207,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector_x2 - libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_ca( + libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_ef( libcrux_ml_kem_vector_portable_vector_type_PortableVector a, libcrux_ml_kem_vector_portable_vector_type_PortableVector b, int16_t zeta_r) { @@ -3232,7 +3228,7 @@ with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c( +libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce( size_t *zeta_i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, size_t layer) { size_t step = (size_t)1U << (uint32_t)layer; @@ -3247,7 +3243,7 @@ libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c( for (size_t i = offset_vec; i < offset_vec + step_vec; i++) { size_t j = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector_x2 uu____0 = - libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_ca( + libcrux_ml_kem_invert_ntt_inv_ntt_layer_int_vec_step_reduce_ef( re->coefficients[j], re->coefficients[j + step_vec], libcrux_ml_kem_polynomial_get_zeta(zeta_i[0U])); libcrux_ml_kem_vector_portable_vector_type_PortableVector x = uu____0.fst; @@ -3264,37 +3260,36 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_0e( +static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re) { size_t zeta_i = LIBCRUX_ML_KEM_CONSTANTS_COEFFICIENTS_IN_RING_ELEMENT / (size_t)2U; - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_fe(&zeta_i, re, (size_t)1U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_7c(&zeta_i, re, (size_t)2U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_23(&zeta_i, re, (size_t)3U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_1_ab(&zeta_i, re, (size_t)1U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_2_3a(&zeta_i, re, (size_t)2U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_3_10(&zeta_i, re, (size_t)3U); + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce(&zeta_i, re, (size_t)4U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce(&zeta_i, re, (size_t)5U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce(&zeta_i, re, (size_t)6U); - libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_8c(&zeta_i, re, + libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce(&zeta_i, re, (size_t)7U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_subtract_reduce_ef_7e( +libcrux_ml_kem_polynomial_subtract_reduce_20_2c( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 b) { for (size_t i = (size_t)0U; @@ -3320,21 +3315,21 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_matrix_compute_message_60( +libcrux_ml_kem_matrix_compute_message_dc( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_76(&secret_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result, &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_0e(&result); - result = libcrux_ml_kem_polynomial_subtract_reduce_ef_7e(v, result); + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result); + result = libcrux_ml_kem_polynomial_subtract_reduce_20_2c(v, result); return result; } @@ -3344,7 +3339,7 @@ with const generics - SHIFT_BY= 15 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_arithmetic_shift_right_95( +libcrux_ml_kem_vector_portable_arithmetic_shift_right_3c( libcrux_ml_kem_vector_portable_vector_type_PortableVector vec) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { @@ -3364,9 +3359,9 @@ with const generics - SHIFT_BY= 15 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_shift_right_0d_64( +libcrux_ml_kem_vector_portable_shift_right_0d_3e( libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_arithmetic_shift_right_95(v); + return libcrux_ml_kem_vector_portable_arithmetic_shift_right_3c(v); } /** @@ -3379,13 +3374,27 @@ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { libcrux_ml_kem_vector_portable_vector_type_PortableVector t = - libcrux_ml_kem_vector_portable_shift_right_0d_64(a); + libcrux_ml_kem_vector_portable_shift_right_0d_3e(a); libcrux_ml_kem_vector_portable_vector_type_PortableVector fm = libcrux_ml_kem_vector_portable_bitwise_and_with_constant_0d( t, LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_MODULUS); return libcrux_ml_kem_vector_portable_add_0d(a, &fm); } +/** +A monomorphic instance of libcrux_ml_kem.serialize.to_unsigned_field_modulus +with types libcrux_ml_kem_vector_portable_vector_type_PortableVector +with const generics + +*/ +static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector +libcrux_ml_kem_serialize_to_unsigned_field_modulus_c4( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + libcrux_ml_kem_vector_portable_vector_type_PortableVector result = + libcrux_ml_kem_vector_traits_to_unsigned_representative_9f(a); + return result; +} + /** A monomorphic instance of libcrux_ml_kem.serialize.compress_then_serialize_message with types @@ -3393,13 +3402,13 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_message_39( +libcrux_ml_kem_serialize_compress_then_serialize_message_ec( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, uint8_t ret[32U]) { uint8_t serialized[32U] = {0U}; for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_c4( re.coefficients[i0]); libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient_compressed = @@ -3412,7 +3421,9 @@ libcrux_ml_kem_serialize_compress_then_serialize_message_39( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)2U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)32U * sizeof(uint8_t)); + uint8_t result[32U]; + memcpy(result, serialized, (size_t)32U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } /** @@ -3425,20 +3436,20 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static inline void libcrux_ml_kem_ind_cpa_decrypt_unpacked_15( +static inline void libcrux_ml_kem_ind_cpa_decrypt_unpacked_75( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 *secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; - libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_70(ciphertext, u_as_ntt); + libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_f8(ciphertext, u_as_ntt); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_7c( + libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_32( Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message = - libcrux_ml_kem_matrix_compute_message_60(&v, secret_key->secret_as_ntt, + libcrux_ml_kem_matrix_compute_message_dc(&v, secret_key->secret_as_ntt, u_as_ntt); uint8_t ret0[32U]; - libcrux_ml_kem_serialize_compress_then_serialize_message_39(message, ret0); + libcrux_ml_kem_serialize_compress_then_serialize_message_ec(message, ret0); memcpy(ret, ret0, (size_t)32U * sizeof(uint8_t)); } @@ -3452,11 +3463,11 @@ with const generics - U_COMPRESSION_FACTOR= 10 - V_COMPRESSION_FACTOR= 4 */ -static inline void libcrux_ml_kem_ind_cpa_decrypt_80(Eurydice_slice secret_key, +static inline void libcrux_ml_kem_ind_cpa_decrypt_46(Eurydice_slice secret_key, uint8_t *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; - libcrux_ml_kem_ind_cpa_deserialize_secret_key_55(secret_key, secret_as_ntt); + libcrux_ml_kem_ind_cpa_deserialize_secret_key_5f(secret_key, secret_as_ntt); /* Passing arrays by value in Rust generates a copy in C */ libcrux_ml_kem_polynomial_PolynomialRingElement_f0 copy_of_secret_as_ntt[3U]; memcpy( @@ -3468,7 +3479,7 @@ static inline void libcrux_ml_kem_ind_cpa_decrypt_80(Eurydice_slice secret_key, secret_key_unpacked.secret_as_ntt, copy_of_secret_as_ntt, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); uint8_t result[32U]; - libcrux_ml_kem_ind_cpa_decrypt_unpacked_15(&secret_key_unpacked, ciphertext, + libcrux_ml_kem_ind_cpa_decrypt_unpacked_75(&secret_key_unpacked, ciphertext, result); memcpy(ret, result, (size_t)32U * sizeof(uint8_t)); } @@ -3518,19 +3529,19 @@ static KRML_MUSTINLINE void libcrux_ml_kem_hash_functions_portable_PRF_f1_9d( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - uu____0[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + uu____0[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } uint8_t uu____1[32U] = {0U}; libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 lit; @@ -3538,15 +3549,15 @@ libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(void) { lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); return lit; } @@ -3557,10 +3568,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_b2( +libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_c7( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -3582,7 +3593,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_22( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *deserialized_pk) { for (size_t i = (size_t)0U; @@ -3596,7 +3607,7 @@ libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_22( LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_b2( + libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_c7( ring_element); deserialized_pk[i0] = uu____0; } @@ -3906,19 +3917,18 @@ libcrux_ml_kem_sampling_sample_from_uniform_distribution_next_fb0( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_from_i16_array_ef_bb(Eurydice_slice a) { +libcrux_ml_kem_polynomial_from_i16_array_20_bb(Eurydice_slice a) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3940,7 +3950,7 @@ generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_sampling_sample_from_xof_closure_ba(int16_t s[272U]) { - return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( + return libcrux_ml_kem_polynomial_from_i16_array_20_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -4068,7 +4078,7 @@ generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_closure_25(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -4146,7 +4156,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_2_1b( sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( + return libcrux_ml_kem_polynomial_from_i16_array_20_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -4191,7 +4201,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_3_ee( sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( + return libcrux_ml_kem_polynomial_from_i16_array_20_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -4253,7 +4263,7 @@ libcrux_ml_kem_ntt_ntt_binomially_sampled_ring_element_b3( &zeta_i, re, (size_t)2U, (size_t)11207U + (size_t)4U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_21( &zeta_i, re, (size_t)1U, (size_t)11207U + (size_t)5U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); } /** @@ -4307,7 +4317,7 @@ libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_44( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; @@ -4337,8 +4347,8 @@ generics - ETA2= 2 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_3e(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); +libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_ed(size_t _i) { + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -4351,11 +4361,11 @@ generics - ETA2= 2 */ static KRML_MUSTINLINE tuple_b0 -libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_95(uint8_t prf_input[33U], +libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_d6(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - error_1[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + error_1[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; @@ -4426,22 +4436,21 @@ with const generics - K= 3 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_matrix_compute_vector_u_closure_76(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); +libcrux_ml_kem_matrix_compute_vector_u_closure_4e(size_t _i) { + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_ef_9d( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_20_33( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -4465,14 +4474,14 @@ with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_42( +static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_7b( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 (*a_as_ntt)[3U], libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_1, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - result0[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + result0[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( @@ -4493,12 +4502,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_42( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_76(a_element, &r_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result0[i1], + libcrux_ml_kem_polynomial_ntt_multiply_20_76(a_element, &r_as_ntt[j]); + libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result0[i1], &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_0e(&result0[i1]); - libcrux_ml_kem_polynomial_add_error_reduce_ef_9d(&result0[i1], + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result0[i1]); + libcrux_ml_kem_polynomial_add_error_reduce_20_33(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[3U]; @@ -4517,7 +4526,7 @@ with const generics */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_traits_decompress_1_f7( +libcrux_ml_kem_vector_traits_decompress_1_5b( libcrux_ml_kem_vector_portable_vector_type_PortableVector vec) { libcrux_ml_kem_vector_portable_vector_type_PortableVector z = libcrux_ml_kem_vector_portable_ZERO_0d(); @@ -4536,10 +4545,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_then_decompress_message_f0( +libcrux_ml_kem_serialize_deserialize_then_decompress_message_c4( uint8_t serialized[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector @@ -4549,7 +4558,7 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_message_f0( (size_t)2U * i0 + (size_t)2U, uint8_t)); libcrux_ml_kem_vector_portable_vector_type_PortableVector uu____0 = - libcrux_ml_kem_vector_traits_decompress_1_f7(coefficient_compressed); + libcrux_ml_kem_vector_traits_decompress_1_5b(coefficient_compressed); re.coefficients[i0] = uu____0; } return re; @@ -4557,17 +4566,16 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_message_f0( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_add_message_error_reduce_ef_e4( +libcrux_ml_kem_polynomial_add_message_error_reduce_20_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result) { @@ -4597,22 +4605,22 @@ with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_matrix_compute_ring_element_v_58( +libcrux_ml_kem_matrix_compute_ring_element_v_43( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_76(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result, &product); } - libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_0e(&result); - result = libcrux_ml_kem_polynomial_add_message_error_reduce_ef_e4( + libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result); + result = libcrux_ml_kem_polynomial_add_message_error_reduce_20_f0( error_2, message, result); return result; } @@ -4623,17 +4631,17 @@ with const generics - COEFFICIENT_BITS= 10 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_compress_6c( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +libcrux_ml_kem_vector_portable_compress_compress_c5( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)10, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)10, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4646,9 +4654,9 @@ with const generics - COEFFICIENT_BITS= 10 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_0d_20( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_6c(v); +libcrux_ml_kem_vector_portable_compress_0d_4f( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_c5(a); } /** @@ -4658,15 +4666,15 @@ with const generics - OUT_LEN= 320 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_10_04( +libcrux_ml_kem_serialize_compress_then_serialize_10_83( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - libcrux_ml_kem_vector_portable_compress_0d_20( - libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( + libcrux_ml_kem_vector_portable_compress_0d_4f( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_c4( re->coefficients[i0])); uint8_t bytes[20U]; libcrux_ml_kem_vector_portable_serialize_10_0d(coefficient, bytes); @@ -4675,7 +4683,9 @@ libcrux_ml_kem_serialize_compress_then_serialize_10_04( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)20U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)320U * sizeof(uint8_t)); + uint8_t result[320U]; + memcpy(result, serialized, (size_t)320U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)320U * sizeof(uint8_t)); } /** @@ -4684,17 +4694,17 @@ with const generics - COEFFICIENT_BITS= 11 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_compress_6c0( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +libcrux_ml_kem_vector_portable_compress_compress_c50( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)11, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)11, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4707,9 +4717,9 @@ with const generics - COEFFICIENT_BITS= 11 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_0d_200( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_6c0(v); +libcrux_ml_kem_vector_portable_compress_0d_4f0( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_c50(a); } /** @@ -4719,14 +4729,14 @@ with const generics - OUT_LEN= 320 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_11_41( +libcrux_ml_kem_serialize_compress_then_serialize_11_2c( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[320U]) { uint8_t serialized[320U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - libcrux_ml_kem_vector_portable_compress_0d_200( + libcrux_ml_kem_vector_portable_compress_0d_4f0( libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( re->coefficients[i0])); uint8_t bytes[22U]; @@ -4747,10 +4757,10 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - OUT_LEN= 320 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_ae( +libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_cf( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[320U]) { uint8_t uu____0[320U]; - libcrux_ml_kem_serialize_compress_then_serialize_10_04(re, uu____0); + libcrux_ml_kem_serialize_compress_then_serialize_10_83(re, uu____0); memcpy(ret, uu____0, (size_t)320U * sizeof(uint8_t)); } @@ -4763,7 +4773,7 @@ with const generics - COMPRESSION_FACTOR= 10 - BLOCK_LEN= 320 */ -static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_48( +static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_86( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 input[3U], Eurydice_slice out) { for (size_t i = (size_t)0U; @@ -4779,7 +4789,7 @@ static inline void libcrux_ml_kem_ind_cpa_compress_then_serialize_u_48( out, i0 * ((size_t)960U / (size_t)3U), (i0 + (size_t)1U) * ((size_t)960U / (size_t)3U), uint8_t); uint8_t ret[320U]; - libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_ae(&re, + libcrux_ml_kem_serialize_compress_then_serialize_ring_element_u_cf(&re, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)320U, ret, uint8_t), uint8_t); @@ -4792,17 +4802,17 @@ with const generics - COEFFICIENT_BITS= 4 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_compress_6c1( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +libcrux_ml_kem_vector_portable_compress_compress_c51( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)4, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)4, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4815,9 +4825,9 @@ with const generics - COEFFICIENT_BITS= 4 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_0d_201( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_6c1(v); +libcrux_ml_kem_vector_portable_compress_0d_4f1( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_c51(a); } /** @@ -4827,17 +4837,15 @@ with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_4_b6( +libcrux_ml_kem_serialize_compress_then_serialize_4_17( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - libcrux_ml_kem_vector_portable_compress_0d_201( - libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( + libcrux_ml_kem_vector_portable_compress_0d_4f1( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_c4( re.coefficients[i0])); uint8_t bytes[8U]; libcrux_ml_kem_vector_portable_serialize_4_0d(coefficient, bytes); @@ -4854,17 +4862,17 @@ with const generics - COEFFICIENT_BITS= 5 */ static KRML_MUSTINLINE libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_compress_6c2( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { +libcrux_ml_kem_vector_portable_compress_compress_c52( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_VECTOR_TRAITS_FIELD_ELEMENTS_IN_VECTOR; i++) { size_t i0 = i; int16_t uu____0 = libcrux_ml_kem_vector_portable_compress_compress_ciphertext_coefficient( - (uint8_t)(int32_t)5, (uint16_t)v.elements[i0]); - v.elements[i0] = uu____0; + (uint8_t)(int32_t)5, (uint16_t)a.elements[i0]); + a.elements[i0] = uu____0; } - return v; + return a; } /** @@ -4877,9 +4885,9 @@ with const generics - COEFFICIENT_BITS= 5 */ static inline libcrux_ml_kem_vector_portable_vector_type_PortableVector -libcrux_ml_kem_vector_portable_compress_0d_202( - libcrux_ml_kem_vector_portable_vector_type_PortableVector v) { - return libcrux_ml_kem_vector_portable_compress_compress_6c2(v); +libcrux_ml_kem_vector_portable_compress_0d_4f2( + libcrux_ml_kem_vector_portable_vector_type_PortableVector a) { + return libcrux_ml_kem_vector_portable_compress_compress_c52(a); } /** @@ -4889,16 +4897,14 @@ with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_5_a0( +libcrux_ml_kem_serialize_compress_then_serialize_5_b7( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice serialized) { - LowStar_Ignore_ignore(Eurydice_slice_len(serialized, uint8_t), size_t, - void *); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients = - libcrux_ml_kem_vector_portable_compress_0d_202( + libcrux_ml_kem_vector_portable_compress_0d_4f2( libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( re.coefficients[i0])); uint8_t bytes[10U]; @@ -4918,9 +4924,9 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - OUT_LEN= 128 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_79( +libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_e9( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re, Eurydice_slice out) { - libcrux_ml_kem_serialize_compress_then_serialize_4_b6(re, out); + libcrux_ml_kem_serialize_compress_then_serialize_4_17(re, out); } /** @@ -4941,7 +4947,7 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_02( +static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_f8( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 *public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { uint8_t prf_input[33U]; @@ -4959,7 +4965,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_02( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); - tuple_b0 uu____3 = libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_95( + tuple_b0 uu____3 = libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_d6( copy_of_prf_input, domain_separator0); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; memcpy( @@ -4974,27 +4980,27 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_unpacked_02( libcrux_ml_kem_sampling_sample_from_binomial_distribution_ce( Eurydice_array_to_slice((size_t)128U, prf_output, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u[3U]; - libcrux_ml_kem_matrix_compute_vector_u_42(public_key->A, r_as_ntt, error_1, + libcrux_ml_kem_matrix_compute_vector_u_7b(public_key->A, r_as_ntt, error_1, u); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 message_as_ring_element = - libcrux_ml_kem_serialize_deserialize_then_decompress_message_f0( + libcrux_ml_kem_serialize_deserialize_then_decompress_message_c4( copy_of_message); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 v = - libcrux_ml_kem_matrix_compute_ring_element_v_58( + libcrux_ml_kem_matrix_compute_ring_element_v_43( public_key->t_as_ntt, r_as_ntt, &error_2, &message_as_ring_element); uint8_t ciphertext[1088U] = {0U}; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____5[3U]; memcpy( uu____5, u, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); - libcrux_ml_kem_ind_cpa_compress_then_serialize_u_48( + libcrux_ml_kem_ind_cpa_compress_then_serialize_u_86( uu____5, Eurydice_array_to_subslice2(ciphertext, (size_t)0U, (size_t)960U, uint8_t)); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____6 = v; - libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_79( + libcrux_ml_kem_serialize_compress_then_serialize_ring_element_v_e9( uu____6, Eurydice_array_to_subslice_from((size_t)1088U, ciphertext, (size_t)960U, uint8_t, size_t)); memcpy(ret, ciphertext, (size_t)1088U * sizeof(uint8_t)); @@ -5018,13 +5024,13 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static inline void libcrux_ml_kem_ind_cpa_encrypt_ca(Eurydice_slice public_key, +static inline void libcrux_ml_kem_ind_cpa_encrypt_3b(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 - unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_22( + unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); Eurydice_slice seed = @@ -5040,7 +5046,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_ca(Eurydice_slice public_key, uint8_t copy_of_message[32U]; memcpy(copy_of_message, message, (size_t)32U * sizeof(uint8_t)); uint8_t result[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_02(uu____1, copy_of_message, + libcrux_ml_kem_ind_cpa_encrypt_unpacked_f8(uu____1, copy_of_message, randomness, result); memcpy(ret, result, (size_t)1088U * sizeof(uint8_t)); } @@ -5056,7 +5062,7 @@ with const generics - K= 3 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_d8_1a( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_d8_b2( Eurydice_slice shared_secret, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; @@ -5087,7 +5093,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -static inline void libcrux_ml_kem_ind_cca_decapsulate_68( +static inline void libcrux_ml_kem_ind_cca_decapsulate_6b( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -5105,7 +5111,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_68( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_80(ind_cpa_secret_key, ciphertext->value, + libcrux_ml_kem_ind_cpa_decrypt_46(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5129,7 +5135,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_68( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; libcrux_ml_kem_hash_functions_portable_PRF_f1_9d( @@ -5140,18 +5146,18 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_68( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_ca(uu____5, copy_of_decrypted, + libcrux_ml_kem_ind_cpa_encrypt_3b(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - libcrux_ml_kem_variant_kdf_d8_1a( + libcrux_ml_kem_variant_kdf_d8_b2( Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), ciphertext, implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - libcrux_ml_kem_variant_kdf_d8_1a(shared_secret0, ciphertext, shared_secret1); + libcrux_ml_kem_variant_kdf_d8_b2(shared_secret0, ciphertext, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -5181,10 +5187,10 @@ libcrux_ml_kem.ind_cca.instantiations.portable.decapsulate with const generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ static inline void -libcrux_ml_kem_ind_cca_instantiations_portable_decapsulate_85( +libcrux_ml_kem_ind_cca_instantiations_portable_decapsulate_d5( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_68(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_6b(private_key, ciphertext, ret); } /** @@ -5197,7 +5203,7 @@ libcrux_ml_kem_ind_cca_instantiations_portable_decapsulate_85( static inline void libcrux_ml_kem_mlkem768_portable_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_portable_decapsulate_85( + libcrux_ml_kem_ind_cca_instantiations_portable_decapsulate_d5( private_key, ciphertext, ret); } @@ -5211,7 +5217,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_d8_b7( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_d8_03( Eurydice_slice randomness, uint8_t ret[32U]) { uint8_t out[32U] = {0U}; Eurydice_slice_copy(Eurydice_array_to_slice((size_t)32U, out, uint8_t), @@ -5252,11 +5258,11 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a( +static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_fd( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - libcrux_ml_kem_variant_entropy_preprocess_d8_b7( + libcrux_ml_kem_variant_entropy_preprocess_d8_03( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5267,7 +5273,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a( uint8_t ret[32U]; libcrux_ml_kem_hash_functions_portable_H_f1_c6( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -5282,20 +5288,20 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_e0(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_ca(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_3b(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - libcrux_ml_kem_variant_kdf_d8_1a(shared_secret, &ciphertext0, + libcrux_ml_kem_variant_kdf_d8_b2(shared_secret, &ciphertext0, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ @@ -5327,14 +5333,14 @@ libcrux_ml_kem.ind_cca.instantiations.portable.encapsulate with const generics - ETA2_RANDOMNESS_SIZE= 128 */ static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_portable_encapsulate_16( +libcrux_ml_kem_ind_cca_instantiations_portable_encapsulate_28( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_8a(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_fd(uu____0, copy_of_randomness); } /** @@ -5351,27 +5357,27 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_portable_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_portable_encapsulate_16( + return libcrux_ml_kem_ind_cca_instantiations_portable_encapsulate_28( uu____0, copy_of_randomness); } /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0, TraitClause@1])} +K>[TraitClause@0])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(void) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 lit; - lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); - lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); return lit; } @@ -5385,7 +5391,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_d8_26( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_d8_99( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { uint8_t seed[33U] = {0U}; Eurydice_slice_copy( @@ -5416,17 +5422,16 @@ libcrux_ml_kem_vector_traits_to_standard_domain_73( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@1]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_69( +libcrux_ml_kem_polynomial_add_standard_error_reduce_20_69( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -5465,7 +5470,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_f0( size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_polynomial_ZERO_ef_19(); + libcrux_ml_kem_polynomial_ZERO_20_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -5478,12 +5483,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_ef_76(matrix_element, + libcrux_ml_kem_polynomial_ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&t_as_ntt[i0], &product); } - libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_69( + libcrux_ml_kem_polynomial_add_standard_error_reduce_20_69( &t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -5502,7 +5507,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_86( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 *private_key, libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 *public_key) { uint8_t hashed[64U]; - libcrux_ml_kem_variant_cpa_keygen_seed_d8_26(key_generation_seed, hashed); + libcrux_ml_kem_variant_cpa_keygen_seed_d8_99(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -5540,7 +5545,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_86( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____5); + unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5551,14 +5556,14 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_c4( +libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_c6( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *re, uint8_t ret[384U]) { uint8_t serialized[384U] = {0U}; for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficient = - libcrux_ml_kem_vector_traits_to_unsigned_representative_9f( + libcrux_ml_kem_serialize_to_unsigned_field_modulus_c4( re->coefficients[i0]); uint8_t bytes[24U]; libcrux_ml_kem_vector_portable_serialize_12_0d(coefficient, bytes); @@ -5567,7 +5572,9 @@ libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_c4( Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)24U, bytes, uint8_t), uint8_t); } - memcpy(ret, serialized, (size_t)384U * sizeof(uint8_t)); + uint8_t result[384U]; + memcpy(result, serialized, (size_t)384U * sizeof(uint8_t)); + memcpy(ret, result, (size_t)384U * sizeof(uint8_t)); } /** @@ -5577,7 +5584,7 @@ with const generics - K= 3 - OUT_LEN= 1152 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_80( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_1d( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *key, uint8_t ret[1152U]) { uint8_t out[1152U] = {0U}; @@ -5595,7 +5602,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_secret_key_80( (i0 + (size_t)1U) * LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT, uint8_t); uint8_t ret0[384U]; - libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_c4(&re, ret0); + libcrux_ml_kem_serialize_serialize_uncompressed_ring_element_c6(&re, ret0); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)384U, ret0, uint8_t), uint8_t); } @@ -5610,13 +5617,13 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_mut_1d( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_mut_0d( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t *serialized) { Eurydice_slice uu____0 = Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)1152U, uint8_t); uint8_t ret[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_80(t_as_ntt, ret); + libcrux_ml_kem_ind_cpa_serialize_secret_key_1d(t_as_ntt, ret); Eurydice_slice_copy( uu____0, Eurydice_array_to_slice((size_t)1152U, ret, uint8_t), uint8_t); Eurydice_slice_copy( @@ -5633,11 +5640,11 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_96( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_serialize_public_key_8c( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *t_as_ntt, Eurydice_slice seed_for_a, uint8_t ret[1184U]) { uint8_t public_key_serialized[1184U] = {0U}; - libcrux_ml_kem_ind_cpa_serialize_public_key_mut_1d(t_as_ntt, seed_for_a, + libcrux_ml_kem_ind_cpa_serialize_public_key_mut_0d(t_as_ntt, seed_for_a, public_key_serialized); uint8_t result[1184U]; memcpy(result, public_key_serialized, (size_t)1184U * sizeof(uint8_t)); @@ -5657,20 +5664,20 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 -libcrux_ml_kem_ind_cpa_generate_keypair_ea(Eurydice_slice key_generation_seed) { +libcrux_ml_kem_ind_cpa_generate_keypair_79(Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); + libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); + libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_86( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_96( + libcrux_ml_kem_ind_cpa_serialize_public_key_8c( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_80(private_key.secret_as_ntt, + libcrux_ml_kem_ind_cpa_serialize_secret_key_1d(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; @@ -5695,7 +5702,7 @@ with const generics - K= 3 - SERIALIZED_KEY_LEN= 2400 */ -static KRML_MUSTINLINE void libcrux_ml_kem_ind_cca_serialize_kem_secret_key_59( +static KRML_MUSTINLINE void libcrux_ml_kem_ind_cca_serialize_kem_secret_key_d8( Eurydice_slice private_key, Eurydice_slice public_key, Eurydice_slice implicit_rejection_value, uint8_t ret[2400U]) { uint8_t out[2400U] = {0U}; @@ -5751,7 +5758,7 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_91(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -5760,13 +5767,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - libcrux_ml_kem_ind_cpa_generate_keypair_ea(ind_cpa_keypair_randomness); + libcrux_ml_kem_ind_cpa_generate_keypair_79(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - libcrux_ml_kem_ind_cca_serialize_kem_secret_key_59( + libcrux_ml_kem_ind_cca_serialize_kem_secret_key_d8( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -5775,13 +5782,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b2(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -5797,12 +5804,12 @@ generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_instantiations_portable_generate_keypair_7f( +libcrux_ml_kem_ind_cca_instantiations_portable_generate_keypair_08( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_b2(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_91(copy_of_randomness); } /** @@ -5813,7 +5820,7 @@ libcrux_ml_kem_mlkem768_portable_generate_key_pair(uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_portable_generate_keypair_7f( + return libcrux_ml_kem_ind_cca_instantiations_portable_generate_keypair_08( copy_of_randomness); } @@ -5828,7 +5835,7 @@ with const generics - K= 3 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_23( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_44( Eurydice_slice shared_secret, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { uint8_t kdf_input[64U]; @@ -5839,7 +5846,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_variant_kdf_33_23( uint8_t ret0[32U]; libcrux_ml_kem_hash_functions_portable_H_f1_c6( Eurydice_array_to_slice((size_t)1088U, - libcrux_ml_kem_types_as_slice_d4_4c(ciphertext), + libcrux_ml_kem_types_as_slice_d4_e2(ciphertext), uint8_t), ret0); Eurydice_slice_copy( @@ -5872,7 +5879,7 @@ libcrux_ml_kem_variant_Kyber with const generics - ETA2_RANDOMNESS_SIZE= 128 - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ -static inline void libcrux_ml_kem_ind_cca_decapsulate_680( +static inline void libcrux_ml_kem_ind_cca_decapsulate_6b0( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( @@ -5890,7 +5897,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_680( Eurydice_slice ind_cpa_public_key_hash = uu____2.fst; Eurydice_slice implicit_rejection_value = uu____2.snd; uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_80(ind_cpa_secret_key, ciphertext->value, + libcrux_ml_kem_ind_cpa_decrypt_46(ind_cpa_secret_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -5914,7 +5921,7 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_680( Eurydice_slice uu____4 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____4, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret0[32U]; libcrux_ml_kem_hash_functions_portable_PRF_f1_9d( @@ -5925,18 +5932,18 @@ static inline void libcrux_ml_kem_ind_cca_decapsulate_680( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_ca(uu____5, copy_of_decrypted, + libcrux_ml_kem_ind_cpa_encrypt_3b(uu____5, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t implicit_rejection_shared_secret[32U]; - libcrux_ml_kem_variant_kdf_33_23( + libcrux_ml_kem_variant_kdf_33_44( Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret0, uint8_t), ciphertext, implicit_rejection_shared_secret); uint8_t shared_secret1[32U]; - libcrux_ml_kem_variant_kdf_33_23(shared_secret0, ciphertext, shared_secret1); + libcrux_ml_kem_variant_kdf_33_44(shared_secret0, ciphertext, shared_secret1); uint8_t shared_secret[32U]; libcrux_ml_kem_constant_time_ops_compare_ciphertexts_select_shared_secret_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t), Eurydice_array_to_slice((size_t)32U, shared_secret1, uint8_t), Eurydice_array_to_slice((size_t)32U, implicit_rejection_shared_secret, @@ -5970,10 +5977,10 @@ generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ static inline void -libcrux_ml_kem_ind_cca_instantiations_portable_kyber_decapsulate_1b( +libcrux_ml_kem_ind_cca_instantiations_portable_kyber_decapsulate_c7( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_decapsulate_680(private_key, ciphertext, ret); + libcrux_ml_kem_ind_cca_decapsulate_6b0(private_key, ciphertext, ret); } /** @@ -5986,7 +5993,7 @@ libcrux_ml_kem_ind_cca_instantiations_portable_kyber_decapsulate_1b( static inline void libcrux_ml_kem_mlkem768_portable_kyber_decapsulate( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_portable_kyber_decapsulate_1b( + libcrux_ml_kem_ind_cca_instantiations_portable_kyber_decapsulate_c7( private_key, ciphertext, ret); } @@ -6000,7 +6007,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_33_3b( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_entropy_preprocess_33_ec( Eurydice_slice randomness, uint8_t ret[32U]) { libcrux_ml_kem_hash_functions_portable_H_f1_c6(randomness, ret); } @@ -6024,11 +6031,11 @@ libcrux_ml_kem_variant_Kyber with const generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a0( +static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_fd0( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { uint8_t randomness0[32U]; - libcrux_ml_kem_variant_entropy_preprocess_33_3b( + libcrux_ml_kem_variant_entropy_preprocess_33_ec( Eurydice_array_to_slice((size_t)32U, randomness, uint8_t), randomness0); uint8_t to_hash[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -6039,7 +6046,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a0( uint8_t ret[32U]; libcrux_ml_kem_hash_functions_portable_H_f1_c6( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), ret); Eurydice_slice_copy( @@ -6054,20 +6061,20 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_encapsulate_8a0( Eurydice_slice shared_secret = uu____1.fst; Eurydice_slice pseudorandomness = uu____1.snd; Eurydice_slice uu____2 = Eurydice_array_to_slice( - (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_e0(public_key), uint8_t); + (size_t)1184U, libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness0, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_ca(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_3b(uu____2, copy_of_randomness, pseudorandomness, ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext ciphertext0 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); uint8_t shared_secret_array[32U]; - libcrux_ml_kem_variant_kdf_33_23(shared_secret, &ciphertext0, + libcrux_ml_kem_variant_kdf_33_44(shared_secret, &ciphertext0, shared_secret_array); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = ciphertext0; /* Passing arrays by value in Rust generates a copy in C */ @@ -6103,14 +6110,14 @@ generics - ETA2_RANDOMNESS_SIZE= 128 */ static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_portable_kyber_encapsulate_32( +libcrux_ml_kem_ind_cca_instantiations_portable_kyber_encapsulate_5e( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_types_MlKemPublicKey_15 *uu____0 = public_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_encapsulate_8a0(uu____0, copy_of_randomness); + return libcrux_ml_kem_ind_cca_encapsulate_fd0(uu____0, copy_of_randomness); } /** @@ -6127,7 +6134,7 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_portable_kyber_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_portable_kyber_encapsulate_32( + return libcrux_ml_kem_ind_cca_instantiations_portable_kyber_encapsulate_5e( uu____0, copy_of_randomness); } @@ -6141,7 +6148,7 @@ with types libcrux_ml_kem_hash_functions_portable_PortableHash[[$3size_t]] with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_33_22( +static KRML_MUSTINLINE void libcrux_ml_kem_variant_cpa_keygen_seed_33_01( Eurydice_slice key_generation_seed, uint8_t ret[64U]) { libcrux_ml_kem_hash_functions_portable_G_f1_07(key_generation_seed, ret); } @@ -6160,7 +6167,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_860( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 *private_key, libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 *public_key) { uint8_t hashed[64U]; - libcrux_ml_kem_variant_cpa_keygen_seed_33_22(key_generation_seed, hashed); + libcrux_ml_kem_variant_cpa_keygen_seed_33_01(key_generation_seed, hashed); Eurydice_slice_uint8_t_x2 uu____0 = Eurydice_slice_split_at( Eurydice_array_to_slice((size_t)64U, hashed, uint8_t), (size_t)32U, uint8_t, Eurydice_slice_uint8_t_x2); @@ -6198,7 +6205,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_860( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____5); + unwrap_41_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6215,21 +6222,21 @@ libcrux_ml_kem_variant_Kyber with const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 -libcrux_ml_kem_ind_cpa_generate_keypair_ea0( +libcrux_ml_kem_ind_cpa_generate_keypair_790( Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); + libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); + libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_860( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_96( + libcrux_ml_kem_ind_cpa_serialize_public_key_8c( public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, public_key.seed_for_A, uint8_t), public_key_serialized); uint8_t secret_key_serialized[1152U]; - libcrux_ml_kem_ind_cpa_serialize_secret_key_80(private_key.secret_as_ntt, + libcrux_ml_kem_ind_cpa_serialize_secret_key_1d(private_key.secret_as_ntt, secret_key_serialized); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_secret_key_serialized[1152U]; @@ -6261,7 +6268,7 @@ libcrux_ml_kem_variant_Kyber with const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { +libcrux_ml_kem_ind_cca_generate_keypair_910(uint8_t randomness[64U]) { Eurydice_slice ind_cpa_keypair_randomness = Eurydice_array_to_subslice2( randomness, (size_t)0U, LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t); @@ -6270,13 +6277,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { LIBCRUX_ML_KEM_CONSTANTS_CPA_PKE_KEY_GENERATION_SEED_SIZE, uint8_t, size_t); libcrux_ml_kem_utils_extraction_helper_Keypair768 uu____0 = - libcrux_ml_kem_ind_cpa_generate_keypair_ea0(ind_cpa_keypair_randomness); + libcrux_ml_kem_ind_cpa_generate_keypair_790(ind_cpa_keypair_randomness); uint8_t ind_cpa_private_key[1152U]; memcpy(ind_cpa_private_key, uu____0.fst, (size_t)1152U * sizeof(uint8_t)); uint8_t public_key[1184U]; memcpy(public_key, uu____0.snd, (size_t)1184U * sizeof(uint8_t)); uint8_t secret_key_serialized[2400U]; - libcrux_ml_kem_ind_cca_serialize_kem_secret_key_59( + libcrux_ml_kem_ind_cca_serialize_kem_secret_key_d8( Eurydice_array_to_slice((size_t)1152U, ind_cpa_private_key, uint8_t), Eurydice_array_to_slice((size_t)1184U, public_key, uint8_t), implicit_rejection_value, secret_key_serialized); @@ -6285,13 +6292,13 @@ libcrux_ml_kem_ind_cca_generate_keypair_b20(uint8_t randomness[64U]) { memcpy(copy_of_secret_key_serialized, secret_key_serialized, (size_t)2400U * sizeof(uint8_t)); libcrux_ml_kem_types_MlKemPrivateKey_55 private_key = - libcrux_ml_kem_types_from_7f_72(copy_of_secret_key_serialized); + libcrux_ml_kem_types_from_7f_8c(copy_of_secret_key_serialized); libcrux_ml_kem_types_MlKemPrivateKey_55 uu____2 = private_key; /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_public_key[1184U]; memcpy(copy_of_public_key, public_key, (size_t)1184U * sizeof(uint8_t)); - return libcrux_ml_kem_types_from_3a_8d( - uu____2, libcrux_ml_kem_types_from_5a_c6(copy_of_public_key)); + return libcrux_ml_kem_types_from_3a_f6( + uu____2, libcrux_ml_kem_types_from_5a_45(copy_of_public_key)); } /** @@ -6307,12 +6314,12 @@ generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair -libcrux_ml_kem_ind_cca_instantiations_portable_kyber_generate_keypair_08( +libcrux_ml_kem_ind_cca_instantiations_portable_kyber_generate_keypair_05( uint8_t randomness[64U]) { /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_generate_keypair_b20(copy_of_randomness); + return libcrux_ml_kem_ind_cca_generate_keypair_910(copy_of_randomness); } /** @@ -6324,7 +6331,7 @@ libcrux_ml_kem_mlkem768_portable_kyber_generate_key_pair( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_portable_kyber_generate_keypair_08( + return libcrux_ml_kem_ind_cca_instantiations_portable_kyber_generate_keypair_05( copy_of_randomness); } @@ -6336,7 +6343,7 @@ with const generics - SECRET_KEY_SIZE= 2400 - CIPHERTEXT_SIZE= 1088 */ -static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_private_key_a9( +static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_private_key_79( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext) { uint8_t t[32U]; @@ -6361,10 +6368,10 @@ generics - CIPHERTEXT_SIZE= 1088 */ static KRML_MUSTINLINE bool -libcrux_ml_kem_ind_cca_instantiations_portable_validate_private_key_4d( +libcrux_ml_kem_ind_cca_instantiations_portable_validate_private_key_03( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_validate_private_key_a9(private_key, + return libcrux_ml_kem_ind_cca_validate_private_key_79(private_key, ciphertext); } @@ -6376,7 +6383,7 @@ libcrux_ml_kem_ind_cca_instantiations_portable_validate_private_key_4d( static inline bool libcrux_ml_kem_mlkem768_portable_validate_private_key( libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext) { - return libcrux_ml_kem_ind_cca_instantiations_portable_validate_private_key_4d( + return libcrux_ml_kem_ind_cca_instantiations_portable_validate_private_key_03( private_key, ciphertext); } @@ -6388,9 +6395,9 @@ generics - K= 3 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_a3( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_8b( size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -6400,14 +6407,14 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE void -libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_21( +libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_7b( Eurydice_slice public_key, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_22( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -6422,16 +6429,16 @@ with const generics - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ -static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_public_key_be( +static KRML_MUSTINLINE bool libcrux_ml_kem_ind_cca_validate_public_key_bb( uint8_t *public_key) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_21( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_7b( Eurydice_array_to_subslice_to((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), deserialized_pk); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = deserialized_pk; uint8_t public_key_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_96( + libcrux_ml_kem_ind_cpa_serialize_public_key_8c( uu____0, Eurydice_array_to_subslice_from((size_t)1184U, public_key, (size_t)1152U, uint8_t, size_t), @@ -6449,9 +6456,9 @@ generics - PUBLIC_KEY_SIZE= 1184 */ static KRML_MUSTINLINE bool -libcrux_ml_kem_ind_cca_instantiations_portable_validate_public_key_34( +libcrux_ml_kem_ind_cca_instantiations_portable_validate_public_key_aa( uint8_t *public_key) { - return libcrux_ml_kem_ind_cca_validate_public_key_be(public_key); + return libcrux_ml_kem_ind_cca_validate_public_key_bb(public_key); } /** @@ -6461,7 +6468,7 @@ libcrux_ml_kem_ind_cca_instantiations_portable_validate_public_key_34( */ static inline bool libcrux_ml_kem_mlkem768_portable_validate_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key) { - return libcrux_ml_kem_ind_cca_instantiations_portable_validate_public_key_34( + return libcrux_ml_kem_ind_cca_instantiations_portable_validate_public_key_aa( public_key->value); } @@ -6491,7 +6498,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_d6( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { uint8_t decrypted[32U]; - libcrux_ml_kem_ind_cpa_decrypt_unpacked_15( + libcrux_ml_kem_ind_cpa_decrypt_unpacked_75( &key_pair->private_key.ind_cpa_private_key, ciphertext->value, decrypted); uint8_t to_hash0[64U]; libcrux_ml_kem_utils_into_padded_array_42( @@ -6521,7 +6528,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_d6( Eurydice_slice uu____2 = Eurydice_array_to_subslice_from( (size_t)1120U, to_hash, LIBCRUX_ML_KEM_CONSTANTS_SHARED_SECRET_SIZE, uint8_t, size_t); - Eurydice_slice_copy(uu____2, libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + Eurydice_slice_copy(uu____2, libcrux_ml_kem_types_as_ref_00_b6(ciphertext), uint8_t); uint8_t implicit_rejection_shared_secret[32U]; libcrux_ml_kem_hash_functions_portable_PRF_f1_9d( @@ -6533,11 +6540,11 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_decapsulate_d6( uint8_t copy_of_decrypted[32U]; memcpy(copy_of_decrypted, decrypted, (size_t)32U * sizeof(uint8_t)); uint8_t expected_ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_02( + libcrux_ml_kem_ind_cpa_encrypt_unpacked_f8( uu____3, copy_of_decrypted, pseudorandomness, expected_ciphertext); uint8_t selector = libcrux_ml_kem_constant_time_ops_compare_ciphertexts_in_constant_time( - libcrux_ml_kem_types_as_ref_00_d9(ciphertext), + libcrux_ml_kem_types_as_ref_00_b6(ciphertext), Eurydice_array_to_slice((size_t)1088U, expected_ciphertext, uint8_t)); uint8_t ret0[32U]; libcrux_ml_kem_constant_time_ops_select_shared_secret_in_constant_time( @@ -6573,7 +6580,7 @@ generics - IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120 */ static inline void -libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_decapsulate_8e( +libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_decapsulate_2e( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { libcrux_ml_kem_ind_cca_unpacked_decapsulate_d6(key_pair, ciphertext, ret); @@ -6590,7 +6597,7 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_decapsulate( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *private_key, libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]) { - libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_decapsulate_8e( + libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_decapsulate_2e( private_key, ciphertext, ret); } @@ -6613,7 +6620,7 @@ generics - ETA2= 2 - ETA2_RANDOMNESS_SIZE= 128 */ -static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_a4( +static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_02( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *public_key, uint8_t randomness[32U]) { uint8_t to_hash[64U]; @@ -6641,7 +6648,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_a4( uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); uint8_t ciphertext[1088U]; - libcrux_ml_kem_ind_cpa_encrypt_unpacked_02(uu____2, copy_of_randomness, + libcrux_ml_kem_ind_cpa_encrypt_unpacked_f8(uu____2, copy_of_randomness, pseudorandomness, ciphertext); uint8_t shared_secret_array[32U] = {0U}; Eurydice_slice_copy( @@ -6651,7 +6658,7 @@ static inline tuple_3c libcrux_ml_kem_ind_cca_unpacked_encapsulate_a4( uint8_t copy_of_ciphertext[1088U]; memcpy(copy_of_ciphertext, ciphertext, (size_t)1088U * sizeof(uint8_t)); libcrux_ml_kem_mlkem768_MlKem768Ciphertext uu____5 = - libcrux_ml_kem_types_from_01_c4(copy_of_ciphertext); + libcrux_ml_kem_types_from_01_6e(copy_of_ciphertext); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_shared_secret_array[32U]; memcpy(copy_of_shared_secret_array, shared_secret_array, @@ -6684,7 +6691,7 @@ generics - ETA2_RANDOMNESS_SIZE= 128 */ static inline tuple_3c -libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_encapsulate_c0( +libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_encapsulate_10( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *public_key, uint8_t randomness[32U]) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *uu____0 = @@ -6692,7 +6699,7 @@ libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_encapsulate_c0( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_unpacked_encapsulate_a4(uu____0, + return libcrux_ml_kem_ind_cca_unpacked_encapsulate_02(uu____0, copy_of_randomness); } @@ -6712,7 +6719,7 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_portable_unpacked_encapsulate( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[32U]; memcpy(copy_of_randomness, randomness, (size_t)32U * sizeof(uint8_t)); - return libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_encapsulate_c0( + return libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_encapsulate_10( uu____0, copy_of_randomness); } @@ -6731,8 +6738,8 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_6d(size_t _j) { - return libcrux_ml_kem_polynomial_ZERO_ef_19(); +libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_95(size_t _j) { + return libcrux_ml_kem_polynomial_ZERO_20_19(); } /** @@ -6749,26 +6756,25 @@ libcrux_ml_kem_variant_MlKem with const generics - ETA1= 2 - ETA1_RANDOMNESS_SIZE= 128 */ -static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_8e( +static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_6b( size_t _i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - ret[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + ret[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); } } /** This function found in impl {(core::clone::Clone for -libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, -TraitClause@2])} +libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.clone_8d +A monomorphic instance of libcrux_ml_kem.polynomial.clone_3a with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_clone_8d_a6( +libcrux_ml_kem_polynomial_clone_3a_06( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; libcrux_ml_kem_vector_portable_vector_type_PortableVector ret[16U]; @@ -6812,14 +6818,14 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_3b( &out->public_key.ind_cpa_public_key); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 A[3U][3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_8e(i, A[i]); + libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_6b(i, A[i]); } for (size_t i0 = (size_t)0U; i0 < (size_t)3U; i0++) { size_t i1 = i0; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_polynomial_clone_8d_a6( + libcrux_ml_kem_polynomial_clone_3a_06( &out->public_key.ind_cpa_public_key.A[j][i1]); A[i1][j] = uu____0; } @@ -6832,7 +6838,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_3b( (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0[3U])); uint8_t pk_serialized[1184U]; - libcrux_ml_kem_ind_cpa_serialize_public_key_96( + libcrux_ml_kem_ind_cpa_serialize_public_key_8c( out->public_key.ind_cpa_public_key.t_as_ntt, Eurydice_array_to_slice( (size_t)32U, out->public_key.ind_cpa_public_key.seed_for_A, uint8_t), @@ -6846,7 +6852,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_3b( Result_00 dst; Eurydice_slice_to_array2(&dst, implicit_rejection_value, Eurydice_slice, uint8_t[32U]); - unwrap_26_33(dst, uu____3); + unwrap_41_33(dst, uu____3); memcpy(out->private_key.implicit_rejection_value, uu____3, (size_t)32U * sizeof(uint8_t)); } @@ -6867,7 +6873,7 @@ const generics - ETA1_RANDOMNESS_SIZE= 128 */ static inline void -libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_generate_keypair_08( +libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_generate_keypair_ec( uint8_t randomness[64U], libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *out) { /* Passing arrays by value in Rust generates a copy in C */ @@ -6886,25 +6892,25 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_generate_key_pair( /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_randomness[64U]; memcpy(copy_of_randomness, randomness, (size_t)64U * sizeof(uint8_t)); - libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_generate_keypair_08( + libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_generate_keypair_ec( copy_of_randomness, key_pair); } /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@1])#1} +K>[TraitClause@0])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_1c +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6c with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cca_unpacked_default_1c_fe(void) { +libcrux_ml_kem_ind_cca_unpacked_default_6c_05(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 lit; - lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); + lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); lit.public_key_hash[0U] = 0U; lit.public_key_hash[1U] = 0U; lit.public_key_hash[2U] = 0U; @@ -6943,19 +6949,19 @@ libcrux_ml_kem_ind_cca_unpacked_default_1c_fe(void) { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1])#3} +K>[TraitClause@0])#3} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_07 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6f with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked - libcrux_ml_kem_ind_cca_unpacked_default_07_27(void) { + libcrux_ml_kem_ind_cca_unpacked_default_6f_c3(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 uu____0; - uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); + uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); uu____0.implicit_rejection_value[0U] = 0U; uu____0.implicit_rejection_value[1U] = 0U; uu____0.implicit_rejection_value[2U] = 0U; @@ -6991,7 +6997,7 @@ static KRML_MUSTINLINE return (CLITERAL( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked){ .private_key = uu____0, - .public_key = libcrux_ml_kem_ind_cca_unpacked_default_1c_fe()}); + .public_key = libcrux_ml_kem_ind_cca_unpacked_default_6c_05()}); } /** @@ -6999,7 +7005,7 @@ static KRML_MUSTINLINE */ static inline libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked libcrux_ml_kem_mlkem768_portable_unpacked_init_key_pair(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_07_27(); + return libcrux_ml_kem_ind_cca_unpacked_default_6f_c3(); } /** @@ -7007,7 +7013,7 @@ libcrux_ml_kem_mlkem768_portable_unpacked_init_key_pair(void) { */ static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 libcrux_ml_kem_mlkem768_portable_unpacked_init_public_key(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_1c_fe(); + return libcrux_ml_kem_ind_cca_unpacked_default_6c_05(); } /** @@ -7016,21 +7022,21 @@ libcrux_ml_kem_mlkem768_portable_unpacked_init_public_key(void) { /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@1]} +K>[TraitClause@0]} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_dd with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_a6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_c8( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cpa_serialize_public_key_mut_1d( + libcrux_ml_kem_ind_cpa_serialize_public_key_mut_0d( self->ind_cpa_public_key.t_as_ntt, Eurydice_array_to_slice((size_t)32U, self->ind_cpa_public_key.seed_for_A, uint8_t), @@ -7043,21 +7049,21 @@ libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_c8( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1]#2} +K>[TraitClause@0]#2} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_de with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_05 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_a6( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_6b( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_c8( + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d( &self->public_key, serialized); } @@ -7068,23 +7074,23 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_key_pair_serialized_public_key( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_a6(key_pair, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_6b(key_pair, serialized); } /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0, TraitClause@2])#2} +K>[TraitClause@1])#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_ef +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_d6 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_clone_ef_99( +libcrux_ml_kem_ind_cpa_unpacked_clone_d6_25( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( @@ -7111,20 +7117,20 @@ libcrux_ml_kem_ind_cpa_unpacked_clone_ef_99( /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0, TraitClause@2])#4} +K>[TraitClause@1])#4} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_28 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_c7 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cca_unpacked_clone_28_b4( +libcrux_ml_kem_ind_cca_unpacked_clone_c7_e5( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *self) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 lit; lit.ind_cpa_public_key = - libcrux_ml_kem_ind_cpa_unpacked_clone_ef_99(&self->ind_cpa_public_key); + libcrux_ml_kem_ind_cpa_unpacked_clone_d6_25(&self->ind_cpa_public_key); uint8_t ret[32U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( (size_t)32U, self->public_key_hash, ret, uint8_t, void *); @@ -7138,16 +7144,16 @@ libcrux_ml_kem_ind_cca_unpacked_clone_28_b4( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0, TraitClause@1]#2} +K>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_de +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_05 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 * -libcrux_ml_kem_ind_cca_unpacked_public_key_de_52( +libcrux_ml_kem_ind_cca_unpacked_public_key_05_7e( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *self) { return &self->public_key; } @@ -7159,8 +7165,8 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_public_key( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *pk) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 uu____0 = - libcrux_ml_kem_ind_cca_unpacked_clone_28_b4( - libcrux_ml_kem_ind_cca_unpacked_public_key_de_52(key_pair)); + libcrux_ml_kem_ind_cca_unpacked_clone_c7_e5( + libcrux_ml_kem_ind_cca_unpacked_public_key_05_7e(key_pair)); pk[0U] = uu____0; } @@ -7171,7 +7177,7 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_serialized_public_key( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *public_key, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_c8(public_key, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d(public_key, serialized); } @@ -7194,7 +7200,7 @@ libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_40( *unpacked_public_key) { Eurydice_slice uu____0 = Eurydice_array_to_subslice_to( (size_t)1184U, public_key->value, (size_t)1152U, uint8_t, size_t); - libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_22( + libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( uu____0, unpacked_public_key->ind_cpa_public_key.t_as_ntt); uint8_t uu____1[32U]; libcrux_ml_kem_utils_into_padded_array_423( @@ -7214,7 +7220,7 @@ libcrux_ml_kem_ind_cca_unpacked_unpack_public_key_40( uint8_t uu____3[32U]; libcrux_ml_kem_hash_functions_portable_H_f1_c6( Eurydice_array_to_slice((size_t)1184U, - libcrux_ml_kem_types_as_slice_fd_e0(public_key), + libcrux_ml_kem_types_as_slice_fd_0e(public_key), uint8_t), uu____3); memcpy(unpacked_public_key->public_key_hash, uu____3, @@ -7234,7 +7240,7 @@ const generics - PUBLIC_KEY_SIZE= 1184 */ static inline void -libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_unpack_public_key_fa( +libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_unpack_public_key_ee( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *unpacked_public_key) { @@ -7250,7 +7256,7 @@ libcrux_ml_kem_mlkem768_portable_unpacked_unpacked_public_key( libcrux_ml_kem_types_MlKemPublicKey_15 *public_key, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *unpacked_public_key) { - libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_unpack_public_key_fa( + libcrux_ml_kem_ind_cca_instantiations_portable_unpacked_unpack_public_key_ee( public_key, unpacked_public_key); } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h index 0ae3513dd..1fe947eb8 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_mlkem768_portable_types_H @@ -20,18 +20,37 @@ extern "C" { #include "eurydice_glue.h" -typedef struct libcrux_ml_kem_vector_portable_vector_type_PortableVector_s { - int16_t elements[16U]; -} libcrux_ml_kem_vector_portable_vector_type_PortableVector; +typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 + libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768PublicKeyUnpacked; + +typedef struct + libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked_s { + libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 private_key; + libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 public_key; +} libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked; /** -A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked with types libcrux_ml_kem_vector_portable_vector_type_PortableVector +with const generics +- $3size_t +*/ +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 ind_cpa_public_key; + uint8_t public_key_hash[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8; +/** +A monomorphic instance of +libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types +libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics +- $3size_t */ -typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_f0_s { - libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients[16U]; -} libcrux_ml_kem_polynomial_PolynomialRingElement_f0; +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 + ind_cpa_private_key; + uint8_t implicit_rejection_value[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8; /** A monomorphic instance of @@ -45,20 +64,6 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8_s { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 A[3U][3U]; } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8; -/** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked -with types libcrux_ml_kem_vector_portable_vector_type_PortableVector -with const generics -- $3size_t -*/ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 ind_cpa_public_key; - uint8_t public_key_hash[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8; - -typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 - libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768PublicKeyUnpacked; - /** A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.IndCpaPrivateKeyUnpacked with types @@ -70,22 +75,17 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8_s { } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8; /** -A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types -libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics -- $3size_t +A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement +with types libcrux_ml_kem_vector_portable_vector_type_PortableVector + */ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 - ind_cpa_private_key; - uint8_t implicit_rejection_value[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8; +typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_f0_s { + libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients[16U]; +} libcrux_ml_kem_polynomial_PolynomialRingElement_f0; -typedef struct - libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked_s { - libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 private_key; - libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 public_key; -} libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked; +typedef struct libcrux_ml_kem_vector_portable_vector_type_PortableVector_s { + int16_t elements[16U]; +} libcrux_ml_kem_vector_portable_vector_type_PortableVector; #if defined(__cplusplus) } diff --git a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h index 7c68c3394..641b2bad1 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_avx2_H @@ -212,17 +212,17 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_29_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0, TraitClause@1]#1} +N>[TraitClause@0]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_89 +A monomorphic instance of libcrux_sha3.generic_keccak.new_1e with types core_core_arch_x86___m256i with const generics - N= 4 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 -libcrux_sha3_generic_keccak_new_89_71(void) { +libcrux_sha3_generic_keccak_new_1e_71(void) { libcrux_sha3_generic_keccak_KeccakState_29 lit; lit.st[0U][0U] = libcrux_sha3_simd_avx2_zero_ef(); lit.st[0U][1U] = libcrux_sha3_simd_avx2_zero_ef(); @@ -1964,7 +1964,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_b9( Eurydice_slice data[4U], Eurydice_slice out[4U]) { libcrux_sha3_generic_keccak_KeccakState_29 s = - libcrux_sha3_generic_keccak_new_89_71(); + libcrux_sha3_generic_keccak_new_1e_71(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2005,7 +2005,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_b9( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2048,7 +2048,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_29 KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 libcrux_sha3_avx2_x4_incremental_init(void) { - return libcrux_sha3_generic_keccak_new_89_71(); + return libcrux_sha3_generic_keccak_new_1e_71(); } /** diff --git a/libcrux-ml-kem/cg/libcrux_sha3_portable.h b/libcrux-ml-kem/cg/libcrux_sha3_portable.h index 52282e41f..bfa447a0c 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_portable.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 - * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 - * F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty - * Libcrux: 2cc5d08dc51d9011b73e45fa933da711162d0d01 + * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d + * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 + * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd + * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d */ #ifndef __libcrux_sha3_portable_H @@ -192,16 +192,16 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_48_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0, TraitClause@1]#1} +N>[TraitClause@0]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_89 +A monomorphic instance of libcrux_sha3.generic_keccak.new_1e with types uint64_t with const generics - N= 1 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 -libcrux_sha3_generic_keccak_new_89_cf(void) { +libcrux_sha3_generic_keccak_new_1e_cf(void) { libcrux_sha3_generic_keccak_KeccakState_48 lit; lit.st[0U][0U] = libcrux_sha3_portable_keccak_zero_5a(); lit.st[0U][1U] = libcrux_sha3_portable_keccak_zero_5a(); @@ -247,7 +247,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_65( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, uu____0); + unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1582,7 +1582,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)72U; i++) { size_t i0 = i; @@ -1623,7 +1623,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -1684,7 +1684,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_650( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, uu____0); + unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1941,7 +1941,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -1982,7 +1982,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2069,7 +2069,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2110,7 +2110,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2163,7 +2163,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_48 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake128_init(void) { - return libcrux_sha3_generic_keccak_new_89_cf(); + return libcrux_sha3_generic_keccak_new_1e_cf(); } /** @@ -2182,7 +2182,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_651( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, uu____0); + unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2419,7 +2419,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_652( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, uu____0); + unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2676,7 +2676,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)144U; i++) { size_t i0 = i; @@ -2717,7 +2717,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2778,7 +2778,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_653( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_26_0e(dst, uu____0); + unwrap_41_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -3035,7 +3035,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)104U; i++) { size_t i0 = i; @@ -3076,7 +3076,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -3331,7 +3331,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_89_cf(); + libcrux_sha3_generic_keccak_new_1e_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)168U; i++) { size_t i0 = i; @@ -3372,7 +3372,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -3671,7 +3671,7 @@ libcrux_sha3_portable_incremental_shake256_absorb_final( */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake256_init(void) { - return libcrux_sha3_generic_keccak_new_89_cf(); + return libcrux_sha3_generic_keccak_new_1e_cf(); } /** @@ -3722,16 +3722,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -3756,16 +3756,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3773,7 +3773,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_8b_15(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_9d_15(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3826,16 +3826,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3843,7 +3843,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3872,7 +3872,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} static inline void libcrux_sha3_portable_incremental_absorb_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_8b_45(self, buf); + libcrux_sha3_generic_keccak_absorb_9d_45(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_4f @@ -3886,17 +3886,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3904,7 +3904,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3951,7 +3951,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_absorb_final_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_8b_b6(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_9d_b6(&self, buf); return self; } @@ -3960,16 +3960,16 @@ libcrux_sha3_portable_incremental_absorb_final_7d( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( +static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( uint8_t ret[136U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -4114,21 +4114,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_8b +A monomorphic instance of libcrux_sha3.generic_keccak.new_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f -libcrux_sha3_generic_keccak_new_8b_47(void) { +libcrux_sha3_generic_keccak_new_9d_47(void) { libcrux_sha3_generic_keccak_KeccakXofState_4f lit; - lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); uint8_t ret[136U]; - libcrux_sha3_generic_keccak_zero_block_8b_5e(ret); + libcrux_sha3_generic_keccak_zero_block_9d_5e(ret); memcpy(lit.buf[0U], ret, (size_t)136U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -4145,7 +4145,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_new_7d(void) { - return libcrux_sha3_generic_keccak_new_8b_47(); + return libcrux_sha3_generic_keccak_new_9d_47(); } /** @@ -4176,16 +4176,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -4210,16 +4210,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4227,7 +4227,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_8b_150(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_9d_150(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4280,16 +4280,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4297,7 +4297,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4323,7 +4323,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} static inline void libcrux_sha3_portable_incremental_absorb_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_8b_450(self, buf); + libcrux_sha3_generic_keccak_absorb_9d_450(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_78 @@ -4337,17 +4337,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4355,7 +4355,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4399,7 +4399,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_absorb_final_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_8b_b60(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_9d_b60(&self, buf); return self; } @@ -4408,16 +4408,16 @@ libcrux_sha3_portable_incremental_absorb_final_1c( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( +static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( uint8_t ret[168U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -4594,21 +4594,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_8b +A monomorphic instance of libcrux_sha3.generic_keccak.new_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 -libcrux_sha3_generic_keccak_new_8b_470(void) { +libcrux_sha3_generic_keccak_new_9d_470(void) { libcrux_sha3_generic_keccak_KeccakXofState_78 lit; - lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); uint8_t ret[168U]; - libcrux_sha3_generic_keccak_zero_block_8b_5e0(ret); + libcrux_sha3_generic_keccak_zero_block_9d_5e0(ret); memcpy(lit.buf[0U], ret, (size_t)168U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -4622,7 +4622,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_new_1c(void) { - return libcrux_sha3_generic_keccak_new_8b_470(); + return libcrux_sha3_generic_keccak_new_9d_470(); } /** @@ -4669,16 +4669,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_81( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -4706,7 +4706,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -4741,7 +4741,7 @@ libcrux_sha3::portable::incremental::Shake256Squeeze)#3} static inline void libcrux_sha3_portable_incremental_squeeze_8a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_8b_ba(self, buf); + libcrux_sha3_generic_keccak_squeeze_9d_ba(self, buf); } /** @@ -4788,16 +4788,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_810( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0, TraitClause@1]#2} +PARALLEL_LANES, RATE>[TraitClause@0]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -4825,7 +4825,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -4860,7 +4860,7 @@ libcrux_sha3::portable::incremental::Shake128Squeeze)#1} static inline void libcrux_sha3_portable_incremental_squeeze_10( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_8b_ba0(self, buf); + libcrux_sha3_generic_keccak_squeeze_9d_ba0(self, buf); } /** From ff16b9e8164d0fd89efabd103d4a6c874df0c127 Mon Sep 17 00:00:00 2001 From: karthikbhargavan Date: Tue, 24 Sep 2024 14:34:21 +0000 Subject: [PATCH 13/14] c regen --- libcrux-ml-kem/cg/code_gen.txt | 8 +- libcrux-ml-kem/cg/eurydice_glue.h | 1 - libcrux-ml-kem/cg/libcrux_core.h | 50 +-- libcrux-ml-kem/cg/libcrux_ct_ops.h | 8 +- libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h | 294 +++++++++--------- .../cg/libcrux_mlkem768_avx2_types.h | 72 ++--- libcrux-ml-kem/cg/libcrux_mlkem768_portable.h | 288 ++++++++--------- .../cg/libcrux_mlkem768_portable_types.h | 78 ++--- libcrux-ml-kem/cg/libcrux_sha3_avx2.h | 20 +- libcrux-ml-kem/cg/libcrux_sha3_portable.h | 176 +++++------ 10 files changed, 510 insertions(+), 485 deletions(-) diff --git a/libcrux-ml-kem/cg/code_gen.txt b/libcrux-ml-kem/cg/code_gen.txt index 21d1a541d..cfb1412a1 100644 --- a/libcrux-ml-kem/cg/code_gen.txt +++ b/libcrux-ml-kem/cg/code_gen.txt @@ -1,6 +1,6 @@ This code was generated with the following revisions: -Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d -Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 -Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 +Charon: 1bd0af95285033fec42133810440d56977c17ade +Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac +Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd -Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d +Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 diff --git a/libcrux-ml-kem/cg/eurydice_glue.h b/libcrux-ml-kem/cg/eurydice_glue.h index 30a7c281d..1e2772eba 100644 --- a/libcrux-ml-kem/cg/eurydice_glue.h +++ b/libcrux-ml-kem/cg/eurydice_glue.h @@ -19,7 +19,6 @@ extern "C" { #include "karamel/target.h" -// Ignore an expression. #define LowStar_Ignore_ignore(e, t, _ret_t) ((void)e) // SLICES, ARRAYS, ETC. diff --git a/libcrux-ml-kem/cg/libcrux_core.h b/libcrux-ml-kem/cg/libcrux_core.h index a68cda013..c34810389 100644 --- a/libcrux-ml-kem/cg/libcrux_core.h +++ b/libcrux-ml-kem/cg/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_core_H @@ -97,14 +97,15 @@ typedef struct Result_6f_s { } Result_6f; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[24size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_76(Result_6f self, uint8_t ret[24U]) { +static inline void unwrap_26_76(Result_6f self, uint8_t ret[24U]) { if (self.tag == Ok) { uint8_t f0[24U]; memcpy(f0, self.val.case_Ok, (size_t)24U * sizeof(uint8_t)); @@ -130,14 +131,15 @@ typedef struct Result_7a_s { } Result_7a; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[20size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_ea(Result_7a self, uint8_t ret[20U]) { +static inline void unwrap_26_ea(Result_7a self, uint8_t ret[20U]) { if (self.tag == Ok) { uint8_t f0[20U]; memcpy(f0, self.val.case_Ok, (size_t)20U * sizeof(uint8_t)); @@ -163,14 +165,15 @@ typedef struct Result_cd_s { } Result_cd; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[10size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_07(Result_cd self, uint8_t ret[10U]) { +static inline void unwrap_26_07(Result_cd self, uint8_t ret[10U]) { if (self.tag == Ok) { uint8_t f0[10U]; memcpy(f0, self.val.case_Ok, (size_t)10U * sizeof(uint8_t)); @@ -315,14 +318,15 @@ typedef struct Result_00_s { } Result_00; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[32size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_33(Result_00 self, uint8_t ret[32U]) { +static inline void unwrap_26_33(Result_00 self, uint8_t ret[32U]) { if (self.tag == Ok) { uint8_t f0[32U]; memcpy(f0, self.val.case_Ok, (size_t)32U * sizeof(uint8_t)); @@ -481,14 +485,15 @@ typedef struct Result_c0_s { } Result_c0; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types int16_t[16size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_30(Result_c0 self, int16_t ret[16U]) { +static inline void unwrap_26_30(Result_c0 self, int16_t ret[16U]) { if (self.tag == Ok) { int16_t f0[16U]; memcpy(f0, self.val.case_Ok, (size_t)16U * sizeof(int16_t)); @@ -514,14 +519,15 @@ typedef struct Result_56_s { } Result_56; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[8size_t], core_array_TryFromSliceError */ -static inline void unwrap_41_0e(Result_56 self, uint8_t ret[8U]) { +static inline void unwrap_26_0e(Result_56 self, uint8_t ret[8U]) { if (self.tag == Ok) { uint8_t f0[8U]; memcpy(f0, self.val.case_Ok, (size_t)8U * sizeof(uint8_t)); diff --git a/libcrux-ml-kem/cg/libcrux_ct_ops.h b/libcrux-ml-kem/cg/libcrux_ct_ops.h index 525ed90e5..8d410ee3b 100644 --- a/libcrux-ml-kem/cg/libcrux_ct_ops.h +++ b/libcrux-ml-kem/cg/libcrux_ct_ops.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_ct_ops_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h index d84185894..af0f83010 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_mlkem768_avx2_H @@ -723,7 +723,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_4( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, ret0); + unwrap_26_0e(dst, ret0); memcpy(ret, ret0, (size_t)8U * sizeof(uint8_t)); } @@ -823,7 +823,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_5( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)10U, uint8_t), Eurydice_slice, uint8_t[10U]); - unwrap_41_07(dst, ret0); + unwrap_26_07(dst, ret0); memcpy(ret, ret0, (size_t)10U * sizeof(uint8_t)); } @@ -936,7 +936,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_10( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)20U, uint8_t), Eurydice_slice, uint8_t[20U]); - unwrap_41_ea(dst, ret0); + unwrap_26_ea(dst, ret0); memcpy(ret, ret0, (size_t)20U * sizeof(uint8_t)); } @@ -1081,7 +1081,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_12( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)24U, uint8_t), Eurydice_slice, uint8_t[24U]); - unwrap_41_76(dst, ret0); + unwrap_26_76(dst, ret0); memcpy(ret, ret0, (size_t)24U * sizeof(uint8_t)); } @@ -1196,17 +1196,18 @@ static inline size_t libcrux_ml_kem_vector_avx2_rej_sample_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_ZERO_20_7d(void) { +libcrux_ml_kem_polynomial_ZERO_ef_7d(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_avx2_ZERO_09(); lit.coefficients[1U] = libcrux_ml_kem_vector_avx2_ZERO_09(); @@ -1236,7 +1237,7 @@ with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_b0(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -1250,7 +1251,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_60( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -1273,7 +1274,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_33( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / @@ -1310,7 +1311,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_e9(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -1390,7 +1391,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_then_decompress_10_d9( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice((size_t)16U, re.coefficients, __m256i), @@ -1486,7 +1487,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_then_decompress_11_5d( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -1641,16 +1642,17 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_at_layer_1_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -1684,7 +1686,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_88( (size_t)6U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_09(&zeta_i, re, (size_t)1U, (size_t)7U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); } /** @@ -1702,7 +1704,7 @@ libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_37( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len( @@ -1808,7 +1810,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_then_decompress_4_2e( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -1899,7 +1901,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_then_decompress_5_d5( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -1928,21 +1930,22 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_51( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_ntt_multiply_20_63( +libcrux_ml_kem_polynomial_ntt_multiply_ef_63( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -1961,16 +1964,17 @@ libcrux_ml_kem_polynomial_ntt_multiply_20_63( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_20_31( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_ef_31( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -2125,22 +2129,23 @@ static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05( (size_t)6U); libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_7c(&zeta_i, re, (size_t)7U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_subtract_reduce_20_6f( +libcrux_ml_kem_polynomial_subtract_reduce_ef_6f( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 b) { for (size_t i = (size_t)0U; @@ -2169,16 +2174,16 @@ libcrux_ml_kem_matrix_compute_message_74( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_63(&secret_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result, &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result); - result = libcrux_ml_kem_polynomial_subtract_reduce_20_6f(v, result); + result = libcrux_ml_kem_polynomial_subtract_reduce_ef_6f(v, result); return result; } @@ -2372,20 +2377,20 @@ static KRML_MUSTINLINE void libcrux_ml_kem_hash_functions_avx2_PRF_a9_42( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_default_85_80(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - uu____0[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + uu____0[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } uint8_t uu____1[32U] = {0U}; libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 lit; @@ -2393,15 +2398,15 @@ libcrux_ml_kem_ind_cpa_unpacked_default_85_80(void) { lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); return lit; } @@ -2416,7 +2421,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_5a( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2772,19 +2777,20 @@ libcrux_ml_kem_sampling_sample_from_uniform_distribution_next_740( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_from_i16_array_20_14(Eurydice_slice a) { +libcrux_ml_kem_polynomial_from_i16_array_ef_14(Eurydice_slice a) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -2804,7 +2810,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_sampling_sample_from_xof_closure_e4(int16_t s[272U]) { - return libcrux_ml_kem_polynomial_from_i16_array_20_14( + return libcrux_ml_kem_polynomial_from_i16_array_ef_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -2932,7 +2938,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_closure_2d(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -3029,7 +3035,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_2_80( sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_20_14( + return libcrux_ml_kem_polynomial_from_i16_array_ef_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3075,7 +3081,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_3_05( sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_20_14( + return libcrux_ml_kem_polynomial_from_i16_array_ef_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3138,7 +3144,7 @@ libcrux_ml_kem_ntt_ntt_binomially_sampled_ring_element_5c( &zeta_i, re, (size_t)2U, (size_t)11207U + (size_t)4U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_09( &zeta_i, re, (size_t)1U, (size_t)11207U + (size_t)5U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_09(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_09(re); } /** @@ -3192,7 +3198,7 @@ libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_d7( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; @@ -3223,7 +3229,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_93(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -3240,7 +3246,7 @@ libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_66(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - error_1[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + error_1[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; @@ -3315,21 +3321,22 @@ with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_matrix_compute_vector_u_closure_83(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_20_9e( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_ef_9e( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -3358,7 +3365,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_38( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - result0[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + result0[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( @@ -3379,12 +3386,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_38( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_63(a_element, &r_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result0[i1], + libcrux_ml_kem_polynomial_ntt_multiply_ef_63(a_element, &r_as_ntt[j]); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result0[i1], &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result0[i1]); - libcrux_ml_kem_polynomial_add_error_reduce_20_9e(&result0[i1], + libcrux_ml_kem_polynomial_add_error_reduce_ef_9e(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[3U]; @@ -3422,7 +3429,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_then_decompress_message_03( uint8_t serialized[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; __m256i coefficient_compressed = @@ -3437,17 +3444,18 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_message_03( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_add_message_error_reduce_20_c6( +libcrux_ml_kem_polynomial_add_message_error_reduce_ef_c6( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result) { @@ -3481,16 +3489,16 @@ libcrux_ml_kem_matrix_compute_ring_element_v_af( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_63(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&result, &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_05(&result); - result = libcrux_ml_kem_polynomial_add_message_error_reduce_20_c6( + result = libcrux_ml_kem_polynomial_add_message_error_reduce_ef_c6( error_2, message, result); return result; } @@ -4042,7 +4050,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_65(Eurydice_slice public_key, Eurydice_slice randomness, uint8_t ret[1088U]) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 - unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); + unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -4385,21 +4393,21 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_avx2_encapsulate( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(void) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 lit; - lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); - lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); + lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); return lit; } @@ -4445,17 +4453,18 @@ static inline __m256i libcrux_ml_kem_vector_traits_to_standard_domain_c1( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_polynomial_add_standard_error_reduce_20_ba( +libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_ba( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -4492,7 +4501,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_67( size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_polynomial_ZERO_20_7d(); + libcrux_ml_kem_polynomial_ZERO_ef_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -4505,12 +4514,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_67( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_63(matrix_element, + libcrux_ml_kem_polynomial_ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_31(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_add_to_ring_element_ef_31(&t_as_ntt[i0], &product); } - libcrux_ml_kem_polynomial_add_standard_error_reduce_20_ba( + libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_ba( &t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -4568,7 +4577,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____5); + unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -4693,9 +4702,9 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 libcrux_ml_kem_ind_cpa_generate_keypair_1e(Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); + libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); + libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; @@ -5243,7 +5252,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a0( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____5); + unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5264,9 +5273,9 @@ static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 libcrux_ml_kem_ind_cpa_generate_keypair_1e0( Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); + libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); + libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_4a0( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; @@ -5441,7 +5450,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_3d( size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -5457,7 +5466,7 @@ libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_d1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_3b( public_key, deserialized_pk); @@ -5791,7 +5800,7 @@ with const generics KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_b2(size_t _j) { - return libcrux_ml_kem_polynomial_ZERO_20_7d(); + return libcrux_ml_kem_polynomial_ZERO_ef_7d(); } /** @@ -5812,23 +5821,24 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_64( size_t _i, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - ret[i] = libcrux_ml_kem_polynomial_ZERO_20_7d(); + ret[i] = libcrux_ml_kem_polynomial_ZERO_ef_7d(); } } /** This function found in impl {(core::clone::Clone for -libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@1])} +libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@2])} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.clone_3a +A monomorphic instance of libcrux_ml_kem.polynomial.clone_8d with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -libcrux_ml_kem_polynomial_clone_3a_d3( +libcrux_ml_kem_polynomial_clone_8d_d3( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; __m256i ret[16U]; @@ -5877,7 +5887,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_98( for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = - libcrux_ml_kem_polynomial_clone_3a_d3( + libcrux_ml_kem_polynomial_clone_8d_d3( &out->public_key.ind_cpa_public_key.A[j][i1]); A[i1][j] = uu____0; } @@ -5904,7 +5914,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_98( Result_00 dst; Eurydice_slice_to_array2(&dst, implicit_rejection_value, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____3); + unwrap_26_33(dst, uu____3); memcpy(out->private_key.implicit_rejection_value, uu____3, (size_t)32U * sizeof(uint8_t)); } @@ -5952,19 +5962,19 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_generate_key_pair( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6c +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_1c with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cca_unpacked_default_6c_c5(void) { +libcrux_ml_kem_ind_cca_unpacked_default_1c_c5(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 lit; - lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_80(); + lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_80(); lit.public_key_hash[0U] = 0U; lit.public_key_hash[1U] = 0U; lit.public_key_hash[2U] = 0U; @@ -6003,10 +6013,10 @@ libcrux_ml_kem_ind_cca_unpacked_default_6c_c5(void) { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0])#3} +K>[TraitClause@0, TraitClause@1])#3} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6f +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_07 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 @@ -6014,9 +6024,9 @@ with const generics KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked - libcrux_ml_kem_ind_cca_unpacked_default_6f_bb(void) { + libcrux_ml_kem_ind_cca_unpacked_default_07_bb(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 uu____0; - uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_f6_19(); + uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_1a_19(); uu____0.implicit_rejection_value[0U] = 0U; uu____0.implicit_rejection_value[1U] = 0U; uu____0.implicit_rejection_value[2U] = 0U; @@ -6052,7 +6062,7 @@ static KRML_MUSTINLINE return ( CLITERAL(libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked){ .private_key = uu____0, - .public_key = libcrux_ml_kem_ind_cca_unpacked_default_6c_c5()}); + .public_key = libcrux_ml_kem_ind_cca_unpacked_default_1c_c5()}); } /** @@ -6061,7 +6071,7 @@ static KRML_MUSTINLINE KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked libcrux_ml_kem_mlkem768_avx2_unpacked_init_key_pair(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_6f_bb(); + return libcrux_ml_kem_ind_cca_unpacked_default_07_bb(); } /** @@ -6070,7 +6080,7 @@ libcrux_ml_kem_mlkem768_avx2_unpacked_init_key_pair(void) { KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 libcrux_ml_kem_mlkem768_avx2_unpacked_init_public_key(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_6c_c5(); + return libcrux_ml_kem_ind_cca_unpacked_default_1c_c5(); } /** @@ -6079,11 +6089,11 @@ libcrux_ml_kem_mlkem768_avx2_unpacked_init_public_key(void) { /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0]} +K>[TraitClause@0, TraitClause@1]} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_a6 with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_dd with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 @@ -6091,7 +6101,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_7b( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { libcrux_ml_kem_ind_cpa_serialize_public_key_mut_7b( @@ -6107,11 +6117,11 @@ libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0]#2} +K>[TraitClause@0, TraitClause@1]#2} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_05 with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_de with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 @@ -6119,10 +6129,10 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_b6( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_b6( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b( + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_7b( &self->public_key, serialized); } @@ -6134,24 +6144,24 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_key_pair_serialized_public_key( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_b6(key_pair, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_b6(key_pair, serialized); } /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@1])#2} +K>[TraitClause@0, TraitClause@2])#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_d6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cpa_unpacked_clone_d6_0d( +libcrux_ml_kem_ind_cpa_unpacked_clone_ef_0d( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( @@ -6178,21 +6188,21 @@ libcrux_ml_kem_ind_cpa_unpacked_clone_d6_0d( /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@1])#4} +K>[TraitClause@0, TraitClause@2])#4} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_c7 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_28 with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 -libcrux_ml_kem_ind_cca_unpacked_clone_c7_56( +libcrux_ml_kem_ind_cca_unpacked_clone_28_56( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *self) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 lit; lit.ind_cpa_public_key = - libcrux_ml_kem_ind_cpa_unpacked_clone_d6_0d(&self->ind_cpa_public_key); + libcrux_ml_kem_ind_cpa_unpacked_clone_ef_0d(&self->ind_cpa_public_key); uint8_t ret[32U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( (size_t)32U, self->public_key_hash, ret, uint8_t, void *); @@ -6206,17 +6216,17 @@ libcrux_ml_kem_ind_cca_unpacked_clone_c7_56( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0]#2} +K>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_05 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_de with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 * -libcrux_ml_kem_ind_cca_unpacked_public_key_05_e2( +libcrux_ml_kem_ind_cca_unpacked_public_key_de_e2( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *self) { return &self->public_key; } @@ -6229,8 +6239,8 @@ static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_public_key( libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *pk) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 uu____0 = - libcrux_ml_kem_ind_cca_unpacked_clone_c7_56( - libcrux_ml_kem_ind_cca_unpacked_public_key_05_e2(key_pair)); + libcrux_ml_kem_ind_cca_unpacked_clone_28_56( + libcrux_ml_kem_ind_cca_unpacked_public_key_de_e2(key_pair)); pk[0U] = uu____0; } @@ -6241,7 +6251,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static inline void libcrux_ml_kem_mlkem768_avx2_unpacked_serialized_public_key( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 *public_key, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_7b(public_key, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_7b(public_key, serialized); } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h index 80dd501f6..25b048abc 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_mlkem768_avx2_types_H @@ -20,36 +20,16 @@ extern "C" { #include "eurydice_glue.h" -typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 - libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768PublicKeyUnpacked; - -typedef struct libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked_s { - libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 private_key; - libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 public_key; -} libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked; +typedef __m256i libcrux_ml_kem_vector_avx2_SIMD256Vector; /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked +A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement with types libcrux_ml_kem_vector_avx2_SIMD256Vector -with const generics -- $3size_t -*/ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 ind_cpa_public_key; - uint8_t public_key_hash[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0; -/** -A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types -libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics -- $3size_t */ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 - ind_cpa_private_key; - uint8_t implicit_rejection_value[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0; +typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_d2_s { + __m256i coefficients[16U]; +} libcrux_ml_kem_polynomial_PolynomialRingElement_d2; /** A monomorphic instance of @@ -63,6 +43,20 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0_s { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 A[3U][3U]; } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0; +/** +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked +with types libcrux_ml_kem_vector_avx2_SIMD256Vector +with const generics +- $3size_t +*/ +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_a0 ind_cpa_public_key; + uint8_t public_key_hash[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0; + +typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 + libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768PublicKeyUnpacked; + /** A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.IndCpaPrivateKeyUnpacked with types @@ -74,15 +68,21 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0_s { } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0; /** -A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement -with types libcrux_ml_kem_vector_avx2_SIMD256Vector - +A monomorphic instance of +libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types +libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics +- $3size_t */ -typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_d2_s { - __m256i coefficients[16U]; -} libcrux_ml_kem_polynomial_PolynomialRingElement_d2; +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_a0 + ind_cpa_private_key; + uint8_t implicit_rejection_value[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0; -typedef __m256i libcrux_ml_kem_vector_avx2_SIMD256Vector; +typedef struct libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked_s { + libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_a0 private_key; + libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_a0 public_key; +} libcrux_ml_kem_mlkem768_avx2_unpacked_MlKem768KeyPairUnpacked; #if defined(__cplusplus) } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h index aac1ad359..ded408c91 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_mlkem768_portable_H @@ -115,7 +115,7 @@ libcrux_ml_kem_vector_portable_vector_type_from_i16_array( Eurydice_slice_to_array2( &dst, Eurydice_slice_subslice2(array, (size_t)0U, (size_t)16U, int16_t), Eurydice_slice, int16_t[16U]); - unwrap_41_30(dst, ret); + unwrap_26_30(dst, ret); memcpy(lit.elements, ret, (size_t)16U * sizeof(int16_t)); return lit; } @@ -2448,16 +2448,17 @@ typedef libcrux_ml_kem_types_MlKemPublicKey_15 /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_ZERO_20_19(void) { +libcrux_ml_kem_polynomial_ZERO_ef_19(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_portable_ZERO_0d(); lit.coefficients[1U] = libcrux_ml_kem_vector_portable_ZERO_0d(); @@ -2486,7 +2487,7 @@ with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cpa_deserialize_secret_key_closure_75(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -2499,7 +2500,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_to_uncompressed_ring_element_8f( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2523,7 +2524,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ind_cpa_deserialize_secret_key_5f( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + secret_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / @@ -2559,7 +2560,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_closure_ef(size_t _) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -2610,7 +2611,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_then_decompress_10_38( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice( @@ -2681,7 +2682,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_then_decompress_11_68( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -2844,15 +2845,16 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_at_layer_1_21( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -2887,7 +2889,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_ntt_ntt_vector_u_52( (size_t)6U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_21(&zeta_i, re, (size_t)1U, (size_t)7U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); } /** @@ -2904,7 +2906,7 @@ libcrux_ml_kem_ind_cpa_deserialize_then_decompress_u_f8( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + u_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } for (size_t i = (size_t)0U; i < Eurydice_slice_len( @@ -2981,7 +2983,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_then_decompress_4_d2( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -3045,7 +3047,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_then_decompress_5_57( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -3075,20 +3077,21 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_ring_element_v_32( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_ntt_multiply_20_76( +libcrux_ml_kem_polynomial_ntt_multiply_ef_76( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3109,15 +3112,16 @@ libcrux_ml_kem_polynomial_ntt_multiply_20_76( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_20_3a( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -3275,21 +3279,22 @@ static KRML_MUSTINLINE void libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea( (size_t)6U); libcrux_ml_kem_invert_ntt_invert_ntt_at_layer_4_plus_ce(&zeta_i, re, (size_t)7U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_subtract_reduce_20_2c( +libcrux_ml_kem_polynomial_subtract_reduce_ef_2c( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 b) { for (size_t i = (size_t)0U; @@ -3320,16 +3325,16 @@ libcrux_ml_kem_matrix_compute_message_dc( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_76(&secret_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result, &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result); - result = libcrux_ml_kem_polynomial_subtract_reduce_20_2c(v, result); + result = libcrux_ml_kem_polynomial_subtract_reduce_ef_2c(v, result); return result; } @@ -3529,19 +3534,19 @@ static KRML_MUSTINLINE void libcrux_ml_kem_hash_functions_portable_PRF_f1_9d( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - uu____0[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + uu____0[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } uint8_t uu____1[32U] = {0U}; libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 lit; @@ -3549,15 +3554,15 @@ libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(void) { lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.A[0U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[0U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[0U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[1U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[1U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[1U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[2U][0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[2U][1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.A[2U][2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); return lit; } @@ -3571,7 +3576,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_to_reduced_ring_element_c7( Eurydice_slice serialized) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -3917,18 +3922,19 @@ libcrux_ml_kem_sampling_sample_from_uniform_distribution_next_fb0( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_from_i16_array_20_bb(Eurydice_slice a) { +libcrux_ml_kem_polynomial_from_i16_array_ef_bb(Eurydice_slice a) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3950,7 +3956,7 @@ generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_sampling_sample_from_xof_closure_ba(int16_t s[272U]) { - return libcrux_ml_kem_polynomial_from_i16_array_20_bb( + return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -4078,7 +4084,7 @@ generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_closure_25(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -4156,7 +4162,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_2_1b( sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_20_bb( + return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -4201,7 +4207,7 @@ libcrux_ml_kem_sampling_sample_from_binomial_distribution_3_ee( sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return libcrux_ml_kem_polynomial_from_i16_array_20_bb( + return libcrux_ml_kem_polynomial_from_i16_array_ef_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -4263,7 +4269,7 @@ libcrux_ml_kem_ntt_ntt_binomially_sampled_ring_element_b3( &zeta_i, re, (size_t)2U, (size_t)11207U + (size_t)4U * (size_t)3328U); libcrux_ml_kem_ntt_ntt_at_layer_1_21( &zeta_i, re, (size_t)1U, (size_t)11207U + (size_t)5U * (size_t)3328U); - libcrux_ml_kem_polynomial_poly_barrett_reduce_20_0a(re); + libcrux_ml_kem_polynomial_poly_barrett_reduce_ef_0a(re); } /** @@ -4317,7 +4323,7 @@ libcrux_ml_kem_ind_cpa_sample_vector_cbd_then_ntt_out_44( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + re_as_ntt[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; @@ -4348,7 +4354,7 @@ generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_closure_ed(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -4365,7 +4371,7 @@ libcrux_ml_kem_ind_cpa_sample_ring_element_cbd_d6(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - error_1[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + error_1[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; @@ -4437,20 +4443,21 @@ with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_matrix_compute_vector_u_closure_4e(size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_20_33( +static KRML_MUSTINLINE void libcrux_ml_kem_polynomial_add_error_reduce_ef_33( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -4481,7 +4488,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_7b( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - result0[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + result0[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( @@ -4502,12 +4509,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_vector_u_7b( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_76(a_element, &r_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result0[i1], + libcrux_ml_kem_polynomial_ntt_multiply_ef_76(a_element, &r_as_ntt[j]); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result0[i1], &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result0[i1]); - libcrux_ml_kem_polynomial_add_error_reduce_20_33(&result0[i1], + libcrux_ml_kem_polynomial_add_error_reduce_ef_33(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[3U]; @@ -4548,7 +4555,7 @@ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_then_decompress_message_c4( uint8_t serialized[32U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < (size_t)16U; i++) { size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector @@ -4566,16 +4573,17 @@ libcrux_ml_kem_serialize_deserialize_then_decompress_message_c4( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_add_message_error_reduce_20_f0( +libcrux_ml_kem_polynomial_add_message_error_reduce_ef_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result) { @@ -4611,16 +4619,16 @@ libcrux_ml_kem_matrix_compute_ring_element_v_43( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_76(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&result, &product); + libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&result, &product); } libcrux_ml_kem_invert_ntt_invert_ntt_montgomery_ea(&result); - result = libcrux_ml_kem_polynomial_add_message_error_reduce_20_f0( + result = libcrux_ml_kem_polynomial_add_message_error_reduce_ef_f0( error_2, message, result); return result; } @@ -5029,7 +5037,7 @@ static inline void libcrux_ml_kem_ind_cpa_encrypt_3b(Eurydice_slice public_key, Eurydice_slice randomness, uint8_t ret[1088U]) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 - unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); + unpacked_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -5364,20 +5372,20 @@ static inline tuple_3c libcrux_ml_kem_mlkem768_portable_encapsulate( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(void) { +libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(void) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 lit; - lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_20_19(); - lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_20_19(); + lit.secret_as_ntt[0U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.secret_as_ntt[1U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); + lit.secret_as_ntt[2U] = libcrux_ml_kem_polynomial_ZERO_ef_19(); return lit; } @@ -5422,16 +5430,17 @@ libcrux_ml_kem_vector_traits_to_standard_domain_73( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE void -libcrux_ml_kem_polynomial_add_standard_error_reduce_20_69( +libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_69( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -5470,7 +5479,7 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_f0( size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_polynomial_ZERO_20_19(); + libcrux_ml_kem_polynomial_ZERO_ef_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -5483,12 +5492,12 @@ static KRML_MUSTINLINE void libcrux_ml_kem_matrix_compute_As_plus_e_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - libcrux_ml_kem_polynomial_ntt_multiply_20_76(matrix_element, + libcrux_ml_kem_polynomial_ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); - libcrux_ml_kem_polynomial_add_to_ring_element_20_3a(&t_as_ntt[i0], + libcrux_ml_kem_polynomial_add_to_ring_element_ef_3a(&t_as_ntt[i0], &product); } - libcrux_ml_kem_polynomial_add_standard_error_reduce_20_69( + libcrux_ml_kem_polynomial_add_standard_error_reduce_ef_69( &t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -5545,7 +5554,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_86( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____5); + unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5666,9 +5675,9 @@ libcrux_ml_kem_variant_MlKem with const generics static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 libcrux_ml_kem_ind_cpa_generate_keypair_79(Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); + libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); + libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_86( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; @@ -6205,7 +6214,7 @@ static inline void libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_860( uint8_t uu____5[32U]; Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____5); + unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6225,9 +6234,9 @@ static inline libcrux_ml_kem_utils_extraction_helper_Keypair768 libcrux_ml_kem_ind_cpa_generate_keypair_790( Eurydice_slice key_generation_seed) { libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 private_key = - libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); + libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 public_key = - libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); + libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); libcrux_ml_kem_ind_cpa_generate_keypair_unpacked_860( key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; @@ -6397,7 +6406,7 @@ generics static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_closure_8b( size_t _i) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -6412,7 +6421,7 @@ libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_out_7b( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + deserialized_pk[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } libcrux_ml_kem_serialize_deserialize_ring_elements_reduced_b2( public_key, deserialized_pk); @@ -6739,7 +6748,7 @@ libcrux_ml_kem_variant_MlKem with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_closure_95(size_t _j) { - return libcrux_ml_kem_polynomial_ZERO_20_19(); + return libcrux_ml_kem_polynomial_ZERO_ef_19(); } /** @@ -6759,22 +6768,23 @@ libcrux_ml_kem_variant_MlKem with const generics static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_closure_6b( size_t _i, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { for (size_t i = (size_t)0U; i < (size_t)3U; i++) { - ret[i] = libcrux_ml_kem_polynomial_ZERO_20_19(); + ret[i] = libcrux_ml_kem_polynomial_ZERO_ef_19(); } } /** This function found in impl {(core::clone::Clone for -libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@1])} +libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@2])} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.clone_3a +A monomorphic instance of libcrux_ml_kem.polynomial.clone_8d with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static inline libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -libcrux_ml_kem_polynomial_clone_3a_06( +libcrux_ml_kem_polynomial_clone_8d_06( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; libcrux_ml_kem_vector_portable_vector_type_PortableVector ret[16U]; @@ -6825,7 +6835,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_3b( for (size_t i = (size_t)0U; i < (size_t)3U; i++) { size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = - libcrux_ml_kem_polynomial_clone_3a_06( + libcrux_ml_kem_polynomial_clone_8d_06( &out->public_key.ind_cpa_public_key.A[j][i1]); A[i1][j] = uu____0; } @@ -6852,7 +6862,7 @@ static inline void libcrux_ml_kem_ind_cca_unpacked_generate_keypair_3b( Result_00 dst; Eurydice_slice_to_array2(&dst, implicit_rejection_value, Eurydice_slice, uint8_t[32U]); - unwrap_41_33(dst, uu____3); + unwrap_26_33(dst, uu____3); memcpy(out->private_key.implicit_rejection_value, uu____3, (size_t)32U * sizeof(uint8_t)); } @@ -6899,18 +6909,18 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_generate_key_pair( /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6c +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_1c with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cca_unpacked_default_6c_05(void) { +libcrux_ml_kem_ind_cca_unpacked_default_1c_05(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 lit; - lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_85_6b(); + lit.ind_cpa_public_key = libcrux_ml_kem_ind_cpa_unpacked_default_8d_6b(); lit.public_key_hash[0U] = 0U; lit.public_key_hash[1U] = 0U; lit.public_key_hash[2U] = 0U; @@ -6949,19 +6959,19 @@ libcrux_ml_kem_ind_cca_unpacked_default_6c_05(void) { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0])#3} +K>[TraitClause@0, TraitClause@1])#3} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_6f +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.default_07 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked - libcrux_ml_kem_ind_cca_unpacked_default_6f_c3(void) { + libcrux_ml_kem_ind_cca_unpacked_default_07_c3(void) { libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 uu____0; - uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_f6_a3(); + uu____0.ind_cpa_private_key = libcrux_ml_kem_ind_cpa_unpacked_default_1a_a3(); uu____0.implicit_rejection_value[0U] = 0U; uu____0.implicit_rejection_value[1U] = 0U; uu____0.implicit_rejection_value[2U] = 0U; @@ -6997,7 +7007,7 @@ static KRML_MUSTINLINE return (CLITERAL( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked){ .private_key = uu____0, - .public_key = libcrux_ml_kem_ind_cca_unpacked_default_6c_05()}); + .public_key = libcrux_ml_kem_ind_cca_unpacked_default_1c_05()}); } /** @@ -7005,7 +7015,7 @@ static KRML_MUSTINLINE */ static inline libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked libcrux_ml_kem_mlkem768_portable_unpacked_init_key_pair(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_6f_c3(); + return libcrux_ml_kem_ind_cca_unpacked_default_07_c3(); } /** @@ -7013,7 +7023,7 @@ libcrux_ml_kem_mlkem768_portable_unpacked_init_key_pair(void) { */ static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 libcrux_ml_kem_mlkem768_portable_unpacked_init_public_key(void) { - return libcrux_ml_kem_ind_cca_unpacked_default_6c_05(); + return libcrux_ml_kem_ind_cca_unpacked_default_1c_05(); } /** @@ -7022,18 +7032,18 @@ libcrux_ml_kem_mlkem768_portable_unpacked_init_public_key(void) { /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@0]} +K>[TraitClause@0, TraitClause@1]} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_a6 with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_dd with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_0d( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { libcrux_ml_kem_ind_cpa_serialize_public_key_mut_0d( @@ -7049,21 +7059,21 @@ libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0]#2} +K>[TraitClause@0, TraitClause@1]#2} */ /** A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_05 with types +libcrux_ml_kem.ind_cca.unpacked.serialized_public_key_mut_de with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 - RANKED_BYTES_PER_RING_ELEMENT= 1152 - PUBLIC_KEY_SIZE= 1184 */ static KRML_MUSTINLINE void -libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_6b( +libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_6b( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *self, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d( + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_0d( &self->public_key, serialized); } @@ -7074,23 +7084,23 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_key_pair_serialized_public_key( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_05_6b(key_pair, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_de_6b(key_pair, serialized); } /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@1])#2} +K>[TraitClause@0, TraitClause@2])#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_d6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.clone_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cpa_unpacked_clone_d6_25( +libcrux_ml_kem_ind_cpa_unpacked_clone_ef_25( libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 *self) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( @@ -7117,20 +7127,20 @@ libcrux_ml_kem_ind_cpa_unpacked_clone_d6_25( /** This function found in impl {(core::clone::Clone for libcrux_ml_kem::ind_cca::unpacked::MlKemPublicKeyUnpacked[TraitClause@1])#4} +K>[TraitClause@0, TraitClause@2])#4} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_c7 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.clone_28 with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static inline libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 -libcrux_ml_kem_ind_cca_unpacked_clone_c7_e5( +libcrux_ml_kem_ind_cca_unpacked_clone_28_e5( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *self) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 lit; lit.ind_cpa_public_key = - libcrux_ml_kem_ind_cpa_unpacked_clone_d6_25(&self->ind_cpa_public_key); + libcrux_ml_kem_ind_cpa_unpacked_clone_ef_25(&self->ind_cpa_public_key); uint8_t ret[32U]; core_array___core__clone__Clone_for__Array_T__N___20__clone( (size_t)32U, self->public_key_hash, ret, uint8_t, void *); @@ -7144,16 +7154,16 @@ libcrux_ml_kem_ind_cca_unpacked_clone_c7_e5( /** This function found in impl {libcrux_ml_kem::ind_cca::unpacked::MlKemKeyPairUnpacked[TraitClause@0]#2} +K>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_05 +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.public_key_de with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ static KRML_MUSTINLINE libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 * -libcrux_ml_kem_ind_cca_unpacked_public_key_05_7e( +libcrux_ml_kem_ind_cca_unpacked_public_key_de_7e( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *self) { return &self->public_key; } @@ -7165,8 +7175,8 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_public_key( libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked *key_pair, libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *pk) { libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 uu____0 = - libcrux_ml_kem_ind_cca_unpacked_clone_c7_e5( - libcrux_ml_kem_ind_cca_unpacked_public_key_05_7e(key_pair)); + libcrux_ml_kem_ind_cca_unpacked_clone_28_e5( + libcrux_ml_kem_ind_cca_unpacked_public_key_de_7e(key_pair)); pk[0U] = uu____0; } @@ -7177,7 +7187,7 @@ static inline void libcrux_ml_kem_mlkem768_portable_unpacked_serialized_public_key( libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 *public_key, libcrux_ml_kem_types_MlKemPublicKey_15 *serialized) { - libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_a6_0d(public_key, + libcrux_ml_kem_ind_cca_unpacked_serialized_public_key_mut_dd_0d(public_key, serialized); } diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h index 1fe947eb8..026ba1bf6 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_mlkem768_portable_types_H @@ -20,37 +20,18 @@ extern "C" { #include "eurydice_glue.h" -typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 - libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768PublicKeyUnpacked; - -typedef struct - libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked_s { - libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 private_key; - libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 public_key; -} libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked; +typedef struct libcrux_ml_kem_vector_portable_vector_type_PortableVector_s { + int16_t elements[16U]; +} libcrux_ml_kem_vector_portable_vector_type_PortableVector; /** -A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked +A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement with types libcrux_ml_kem_vector_portable_vector_type_PortableVector -with const generics -- $3size_t -*/ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 ind_cpa_public_key; - uint8_t public_key_hash[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8; -/** -A monomorphic instance of -libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types -libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics -- $3size_t */ -typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8_s { - libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 - ind_cpa_private_key; - uint8_t implicit_rejection_value[32U]; -} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8; +typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_f0_s { + libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients[16U]; +} libcrux_ml_kem_polynomial_PolynomialRingElement_f0; /** A monomorphic instance of @@ -64,6 +45,20 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8_s { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 A[3U][3U]; } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8; +/** +A monomorphic instance of libcrux_ml_kem.ind_cca.unpacked.MlKemPublicKeyUnpacked +with types libcrux_ml_kem_vector_portable_vector_type_PortableVector +with const generics +- $3size_t +*/ +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPublicKeyUnpacked_f8 ind_cpa_public_key; + uint8_t public_key_hash[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8; + +typedef libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 + libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768PublicKeyUnpacked; + /** A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.IndCpaPrivateKeyUnpacked with types @@ -75,17 +70,22 @@ typedef struct libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8_s { } libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8; /** -A monomorphic instance of libcrux_ml_kem.polynomial.PolynomialRingElement -with types libcrux_ml_kem_vector_portable_vector_type_PortableVector - +A monomorphic instance of +libcrux_ml_kem.ind_cca.unpacked.MlKemPrivateKeyUnpacked with types +libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics +- $3size_t */ -typedef struct libcrux_ml_kem_polynomial_PolynomialRingElement_f0_s { - libcrux_ml_kem_vector_portable_vector_type_PortableVector coefficients[16U]; -} libcrux_ml_kem_polynomial_PolynomialRingElement_f0; +typedef struct libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8_s { + libcrux_ml_kem_ind_cpa_unpacked_IndCpaPrivateKeyUnpacked_f8 + ind_cpa_private_key; + uint8_t implicit_rejection_value[32U]; +} libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8; -typedef struct libcrux_ml_kem_vector_portable_vector_type_PortableVector_s { - int16_t elements[16U]; -} libcrux_ml_kem_vector_portable_vector_type_PortableVector; +typedef struct + libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked_s { + libcrux_ml_kem_ind_cca_unpacked_MlKemPrivateKeyUnpacked_f8 private_key; + libcrux_ml_kem_ind_cca_unpacked_MlKemPublicKeyUnpacked_f8 public_key; +} libcrux_ml_kem_mlkem768_portable_unpacked_MlKem768KeyPairUnpacked; #if defined(__cplusplus) } diff --git a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h index 641b2bad1..4343a48cd 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_sha3_avx2_H @@ -212,17 +212,17 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_29_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0]#1} +N>[TraitClause@0, TraitClause@1]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_1e +A monomorphic instance of libcrux_sha3.generic_keccak.new_89 with types core_core_arch_x86___m256i with const generics - N= 4 */ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 -libcrux_sha3_generic_keccak_new_1e_71(void) { +libcrux_sha3_generic_keccak_new_89_71(void) { libcrux_sha3_generic_keccak_KeccakState_29 lit; lit.st[0U][0U] = libcrux_sha3_simd_avx2_zero_ef(); lit.st[0U][1U] = libcrux_sha3_simd_avx2_zero_ef(); @@ -1964,7 +1964,7 @@ KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_b9( Eurydice_slice data[4U], Eurydice_slice out[4U]) { libcrux_sha3_generic_keccak_KeccakState_29 s = - libcrux_sha3_generic_keccak_new_1e_71(); + libcrux_sha3_generic_keccak_new_89_71(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2005,7 +2005,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_b9( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2048,7 +2048,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_29 KRML_ATTRIBUTE_TARGET("avx2") static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 libcrux_sha3_avx2_x4_incremental_init(void) { - return libcrux_sha3_generic_keccak_new_1e_71(); + return libcrux_sha3_generic_keccak_new_89_71(); } /** diff --git a/libcrux-ml-kem/cg/libcrux_sha3_portable.h b/libcrux-ml-kem/cg/libcrux_sha3_portable.h index bfa447a0c..10e5c1870 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_portable.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 */ #ifndef __libcrux_sha3_portable_H @@ -192,16 +192,16 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_48_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0]#1} +N>[TraitClause@0, TraitClause@1]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_1e +A monomorphic instance of libcrux_sha3.generic_keccak.new_89 with types uint64_t with const generics - N= 1 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 -libcrux_sha3_generic_keccak_new_1e_cf(void) { +libcrux_sha3_generic_keccak_new_89_cf(void) { libcrux_sha3_generic_keccak_KeccakState_48 lit; lit.st[0U][0U] = libcrux_sha3_portable_keccak_zero_5a(); lit.st[0U][1U] = libcrux_sha3_portable_keccak_zero_5a(); @@ -247,7 +247,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_65( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, uu____0); + unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1582,7 +1582,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)72U; i++) { size_t i0 = i; @@ -1623,7 +1623,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -1684,7 +1684,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_650( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, uu____0); + unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1941,7 +1941,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -1982,7 +1982,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2069,7 +2069,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2110,7 +2110,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2163,7 +2163,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_48 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake128_init(void) { - return libcrux_sha3_generic_keccak_new_1e_cf(); + return libcrux_sha3_generic_keccak_new_89_cf(); } /** @@ -2182,7 +2182,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_651( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, uu____0); + unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2419,7 +2419,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_652( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, uu____0); + unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2676,7 +2676,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)144U; i++) { size_t i0 = i; @@ -2717,7 +2717,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -2778,7 +2778,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_653( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - unwrap_41_0e(dst, uu____0); + unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -3035,7 +3035,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)104U; i++) { size_t i0 = i; @@ -3076,7 +3076,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -3331,7 +3331,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)168U; i++) { size_t i0 = i; @@ -3372,7 +3372,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -3671,7 +3671,7 @@ libcrux_sha3_portable_incremental_shake256_absorb_final( */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake256_init(void) { - return libcrux_sha3_generic_keccak_new_1e_cf(); + return libcrux_sha3_generic_keccak_new_89_cf(); } /** @@ -3722,16 +3722,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -3756,16 +3756,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3773,7 +3773,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_9d_15(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_8b_15(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3826,16 +3826,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3843,7 +3843,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3872,7 +3872,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} static inline void libcrux_sha3_portable_incremental_absorb_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_9d_45(self, buf); + libcrux_sha3_generic_keccak_absorb_8b_45(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_4f @@ -3886,17 +3886,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -3904,7 +3904,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -3951,7 +3951,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_absorb_final_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_9d_b6(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_8b_b6(&self, buf); return self; } @@ -3960,16 +3960,16 @@ libcrux_sha3_portable_incremental_absorb_final_7d( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( +static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( uint8_t ret[136U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -4114,21 +4114,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_9d +A monomorphic instance of libcrux_sha3.generic_keccak.new_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f -libcrux_sha3_generic_keccak_new_9d_47(void) { +libcrux_sha3_generic_keccak_new_8b_47(void) { libcrux_sha3_generic_keccak_KeccakXofState_4f lit; - lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); uint8_t ret[136U]; - libcrux_sha3_generic_keccak_zero_block_9d_5e(ret); + libcrux_sha3_generic_keccak_zero_block_8b_5e(ret); memcpy(lit.buf[0U], ret, (size_t)136U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -4145,7 +4145,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_new_7d(void) { - return libcrux_sha3_generic_keccak_new_9d_47(); + return libcrux_sha3_generic_keccak_new_8b_47(); } /** @@ -4176,16 +4176,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -4210,16 +4210,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4227,7 +4227,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_9d_150(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_8b_150(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4280,16 +4280,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4297,7 +4297,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4323,7 +4323,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} static inline void libcrux_sha3_portable_incremental_absorb_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_9d_450(self, buf); + libcrux_sha3_generic_keccak_absorb_8b_450(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_78 @@ -4337,17 +4337,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -4355,7 +4355,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; for (size_t i = (size_t)0U; i < (size_t)1U; i++) { @@ -4399,7 +4399,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_absorb_final_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_9d_b60(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_8b_b60(&self, buf); return self; } @@ -4408,16 +4408,16 @@ libcrux_sha3_portable_incremental_absorb_final_1c( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( +static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( uint8_t ret[168U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -4594,21 +4594,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_9d +A monomorphic instance of libcrux_sha3.generic_keccak.new_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 -libcrux_sha3_generic_keccak_new_9d_470(void) { +libcrux_sha3_generic_keccak_new_8b_470(void) { libcrux_sha3_generic_keccak_KeccakXofState_78 lit; - lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); uint8_t ret[168U]; - libcrux_sha3_generic_keccak_zero_block_9d_5e0(ret); + libcrux_sha3_generic_keccak_zero_block_8b_5e0(ret); memcpy(lit.buf[0U], ret, (size_t)168U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -4622,7 +4622,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_new_1c(void) { - return libcrux_sha3_generic_keccak_new_9d_470(); + return libcrux_sha3_generic_keccak_new_8b_470(); } /** @@ -4669,16 +4669,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_81( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -4706,7 +4706,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -4741,7 +4741,7 @@ libcrux_sha3::portable::incremental::Shake256Squeeze)#3} static inline void libcrux_sha3_portable_incremental_squeeze_8a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_9d_ba(self, buf); + libcrux_sha3_generic_keccak_squeeze_8b_ba(self, buf); } /** @@ -4788,16 +4788,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_810( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -4825,7 +4825,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, Option_b3) .tag == None) { break; @@ -4860,7 +4860,7 @@ libcrux_sha3::portable::incremental::Shake128Squeeze)#1} static inline void libcrux_sha3_portable_incremental_squeeze_10( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_9d_ba0(self, buf); + libcrux_sha3_generic_keccak_squeeze_8b_ba0(self, buf); } /** From 6758f5c74edc70520635665f34082150e426b97f Mon Sep 17 00:00:00 2001 From: karthikbhargavan Date: Tue, 24 Sep 2024 14:53:30 +0000 Subject: [PATCH 14/14] pinned versions --- libcrux-ml-kem/c/code_gen.txt | 8 +- libcrux-ml-kem/c/eurydice_glue.h | 18 + libcrux-ml-kem/c/internal/libcrux_core.h | 43 +- .../c/internal/libcrux_mlkem_avx2.h | 8 +- .../c/internal/libcrux_mlkem_portable.h | 8 +- libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h | 8 +- .../c/internal/libcrux_sha3_internal.h | 136 +++--- libcrux-ml-kem/c/libcrux_core.c | 50 ++- libcrux-ml-kem/c/libcrux_core.h | 15 +- libcrux-ml-kem/c/libcrux_mlkem1024.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem1024_portable.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem1024_portable.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem512.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem512_avx2.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem512_avx2.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem512_portable.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem512_portable.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem768.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem768_avx2.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem768_avx2.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem768_portable.c | 8 +- libcrux-ml-kem/c/libcrux_mlkem768_portable.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem_avx2.c | 401 +++++++++--------- libcrux-ml-kem/c/libcrux_mlkem_avx2.h | 8 +- libcrux-ml-kem/c/libcrux_mlkem_portable.c | 395 ++++++++--------- libcrux-ml-kem/c/libcrux_mlkem_portable.h | 8 +- libcrux-ml-kem/c/libcrux_sha3.h | 8 +- libcrux-ml-kem/c/libcrux_sha3_avx2.c | 20 +- libcrux-ml-kem/c/libcrux_sha3_avx2.h | 8 +- libcrux-ml-kem/c/libcrux_sha3_internal.h | 48 +-- libcrux-ml-kem/c/libcrux_sha3_neon.c | 8 +- libcrux-ml-kem/c/libcrux_sha3_neon.h | 8 +- libcrux-ml-kem/cg/code_gen.txt | 6 +- libcrux-ml-kem/cg/libcrux_core.h | 6 +- libcrux-ml-kem/cg/libcrux_ct_ops.h | 6 +- libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h | 6 +- .../cg/libcrux_mlkem768_avx2_types.h | 6 +- libcrux-ml-kem/cg/libcrux_mlkem768_portable.h | 6 +- .../cg/libcrux_mlkem768_portable_types.h | 6 +- libcrux-ml-kem/cg/libcrux_sha3_avx2.h | 6 +- libcrux-ml-kem/cg/libcrux_sha3_portable.h | 6 +- 43 files changed, 716 insertions(+), 664 deletions(-) diff --git a/libcrux-ml-kem/c/code_gen.txt b/libcrux-ml-kem/c/code_gen.txt index 21d1a541d..e4e28910d 100644 --- a/libcrux-ml-kem/c/code_gen.txt +++ b/libcrux-ml-kem/c/code_gen.txt @@ -1,6 +1,6 @@ This code was generated with the following revisions: -Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d -Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 -Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 +Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 +Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac +Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd -Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d +Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 diff --git a/libcrux-ml-kem/c/eurydice_glue.h b/libcrux-ml-kem/c/eurydice_glue.h index 660918c54..ad026b9e1 100644 --- a/libcrux-ml-kem/c/eurydice_glue.h +++ b/libcrux-ml-kem/c/eurydice_glue.h @@ -18,6 +18,13 @@ extern "C" { #include "krml/lowstar_endianness.h" #define LowStar_Ignore_ignore(e, t, _ret_t) ((void)e) +#define EURYDICE_ASSERT(test, msg) \ + do { \ + if (!(test)) { \ + fprintf(stderr, "assertion \"%s\" failed: file \"%s\", line %d\n", msg, \ + __FILE__, __LINE__); \ + } \ + } while (0) // SLICES, ARRAYS, ETC. @@ -130,6 +137,10 @@ static inline void core_num__u32_8__to_be_bytes(uint32_t src, uint8_t dst[4]) { memcpy(dst, &x, 4); } +static inline void core_num__u32_8__to_le_bytes(uint32_t src, uint8_t dst[4]) { + store32_le(dst, src); +} + static inline uint32_t core_num__u32_8__from_le_bytes(uint8_t buf[4]) { return load32_le(buf); } @@ -137,6 +148,7 @@ static inline uint32_t core_num__u32_8__from_le_bytes(uint8_t buf[4]) { static inline void core_num__u64_9__to_le_bytes(uint64_t v, uint8_t buf[8]) { store64_le(buf, v); } + static inline uint64_t core_num__u64_9__from_le_bytes(uint8_t buf[8]) { return load64_le(buf); } @@ -188,6 +200,9 @@ static inline uint8_t Eurydice_bitand_pv_u8(uint8_t *p, uint8_t v) { static inline uint8_t Eurydice_shr_pv_u8(uint8_t *p, int32_t v) { return (*p) >> v; } +static inline uint32_t Eurydice_min_u32(uint32_t x, uint32_t y) { + return x < y ? x : y; +} #define core_num_nonzero_private_NonZeroUsizeInner size_t static inline core_num_nonzero_private_NonZeroUsizeInner @@ -210,6 +225,9 @@ core_num_nonzero_private___core__clone__Clone_for_core__num__nonzero__private__N #define core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next \ Eurydice_range_iter_next +#define core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next \ + Eurydice_range_iter_next + // See note in karamel/lib/Inlining.ml if you change this #define Eurydice_into_iter(x, t, _ret_t) (x) #define core_iter_traits_collect___core__iter__traits__collect__IntoIterator_for_I___into_iter \ diff --git a/libcrux-ml-kem/c/internal/libcrux_core.h b/libcrux-ml-kem/c/internal/libcrux_core.h index ea0d66fb8..4dc60c6c7 100644 --- a/libcrux-ml-kem/c/internal/libcrux_core.h +++ b/libcrux-ml-kem/c/internal/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __internal_libcrux_core_H @@ -291,14 +291,15 @@ typedef struct core_result_Result_00_s { } core_result_Result_00; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[32size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_33(core_result_Result_00 self, uint8_t ret[32U]); +void core_result_unwrap_26_33(core_result_Result_00 self, uint8_t ret[32U]); /** Pad the `slice` with `0`s at the end. @@ -382,14 +383,15 @@ typedef struct core_result_Result_6f_s { } core_result_Result_6f; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[24size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_76(core_result_Result_6f self, uint8_t ret[24U]); +void core_result_unwrap_26_76(core_result_Result_6f self, uint8_t ret[24U]); /** A monomorphic instance of core.result.Result @@ -405,14 +407,15 @@ typedef struct core_result_Result_7a_s { } core_result_Result_7a; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[20size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_ea(core_result_Result_7a self, uint8_t ret[20U]); +void core_result_unwrap_26_ea(core_result_Result_7a self, uint8_t ret[20U]); /** A monomorphic instance of core.result.Result @@ -428,14 +431,15 @@ typedef struct core_result_Result_cd_s { } core_result_Result_cd; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[10size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_07(core_result_Result_cd self, uint8_t ret[10U]); +void core_result_unwrap_26_07(core_result_Result_cd self, uint8_t ret[10U]); /** A monomorphic instance of core.result.Result @@ -451,14 +455,15 @@ typedef struct core_result_Result_c0_s { } core_result_Result_c0; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types int16_t[16size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_30(core_result_Result_c0 self, int16_t ret[16U]); +void core_result_unwrap_26_30(core_result_Result_c0 self, int16_t ret[16U]); typedef struct Eurydice_slice_uint8_t_4size_t__x2_s { Eurydice_slice fst[4U]; diff --git a/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h b/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h index faf1c9b68..edc4170ea 100644 --- a/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h +++ b/libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __internal_libcrux_mlkem_avx2_H diff --git a/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h b/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h index 7d3aec1df..be78cb001 100644 --- a/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h +++ b/libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __internal_libcrux_mlkem_portable_H diff --git a/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h b/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h index 653268abf..354aca0c1 100644 --- a/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __internal_libcrux_sha3_avx2_H diff --git a/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h b/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h index 924fca293..513206ab2 100644 --- a/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h +++ b/libcrux-ml-kem/c/internal/libcrux_sha3_internal.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __internal_libcrux_sha3_internal_H @@ -29,7 +29,7 @@ typedef libcrux_sha3_generic_keccak_KeccakState_48 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake128_init(void) { - return libcrux_sha3_generic_keccak_new_1e_cf(); + return libcrux_sha3_generic_keccak_new_89_cf(); } /** @@ -207,7 +207,7 @@ libcrux_sha3_portable_incremental_shake256_absorb_final( */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 libcrux_sha3_portable_incremental_shake256_init(void) { - return libcrux_sha3_generic_keccak_new_1e_cf(); + return libcrux_sha3_generic_keccak_new_89_cf(); } /** @@ -258,16 +258,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_15( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -292,16 +292,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_15( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -309,7 +309,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_9d_15(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_8b_15(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; { @@ -362,16 +362,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_45( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -379,7 +379,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_45( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); { @@ -408,7 +408,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} static inline void libcrux_sha3_portable_incremental_absorb_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_9d_45(self, buf); + libcrux_sha3_generic_keccak_absorb_8b_45(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_4f @@ -422,17 +422,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_4f */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b6( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_4f *uu____0 = self; @@ -440,7 +440,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b6( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; { @@ -487,7 +487,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_absorb_final_7d( libcrux_sha3_generic_keccak_KeccakXofState_4f self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_9d_b6(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_8b_b6(&self, buf); return self; } @@ -496,16 +496,16 @@ libcrux_sha3_portable_incremental_absorb_final_7d( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( +static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e( uint8_t ret[136U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -650,21 +650,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_9d +A monomorphic instance of libcrux_sha3.generic_keccak.new_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f -libcrux_sha3_generic_keccak_new_9d_47(void) { +libcrux_sha3_generic_keccak_new_8b_47(void) { libcrux_sha3_generic_keccak_KeccakXofState_4f lit; - lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); uint8_t ret[136U]; - libcrux_sha3_generic_keccak_zero_block_9d_5e(ret); + libcrux_sha3_generic_keccak_zero_block_8b_5e(ret); memcpy(lit.buf[0U], ret, (size_t)136U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -681,7 +681,7 @@ libcrux_sha3::portable::incremental::Shake256Absorb)#2} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_4f libcrux_sha3_portable_incremental_new_7d(void) { - return libcrux_sha3_generic_keccak_new_9d_47(); + return libcrux_sha3_generic_keccak_new_8b_47(); } /** @@ -712,16 +712,16 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_9d +A monomorphic instance of libcrux_sha3.generic_keccak.fill_buffer_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( +static inline size_t libcrux_sha3_generic_keccak_fill_buffer_8b_150( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); @@ -746,16 +746,16 @@ static inline size_t libcrux_sha3_generic_keccak_fill_buffer_9d_150( /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_full_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( +static inline size_t libcrux_sha3_generic_keccak_absorb_full_8b_7a0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -763,7 +763,7 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( Eurydice_slice copy_of_inputs0[1U]; memcpy(copy_of_inputs0, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_consumed = - libcrux_sha3_generic_keccak_fill_buffer_9d_150(uu____0, copy_of_inputs0); + libcrux_sha3_generic_keccak_fill_buffer_8b_150(uu____0, copy_of_inputs0); if (input_consumed > (size_t)0U) { Eurydice_slice borrowed[1U]; { @@ -816,16 +816,16 @@ static inline size_t libcrux_sha3_generic_keccak_absorb_full_9d_7a0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_8b_450( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -833,7 +833,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_9d_450( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); if (input_remainder_len > (size_t)0U) { size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); { @@ -859,7 +859,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} static inline void libcrux_sha3_portable_incremental_absorb_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_9d_450(self, buf); + libcrux_sha3_generic_keccak_absorb_8b_450(self, buf); } typedef libcrux_sha3_generic_keccak_KeccakXofState_78 @@ -873,17 +873,17 @@ typedef libcrux_sha3_generic_keccak_KeccakXofState_78 */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_9d +A monomorphic instance of libcrux_sha3.generic_keccak.absorb_final_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 - DELIMITER= 31 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_8b_b60( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice inputs[1U]) { libcrux_sha3_generic_keccak_KeccakXofState_78 *uu____0 = self; @@ -891,7 +891,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_absorb_final_9d_b60( Eurydice_slice copy_of_inputs[1U]; memcpy(copy_of_inputs, inputs, (size_t)1U * sizeof(Eurydice_slice)); size_t input_remainder_len = - libcrux_sha3_generic_keccak_absorb_full_9d_7a0(uu____0, copy_of_inputs); + libcrux_sha3_generic_keccak_absorb_full_8b_7a0(uu____0, copy_of_inputs); size_t input_len = Eurydice_slice_len(inputs[0U], uint8_t); uint8_t blocks[1U][200U] = {{0U}}; { @@ -935,7 +935,7 @@ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_absorb_final_1c( libcrux_sha3_generic_keccak_KeccakXofState_78 self, Eurydice_slice input) { Eurydice_slice buf[1U] = {input}; - libcrux_sha3_generic_keccak_absorb_final_9d_b60(&self, buf); + libcrux_sha3_generic_keccak_absorb_final_8b_b60(&self, buf); return self; } @@ -944,16 +944,16 @@ libcrux_sha3_portable_incremental_absorb_final_1c( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_9d +A monomorphic instance of libcrux_sha3.generic_keccak.zero_block_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( +static inline void libcrux_sha3_generic_keccak_zero_block_8b_5e0( uint8_t ret[168U]) { ret[0U] = 0U; ret[1U] = 0U; @@ -1130,21 +1130,21 @@ static inline void libcrux_sha3_generic_keccak_zero_block_9d_5e0( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_9d +A monomorphic instance of libcrux_sha3.generic_keccak.new_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 -libcrux_sha3_generic_keccak_new_9d_470(void) { +libcrux_sha3_generic_keccak_new_8b_470(void) { libcrux_sha3_generic_keccak_KeccakXofState_78 lit; - lit.inner = libcrux_sha3_generic_keccak_new_1e_cf(); + lit.inner = libcrux_sha3_generic_keccak_new_89_cf(); uint8_t ret[168U]; - libcrux_sha3_generic_keccak_zero_block_9d_5e0(ret); + libcrux_sha3_generic_keccak_zero_block_8b_5e0(ret); memcpy(lit.buf[0U], ret, (size_t)168U * sizeof(uint8_t)); lit.buf_len = (size_t)0U; lit.sponge = false; @@ -1158,7 +1158,7 @@ libcrux_sha3::portable::incremental::Shake128Absorb)} */ static inline libcrux_sha3_generic_keccak_KeccakXofState_78 libcrux_sha3_portable_incremental_new_1c(void) { - return libcrux_sha3_generic_keccak_new_9d_470(); + return libcrux_sha3_generic_keccak_new_8b_470(); } /** @@ -1205,16 +1205,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_81( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 136 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -1242,7 +1242,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1277,7 +1277,7 @@ libcrux_sha3::portable::incremental::Shake256Squeeze)#3} static inline void libcrux_sha3_portable_incremental_squeeze_8a( libcrux_sha3_generic_keccak_KeccakXofState_4f *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_9d_ba(self, buf); + libcrux_sha3_generic_keccak_squeeze_8b_ba(self, buf); } /** @@ -1324,16 +1324,16 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_store_5a_810( */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakXofState[TraitClause@0]#2} +PARALLEL_LANES, RATE>[TraitClause@0, TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_9d +A monomorphic instance of libcrux_sha3.generic_keccak.squeeze_8b with types uint64_t with const generics - PARALLEL_LANES= 1 - RATE= 168 */ -static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( +static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_8b_ba0( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out[1U]) { if (self->sponge) { @@ -1361,7 +1361,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_squeeze_9d_ba0( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1396,7 +1396,7 @@ libcrux_sha3::portable::incremental::Shake128Squeeze)#1} static inline void libcrux_sha3_portable_incremental_squeeze_10( libcrux_sha3_generic_keccak_KeccakXofState_78 *self, Eurydice_slice out) { Eurydice_slice buf[1U] = {out}; - libcrux_sha3_generic_keccak_squeeze_9d_ba0(self, buf); + libcrux_sha3_generic_keccak_squeeze_8b_ba0(self, buf); } /** diff --git a/libcrux-ml-kem/c/libcrux_core.c b/libcrux-ml-kem/c/libcrux_core.c index c70315723..c0efed48a 100644 --- a/libcrux-ml-kem/c/libcrux_core.c +++ b/libcrux-ml-kem/c/libcrux_core.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "internal/libcrux_core.h" @@ -390,14 +390,15 @@ uint8_t *libcrux_ml_kem_types_as_slice_fd_cf( } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[32size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_33(core_result_Result_00 self, uint8_t ret[32U]) { +void core_result_unwrap_26_33(core_result_Result_00 self, uint8_t ret[32U]) { if (self.tag == core_result_Ok) { uint8_t f0[32U]; memcpy(f0, self.val.case_Ok, (size_t)32U * sizeof(uint8_t)); @@ -519,14 +520,15 @@ void libcrux_ml_kem_utils_into_padded_array_42(Eurydice_slice slice, } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[24size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_76(core_result_Result_6f self, uint8_t ret[24U]) { +void core_result_unwrap_26_76(core_result_Result_6f self, uint8_t ret[24U]) { if (self.tag == core_result_Ok) { uint8_t f0[24U]; memcpy(f0, self.val.case_Ok, (size_t)24U * sizeof(uint8_t)); @@ -539,14 +541,15 @@ void core_result_unwrap_41_76(core_result_Result_6f self, uint8_t ret[24U]) { } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[20size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_ea(core_result_Result_7a self, uint8_t ret[20U]) { +void core_result_unwrap_26_ea(core_result_Result_7a self, uint8_t ret[20U]) { if (self.tag == core_result_Ok) { uint8_t f0[20U]; memcpy(f0, self.val.case_Ok, (size_t)20U * sizeof(uint8_t)); @@ -559,14 +562,15 @@ void core_result_unwrap_41_ea(core_result_Result_7a self, uint8_t ret[20U]) { } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[10size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_07(core_result_Result_cd self, uint8_t ret[10U]) { +void core_result_unwrap_26_07(core_result_Result_cd self, uint8_t ret[10U]) { if (self.tag == core_result_Ok) { uint8_t f0[10U]; memcpy(f0, self.val.case_Ok, (size_t)10U * sizeof(uint8_t)); @@ -579,14 +583,15 @@ void core_result_unwrap_41_07(core_result_Result_cd self, uint8_t ret[10U]) { } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types int16_t[16size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_30(core_result_Result_c0 self, int16_t ret[16U]) { +void core_result_unwrap_26_30(core_result_Result_c0 self, int16_t ret[16U]) { if (self.tag == core_result_Ok) { int16_t f0[16U]; memcpy(f0, self.val.case_Ok, (size_t)16U * sizeof(int16_t)); @@ -599,14 +604,15 @@ void core_result_unwrap_41_30(core_result_Result_c0 self, int16_t ret[16U]) { } /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[8size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_0e(core_result_Result_56 self, uint8_t ret[8U]) { +void core_result_unwrap_26_0e(core_result_Result_56 self, uint8_t ret[8U]) { if (self.tag == core_result_Ok) { uint8_t f0[8U]; memcpy(f0, self.val.case_Ok, (size_t)8U * sizeof(uint8_t)); diff --git a/libcrux-ml-kem/c/libcrux_core.h b/libcrux-ml-kem/c/libcrux_core.h index d11c83a5a..f7265777c 100644 --- a/libcrux-ml-kem/c/libcrux_core.h +++ b/libcrux-ml-kem/c/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_core_H @@ -197,14 +197,15 @@ typedef struct core_result_Result_56_s { } core_result_Result_56; /** -This function found in impl {core::result::Result} +This function found in impl {core::result::Result[TraitClause@0, +TraitClause@1]} */ /** -A monomorphic instance of core.result.unwrap_41 +A monomorphic instance of core.result.unwrap_26 with types uint8_t[8size_t], core_array_TryFromSliceError */ -void core_result_unwrap_41_0e(core_result_Result_56 self, uint8_t ret[8U]); +void core_result_unwrap_26_0e(core_result_Result_56 self, uint8_t ret[8U]); typedef struct Eurydice_slice_uint8_t_x2_s { Eurydice_slice fst; diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024.h b/libcrux-ml-kem/c/libcrux_mlkem1024.h index 0c4269273..0a85a746d 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem1024_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c index 291cdea74..31d8304e1 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem1024_avx2.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h index e261044f5..8e758c512 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem1024_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c index 8589f3cb7..e8df4813a 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem1024_portable.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h index 5e13dac2e..fa38f9693 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem1024_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem1024_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512.h b/libcrux-ml-kem/c/libcrux_mlkem512.h index e2d3aeec9..2c452d78b 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem512_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c index 3147278df..a285e9e59 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem512_avx2.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h index b8b6f8b0d..13b581872 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem512_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_portable.c b/libcrux-ml-kem/c/libcrux_mlkem512_portable.c index f4b93367f..25be9d68b 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem512_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem512_portable.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem512_portable.h b/libcrux-ml-kem/c/libcrux_mlkem512_portable.h index 7b475f089..71cbfb6fe 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem512_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem512_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem512_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768.h b/libcrux-ml-kem/c/libcrux_mlkem768.h index 9d931422e..537ec47e9 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c index 067de4a91..282d5e8f3 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem768_avx2.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h index 7a86aed30..36ab7426f 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_portable.c b/libcrux-ml-kem/c/libcrux_mlkem768_portable.c index fae6a874c..fae5cc397 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem768_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_mlkem768_portable.h" diff --git a/libcrux-ml-kem/c/libcrux_mlkem768_portable.h b/libcrux-ml-kem/c/libcrux_mlkem768_portable.h index 5feb24427..ff60c10cb 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem768_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem768_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_portable_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem_avx2.c b/libcrux-ml-kem/c/libcrux_mlkem_avx2.c index a0b9361ed..97b6fd741 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_avx2.c +++ b/libcrux-ml-kem/c/libcrux_mlkem_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "internal/libcrux_mlkem_avx2.h" @@ -603,7 +603,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_4( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, ret0); + core_result_unwrap_26_0e(dst, ret0); memcpy(ret, ret0, (size_t)8U * sizeof(uint8_t)); } @@ -694,7 +694,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_5( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)10U, uint8_t), Eurydice_slice, uint8_t[10U]); - core_result_unwrap_41_07(dst, ret0); + core_result_unwrap_26_07(dst, ret0); memcpy(ret, ret0, (size_t)10U * sizeof(uint8_t)); } @@ -797,7 +797,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_10( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)20U, uint8_t), Eurydice_slice, uint8_t[20U]); - core_result_unwrap_41_ea(dst, ret0); + core_result_unwrap_26_ea(dst, ret0); memcpy(ret, ret0, (size_t)20U * sizeof(uint8_t)); } @@ -924,7 +924,7 @@ KRML_MUSTINLINE void libcrux_ml_kem_vector_avx2_serialize_serialize_12( &dst, Eurydice_array_to_subslice2(serialized, (size_t)0U, (size_t)24U, uint8_t), Eurydice_slice, uint8_t[24U]); - core_result_unwrap_41_76(dst, ret0); + core_result_unwrap_26_76(dst, ret0); memcpy(ret, ret0, (size_t)24U * sizeof(uint8_t)); } @@ -1031,15 +1031,16 @@ inline __m256i libcrux_ml_kem_vector_avx2_clone_78(__m256i *self) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ZERO_20_7d(void) { +static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ZERO_ef_7d(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_avx2_ZERO_09(); lit.coefficients[1U] = libcrux_ml_kem_vector_avx2_ZERO_09(); @@ -1068,7 +1069,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_to_reduced_ring_element_b8(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -1117,7 +1118,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - deserialized_pk[i] = ZERO_20_7d();); + deserialized_pk[i] = ZERO_ef_7d();); deserialize_ring_elements_reduced_fb1(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -1341,19 +1342,19 @@ typedef struct IndCpaPrivateKeyUnpacked_a0_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static IndCpaPrivateKeyUnpacked_a0 default_f6_191(void) { +static IndCpaPrivateKeyUnpacked_a0 default_1a_191(void) { IndCpaPrivateKeyUnpacked_a0 lit; - lit.secret_as_ntt[0U] = ZERO_20_7d(); - lit.secret_as_ntt[1U] = ZERO_20_7d(); - lit.secret_as_ntt[2U] = ZERO_20_7d(); + lit.secret_as_ntt[0U] = ZERO_ef_7d(); + lit.secret_as_ntt[1U] = ZERO_ef_7d(); + lit.secret_as_ntt[2U] = ZERO_ef_7d(); return lit; } @@ -1372,33 +1373,33 @@ typedef struct IndCpaPublicKeyUnpacked_a0_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static IndCpaPublicKeyUnpacked_a0 default_85_801(void) { +static IndCpaPublicKeyUnpacked_a0 default_8d_801(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - uu____0[i] = ZERO_20_7d();); + uu____0[i] = ZERO_ef_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_a0 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_7d(); - lit.A[0U][1U] = ZERO_20_7d(); - lit.A[0U][2U] = ZERO_20_7d(); - lit.A[1U][0U] = ZERO_20_7d(); - lit.A[1U][1U] = ZERO_20_7d(); - lit.A[1U][2U] = ZERO_20_7d(); - lit.A[2U][0U] = ZERO_20_7d(); - lit.A[2U][1U] = ZERO_20_7d(); - lit.A[2U][2U] = ZERO_20_7d(); + lit.A[0U][0U] = ZERO_ef_7d(); + lit.A[0U][1U] = ZERO_ef_7d(); + lit.A[0U][2U] = ZERO_ef_7d(); + lit.A[1U][0U] = ZERO_ef_7d(); + lit.A[1U][1U] = ZERO_ef_7d(); + lit.A[1U][2U] = ZERO_ef_7d(); + lit.A[2U][0U] = ZERO_ef_7d(); + lit.A[2U][1U] = ZERO_ef_7d(); + lit.A[2U][2U] = ZERO_ef_7d(); return lit; } @@ -1728,17 +1729,18 @@ static KRML_MUSTINLINE bool sample_from_uniform_distribution_next_744( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -from_i16_array_20_14(Eurydice_slice a) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); +from_i16_array_ef_14(Eurydice_slice a) { + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -1757,7 +1759,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e41( int16_t s[272U]) { - return from_i16_array_20_14( + return from_i16_array_ef_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -1942,7 +1944,7 @@ sample_from_binomial_distribution_2_80(Eurydice_slice randomness) { sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_20_14( + return from_i16_array_ef_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -1986,7 +1988,7 @@ sample_from_binomial_distribution_3_05(Eurydice_slice randomness) { sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_20_14( + return from_i16_array_ef_14( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -2137,15 +2139,16 @@ static KRML_MUSTINLINE void ntt_at_layer_1_09( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void poly_barrett_reduce_20_09( +static KRML_MUSTINLINE void poly_barrett_reduce_ef_09( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -2171,7 +2174,7 @@ static KRML_MUSTINLINE void ntt_binomially_sampled_ring_element_5c( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** @@ -2228,7 +2231,7 @@ static KRML_MUSTINLINE tuple_b0 sample_vector_cbd_then_ntt_out_d71( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - re_as_ntt[i] = ZERO_20_7d();); + re_as_ntt[i] = ZERO_ef_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -2249,18 +2252,19 @@ static KRML_MUSTINLINE tuple_b0 sample_vector_cbd_then_ntt_out_d71( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -ntt_multiply_20_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, +ntt_multiply_ef_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 out = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -2279,15 +2283,16 @@ ntt_multiply_20_63(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 3 */ -static KRML_MUSTINLINE void add_to_ring_element_20_311( +static KRML_MUSTINLINE void add_to_ring_element_ef_311( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -2314,15 +2319,16 @@ static __m256i to_standard_domain_c1(__m256i v) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void add_standard_error_reduce_20_ba( +static KRML_MUSTINLINE void add_standard_error_reduce_ef_ba( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -2356,7 +2362,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_671( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -2369,10 +2375,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_671( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_311(&t_as_ntt[i0], &product); + ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_311(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -2425,7 +2431,7 @@ static void generate_keypair_unpacked_4a1( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -2443,8 +2449,8 @@ with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_1e1( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_a0 private_key = default_f6_191(); - IndCpaPublicKeyUnpacked_a0 public_key = default_85_801(); + IndCpaPrivateKeyUnpacked_a0 private_key = default_1a_191(); + IndCpaPublicKeyUnpacked_a0 public_key = default_8d_801(); generate_keypair_unpacked_4a1(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; serialize_public_key_f71( @@ -2595,7 +2601,7 @@ static KRML_MUSTINLINE tuple_b0 sample_ring_element_cbd_2d1(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - error_1[i] = ZERO_20_7d();); + error_1[i] = ZERO_ef_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -2775,20 +2781,21 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_0c1( invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ -static KRML_MUSTINLINE void add_error_reduce_20_a2( +static KRML_MUSTINLINE void add_error_reduce_ef_a2( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error) { for (size_t i = (size_t)0U; @@ -2816,7 +2823,7 @@ static KRML_MUSTINLINE void compute_vector_u_7f1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - result0[i] = ZERO_20_7d();); + result0[i] = ZERO_ef_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -2836,11 +2843,11 @@ static KRML_MUSTINLINE void compute_vector_u_7f1( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(a_element, &r_as_ntt[j]); - add_to_ring_element_20_311(&result0[i1], &product); + ntt_multiply_ef_63(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_311(&result0[i1], &product); } invert_ntt_montgomery_0c1(&result0[i1]); - add_error_reduce_20_a2(&result0[i1], &error_1[i1]); + add_error_reduce_ef_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[3U]; memcpy( @@ -2872,7 +2879,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_then_decompress_message_4f(uint8_t serialized[32U]) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; __m256i coefficient_compressed = @@ -2886,16 +2893,17 @@ deserialize_then_decompress_message_4f(uint8_t serialized[32U]) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -add_message_error_reduce_20_df( +add_message_error_reduce_ef_df( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result) { @@ -2927,13 +2935,13 @@ compute_ring_element_v_ac1( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_311(&result, &product);); + ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_311(&result, &product);); invert_ntt_montgomery_0c1(&result); - result = add_message_error_reduce_20_df(error_2, message, result); + result = add_message_error_reduce_ef_df(error_2, message, result); return result; } @@ -3391,7 +3399,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static void encrypt_691(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { - IndCpaPublicKeyUnpacked_a0 unpacked_public_key = default_85_801(); + IndCpaPublicKeyUnpacked_a0 unpacked_public_key = default_8d_801(); deserialize_ring_elements_reduced_fb1( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -3510,7 +3518,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_to_uncompressed_ring_element_59(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -3532,7 +3540,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_181( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_7d();); + secret_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -3619,7 +3627,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_then_decompress_10_3d(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice((size_t)16U, re.coefficients, __m256i), @@ -3699,7 +3707,7 @@ libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_then_decompress_11_1a(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -3738,7 +3746,7 @@ static KRML_MUSTINLINE void ntt_vector_u_2c0( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** @@ -3754,7 +3762,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_a81( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - u_as_ntt[i] = ZERO_20_7d();); + u_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1088U, ciphertext, uint8_t), @@ -3843,7 +3851,7 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_then_decompress_4_f1(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -3918,7 +3926,7 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialize_then_decompress_5_7e(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re = ZERO_ef_7d(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -3944,16 +3952,17 @@ deserialize_then_decompress_ring_element_v_050(Eurydice_slice serialized) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_d2 -subtract_reduce_20_27(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, +subtract_reduce_ef_27(libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 b) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -3979,13 +3988,13 @@ compute_message_a41( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_311(&result, &product);); + ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_311(&result, &product);); invert_ntt_montgomery_0c1(&result); - result = subtract_reduce_20_27(v, result); + result = subtract_reduce_ef_27(v, result); return result; } @@ -4221,7 +4230,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - deserialized_pk[i] = ZERO_20_7d();); + deserialized_pk[i] = ZERO_ef_7d();); deserialize_ring_elements_reduced_fb(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -4375,20 +4384,20 @@ typedef struct IndCpaPrivateKeyUnpacked_01_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static IndCpaPrivateKeyUnpacked_01 default_f6_19(void) { +static IndCpaPrivateKeyUnpacked_01 default_1a_19(void) { IndCpaPrivateKeyUnpacked_01 lit; - lit.secret_as_ntt[0U] = ZERO_20_7d(); - lit.secret_as_ntt[1U] = ZERO_20_7d(); - lit.secret_as_ntt[2U] = ZERO_20_7d(); - lit.secret_as_ntt[3U] = ZERO_20_7d(); + lit.secret_as_ntt[0U] = ZERO_ef_7d(); + lit.secret_as_ntt[1U] = ZERO_ef_7d(); + lit.secret_as_ntt[2U] = ZERO_ef_7d(); + lit.secret_as_ntt[3U] = ZERO_ef_7d(); return lit; } @@ -4407,40 +4416,40 @@ typedef struct IndCpaPublicKeyUnpacked_01_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static IndCpaPublicKeyUnpacked_01 default_85_80(void) { +static IndCpaPublicKeyUnpacked_01 default_8d_80(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - uu____0[i] = ZERO_20_7d();); + uu____0[i] = ZERO_ef_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_01 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_7d(); - lit.A[0U][1U] = ZERO_20_7d(); - lit.A[0U][2U] = ZERO_20_7d(); - lit.A[0U][3U] = ZERO_20_7d(); - lit.A[1U][0U] = ZERO_20_7d(); - lit.A[1U][1U] = ZERO_20_7d(); - lit.A[1U][2U] = ZERO_20_7d(); - lit.A[1U][3U] = ZERO_20_7d(); - lit.A[2U][0U] = ZERO_20_7d(); - lit.A[2U][1U] = ZERO_20_7d(); - lit.A[2U][2U] = ZERO_20_7d(); - lit.A[2U][3U] = ZERO_20_7d(); - lit.A[3U][0U] = ZERO_20_7d(); - lit.A[3U][1U] = ZERO_20_7d(); - lit.A[3U][2U] = ZERO_20_7d(); - lit.A[3U][3U] = ZERO_20_7d(); + lit.A[0U][0U] = ZERO_ef_7d(); + lit.A[0U][1U] = ZERO_ef_7d(); + lit.A[0U][2U] = ZERO_ef_7d(); + lit.A[0U][3U] = ZERO_ef_7d(); + lit.A[1U][0U] = ZERO_ef_7d(); + lit.A[1U][1U] = ZERO_ef_7d(); + lit.A[1U][2U] = ZERO_ef_7d(); + lit.A[1U][3U] = ZERO_ef_7d(); + lit.A[2U][0U] = ZERO_ef_7d(); + lit.A[2U][1U] = ZERO_ef_7d(); + lit.A[2U][2U] = ZERO_ef_7d(); + lit.A[2U][3U] = ZERO_ef_7d(); + lit.A[3U][0U] = ZERO_ef_7d(); + lit.A[3U][1U] = ZERO_ef_7d(); + lit.A[3U][2U] = ZERO_ef_7d(); + lit.A[3U][3U] = ZERO_ef_7d(); return lit; } @@ -4782,7 +4791,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e4( int16_t s[272U]) { - return from_i16_array_20_14( + return from_i16_array_ef_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -4983,7 +4992,7 @@ static KRML_MUSTINLINE tuple_71 sample_vector_cbd_then_ntt_out_d7( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - re_as_ntt[i] = ZERO_20_7d();); + re_as_ntt[i] = ZERO_ef_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -5004,15 +5013,16 @@ static KRML_MUSTINLINE tuple_71 sample_vector_cbd_then_ntt_out_d7( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 4 */ -static KRML_MUSTINLINE void add_to_ring_element_20_31( +static KRML_MUSTINLINE void add_to_ring_element_ef_31( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -5046,7 +5056,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_67( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -5059,10 +5069,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_67( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_31(&t_as_ntt[i0], &product); + ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_31(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -5115,7 +5125,7 @@ static void generate_keypair_unpacked_4a( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -5133,8 +5143,8 @@ with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_1e0( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_01 private_key = default_f6_19(); - IndCpaPublicKeyUnpacked_01 public_key = default_85_80(); + IndCpaPrivateKeyUnpacked_01 private_key = default_1a_19(); + IndCpaPublicKeyUnpacked_01 public_key = default_8d_80(); generate_keypair_unpacked_4a(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1568U]; serialize_public_key_f7( @@ -5285,7 +5295,7 @@ static KRML_MUSTINLINE tuple_71 sample_ring_element_cbd_2d(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - error_1[i] = ZERO_20_7d();); + error_1[i] = ZERO_ef_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -5349,7 +5359,7 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_0c( invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** @@ -5365,7 +5375,7 @@ static KRML_MUSTINLINE void compute_vector_u_7f( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - result0[i] = ZERO_20_7d();); + result0[i] = ZERO_ef_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -5385,11 +5395,11 @@ static KRML_MUSTINLINE void compute_vector_u_7f( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(a_element, &r_as_ntt[j]); - add_to_ring_element_20_31(&result0[i1], &product); + ntt_multiply_ef_63(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_31(&result0[i1], &product); } invert_ntt_montgomery_0c(&result0[i1]); - add_error_reduce_20_a2(&result0[i1], &error_1[i1]); + add_error_reduce_ef_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[4U]; memcpy( @@ -5412,13 +5422,13 @@ compute_ring_element_v_ac( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_31(&result, &product);); + ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_31(&result, &product);); invert_ntt_montgomery_0c(&result); - result = add_message_error_reduce_20_df(error_2, message, result); + result = add_message_error_reduce_ef_df(error_2, message, result); return result; } @@ -5595,7 +5605,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static void encrypt_690(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { - IndCpaPublicKeyUnpacked_01 unpacked_public_key = default_85_80(); + IndCpaPublicKeyUnpacked_01 unpacked_public_key = default_8d_80(); deserialize_ring_elements_reduced_fb( Eurydice_slice_subslice_to(public_key, (size_t)1536U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -5717,7 +5727,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_180( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_7d();); + secret_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -5768,7 +5778,7 @@ static KRML_MUSTINLINE void ntt_vector_u_2c( ntt_at_layer_3_ae(&zeta_i, re); ntt_at_layer_2_53(&zeta_i, re); ntt_at_layer_1_09(&zeta_i, re); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** @@ -5784,7 +5794,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_a8( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - u_as_ntt[i] = ZERO_20_7d();); + u_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1568U, ciphertext, uint8_t), @@ -5832,13 +5842,13 @@ compute_message_a4( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_31(&result, &product);); + ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_31(&result, &product);); invert_ntt_montgomery_0c(&result); - result = subtract_reduce_20_27(v, result); + result = subtract_reduce_ef_27(v, result); return result; } @@ -6036,7 +6046,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_bf( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 deserialized_pk[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - deserialized_pk[i] = ZERO_20_7d();); + deserialized_pk[i] = ZERO_ef_7d();); deserialize_ring_elements_reduced_fb0(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -6190,18 +6200,18 @@ typedef struct IndCpaPrivateKeyUnpacked_d6_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static IndCpaPrivateKeyUnpacked_d6 default_f6_190(void) { +static IndCpaPrivateKeyUnpacked_d6 default_1a_190(void) { IndCpaPrivateKeyUnpacked_d6 lit; - lit.secret_as_ntt[0U] = ZERO_20_7d(); - lit.secret_as_ntt[1U] = ZERO_20_7d(); + lit.secret_as_ntt[0U] = ZERO_ef_7d(); + lit.secret_as_ntt[1U] = ZERO_ef_7d(); return lit; } @@ -6220,28 +6230,28 @@ typedef struct IndCpaPublicKeyUnpacked_d6_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static IndCpaPublicKeyUnpacked_d6 default_85_800(void) { +static IndCpaPublicKeyUnpacked_d6 default_8d_800(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - uu____0[i] = ZERO_20_7d();); + uu____0[i] = ZERO_ef_7d();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_d6 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_d2)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_7d(); - lit.A[0U][1U] = ZERO_20_7d(); - lit.A[1U][0U] = ZERO_20_7d(); - lit.A[1U][1U] = ZERO_20_7d(); + lit.A[0U][0U] = ZERO_ef_7d(); + lit.A[0U][1U] = ZERO_ef_7d(); + lit.A[1U][0U] = ZERO_ef_7d(); + lit.A[1U][1U] = ZERO_ef_7d(); return lit; } @@ -6571,7 +6581,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_d2 closure_e40( int16_t s[272U]) { - return from_i16_array_20_14( + return from_i16_array_ef_14( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -6777,7 +6787,7 @@ static KRML_MUSTINLINE tuple_74 sample_vector_cbd_then_ntt_out_d70( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 re_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - re_as_ntt[i] = ZERO_20_7d();); + re_as_ntt[i] = ZERO_ef_7d();); libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6798,15 +6808,16 @@ static KRML_MUSTINLINE tuple_74 sample_vector_cbd_then_ntt_out_d70( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_avx2_SIMD256Vector with const generics - K= 2 */ -static KRML_MUSTINLINE void add_to_ring_element_20_310( +static KRML_MUSTINLINE void add_to_ring_element_ef_310( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *rhs) { for (size_t i = (size_t)0U; @@ -6840,7 +6851,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_670( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 uu____0 = ZERO_ef_7d(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -6853,10 +6864,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_670( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_310(&t_as_ntt[i0], &product); + ntt_multiply_ef_63(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_310(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_ba(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_ba(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -6909,7 +6920,7 @@ static void generate_keypair_unpacked_4a0( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6927,8 +6938,8 @@ with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_1e( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_d6 private_key = default_f6_190(); - IndCpaPublicKeyUnpacked_d6 public_key = default_85_800(); + IndCpaPrivateKeyUnpacked_d6 private_key = default_1a_190(); + IndCpaPublicKeyUnpacked_d6 public_key = default_8d_800(); generate_keypair_unpacked_4a0(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[800U]; serialize_public_key_f70( @@ -7125,7 +7136,7 @@ static KRML_MUSTINLINE tuple_74 sample_ring_element_cbd_2d0(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 error_1[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - error_1[i] = ZERO_20_7d();); + error_1[i] = ZERO_ef_7d();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -7189,7 +7200,7 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_0c0( invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_0f(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_09(re); + poly_barrett_reduce_ef_09(re); } /** @@ -7205,7 +7216,7 @@ static KRML_MUSTINLINE void compute_vector_u_7f0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - result0[i] = ZERO_20_7d();); + result0[i] = ZERO_ef_7d();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -7225,11 +7236,11 @@ static KRML_MUSTINLINE void compute_vector_u_7f0( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(a_element, &r_as_ntt[j]); - add_to_ring_element_20_310(&result0[i1], &product); + ntt_multiply_ef_63(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_310(&result0[i1], &product); } invert_ntt_montgomery_0c0(&result0[i1]); - add_error_reduce_20_a2(&result0[i1], &error_1[i1]); + add_error_reduce_ef_a2(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result[2U]; memcpy( @@ -7252,13 +7263,13 @@ compute_ring_element_v_ac0( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_310(&result, &product);); + ntt_multiply_ef_63(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_310(&result, &product);); invert_ntt_montgomery_0c0(&result); - result = add_message_error_reduce_20_df(error_2, message, result); + result = add_message_error_reduce_ef_df(error_2, message, result); return result; } @@ -7385,7 +7396,7 @@ libcrux_ml_kem_hash_functions_avx2_Simd256Hash with const generics */ static void encrypt_69(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { - IndCpaPublicKeyUnpacked_d6 unpacked_public_key = default_85_800(); + IndCpaPublicKeyUnpacked_d6 unpacked_public_key = default_8d_800(); deserialize_ring_elements_reduced_fb0( Eurydice_slice_subslice_to(public_key, (size_t)768U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -7507,7 +7518,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_18( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 secret_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_7d();); + secret_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -7544,7 +7555,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_a80( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_d2 u_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - u_as_ntt[i] = ZERO_20_7d();); + u_as_ntt[i] = ZERO_ef_7d();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)768U, ciphertext, uint8_t), @@ -7581,13 +7592,13 @@ compute_message_a40( libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_d2 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_20_7d(); + libcrux_ml_kem_polynomial_PolynomialRingElement_d2 result = ZERO_ef_7d(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_d2 product = - ntt_multiply_20_63(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_310(&result, &product);); + ntt_multiply_ef_63(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_310(&result, &product);); invert_ntt_montgomery_0c0(&result); - result = subtract_reduce_20_27(v, result); + result = subtract_reduce_ef_27(v, result); return result; } diff --git a/libcrux-ml-kem/c/libcrux_mlkem_avx2.h b/libcrux-ml-kem/c/libcrux_mlkem_avx2.h index b1d46ac81..705b94d1c 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_avx2.h +++ b/libcrux-ml-kem/c/libcrux_mlkem_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_mlkem_portable.c b/libcrux-ml-kem/c/libcrux_mlkem_portable.c index f54504354..65f4405d5 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_portable.c +++ b/libcrux-ml-kem/c/libcrux_mlkem_portable.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "internal/libcrux_mlkem_portable.h" @@ -79,7 +79,7 @@ libcrux_ml_kem_vector_portable_vector_type_from_i16_array( Eurydice_slice_to_array2( &dst, Eurydice_slice_subslice2(array, (size_t)0U, (size_t)16U, int16_t), Eurydice_slice, int16_t[16U]); - core_result_unwrap_41_30(dst, ret); + core_result_unwrap_26_30(dst, ret); memcpy(lit.elements, ret, (size_t)16U * sizeof(int16_t)); return lit; } @@ -2281,15 +2281,16 @@ libcrux_ml_kem_vector_portable_vector_type_clone_3b( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ZERO_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ZERO_20_19(void) { +static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ZERO_ef_19(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 lit; lit.coefficients[0U] = libcrux_ml_kem_vector_portable_ZERO_0d(); lit.coefficients[1U] = libcrux_ml_kem_vector_portable_ZERO_0d(); @@ -2318,7 +2319,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_to_reduced_ring_element_8a(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -2369,7 +2370,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_611( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - deserialized_pk[i] = ZERO_20_19();); + deserialized_pk[i] = ZERO_ef_19();); deserialize_ring_elements_reduced_bb(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -2609,20 +2610,20 @@ typedef struct IndCpaPrivateKeyUnpacked_42_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static IndCpaPrivateKeyUnpacked_42 default_f6_a3(void) { +static IndCpaPrivateKeyUnpacked_42 default_1a_a3(void) { IndCpaPrivateKeyUnpacked_42 lit; - lit.secret_as_ntt[0U] = ZERO_20_19(); - lit.secret_as_ntt[1U] = ZERO_20_19(); - lit.secret_as_ntt[2U] = ZERO_20_19(); - lit.secret_as_ntt[3U] = ZERO_20_19(); + lit.secret_as_ntt[0U] = ZERO_ef_19(); + lit.secret_as_ntt[1U] = ZERO_ef_19(); + lit.secret_as_ntt[2U] = ZERO_ef_19(); + lit.secret_as_ntt[3U] = ZERO_ef_19(); return lit; } @@ -2641,40 +2642,40 @@ typedef struct IndCpaPublicKeyUnpacked_42_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static IndCpaPublicKeyUnpacked_42 default_85_6b(void) { +static IndCpaPublicKeyUnpacked_42 default_8d_6b(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - uu____0[i] = ZERO_20_19();); + uu____0[i] = ZERO_ef_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_42 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)4U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_19(); - lit.A[0U][1U] = ZERO_20_19(); - lit.A[0U][2U] = ZERO_20_19(); - lit.A[0U][3U] = ZERO_20_19(); - lit.A[1U][0U] = ZERO_20_19(); - lit.A[1U][1U] = ZERO_20_19(); - lit.A[1U][2U] = ZERO_20_19(); - lit.A[1U][3U] = ZERO_20_19(); - lit.A[2U][0U] = ZERO_20_19(); - lit.A[2U][1U] = ZERO_20_19(); - lit.A[2U][2U] = ZERO_20_19(); - lit.A[2U][3U] = ZERO_20_19(); - lit.A[3U][0U] = ZERO_20_19(); - lit.A[3U][1U] = ZERO_20_19(); - lit.A[3U][2U] = ZERO_20_19(); - lit.A[3U][3U] = ZERO_20_19(); + lit.A[0U][0U] = ZERO_ef_19(); + lit.A[0U][1U] = ZERO_ef_19(); + lit.A[0U][2U] = ZERO_ef_19(); + lit.A[0U][3U] = ZERO_ef_19(); + lit.A[1U][0U] = ZERO_ef_19(); + lit.A[1U][1U] = ZERO_ef_19(); + lit.A[1U][2U] = ZERO_ef_19(); + lit.A[1U][3U] = ZERO_ef_19(); + lit.A[2U][0U] = ZERO_ef_19(); + lit.A[2U][1U] = ZERO_ef_19(); + lit.A[2U][2U] = ZERO_ef_19(); + lit.A[2U][3U] = ZERO_ef_19(); + lit.A[3U][0U] = ZERO_ef_19(); + lit.A[3U][1U] = ZERO_ef_19(); + lit.A[3U][2U] = ZERO_ef_19(); + lit.A[3U][3U] = ZERO_ef_19(); return lit; } @@ -2996,17 +2997,18 @@ static KRML_MUSTINLINE bool sample_from_uniform_distribution_next_fb0( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_20 +A monomorphic instance of libcrux_ml_kem.polynomial.from_i16_array_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -from_i16_array_20_bb(Eurydice_slice a) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); +from_i16_array_ef_bb(Eurydice_slice a) { + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3028,7 +3030,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba( int16_t s[272U]) { - return from_i16_array_20_bb( + return from_i16_array_ef_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -3197,7 +3199,7 @@ sample_from_binomial_distribution_2_1b(Eurydice_slice randomness) { sampled_i16s[(size_t)8U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_20_bb( + return from_i16_array_ef_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3241,7 +3243,7 @@ sample_from_binomial_distribution_3_ee(Eurydice_slice randomness) { sampled_i16s[(size_t)4U * chunk_number + offset] = outcome_1 - outcome_2; } } - return from_i16_array_20_bb( + return from_i16_array_ef_bb( Eurydice_array_to_slice((size_t)256U, sampled_i16s, int16_t)); } @@ -3407,15 +3409,16 @@ static KRML_MUSTINLINE void ntt_at_layer_1_21( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.poly_barrett_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void poly_barrett_reduce_20_0a( +static KRML_MUSTINLINE void poly_barrett_reduce_ef_0a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -3443,7 +3446,7 @@ static KRML_MUSTINLINE void ntt_binomially_sampled_ring_element_b3( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** @@ -3502,7 +3505,7 @@ static KRML_MUSTINLINE tuple_710 sample_vector_cbd_then_ntt_out_44( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - re_as_ntt[i] = ZERO_20_19();); + re_as_ntt[i] = ZERO_ef_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -3523,18 +3526,19 @@ static KRML_MUSTINLINE tuple_710 sample_vector_cbd_then_ntt_out_44( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_20 +A monomorphic instance of libcrux_ml_kem.polynomial.ntt_multiply_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -ntt_multiply_20_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, +ntt_multiply_ef_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 out = ZERO_ef_19(); for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { size_t i0 = i; @@ -3555,15 +3559,16 @@ ntt_multiply_20_76(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 4 */ -static KRML_MUSTINLINE void add_to_ring_element_20_3a( +static KRML_MUSTINLINE void add_to_ring_element_ef_3a( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -3596,15 +3601,16 @@ to_standard_domain_73( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_standard_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void add_standard_error_reduce_20_69( +static KRML_MUSTINLINE void add_standard_error_reduce_ef_69( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -3640,7 +3646,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f0( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -3653,10 +3659,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_3a(&t_as_ntt[i0], &product); + ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_3a(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -3709,7 +3715,7 @@ static void generate_keypair_unpacked_86( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -3727,8 +3733,8 @@ libcrux_ml_kem_variant_MlKem with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair1024 generate_keypair_791( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_42 private_key = default_f6_a3(); - IndCpaPublicKeyUnpacked_42 public_key = default_85_6b(); + IndCpaPrivateKeyUnpacked_42 private_key = default_1a_a3(); + IndCpaPublicKeyUnpacked_42 public_key = default_8d_6b(); generate_keypair_unpacked_86(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1568U]; serialize_public_key_8c( @@ -3880,7 +3886,7 @@ static KRML_MUSTINLINE tuple_710 sample_ring_element_cbd_f9(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - error_1[i] = ZERO_20_19();); + error_1[i] = ZERO_ef_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -4068,20 +4074,21 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_45( invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ -static KRML_MUSTINLINE void add_error_reduce_20_bd( +static KRML_MUSTINLINE void add_error_reduce_ef_bd( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error) { for (size_t i = (size_t)0U; @@ -4112,7 +4119,7 @@ static KRML_MUSTINLINE void compute_vector_u_cc( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - result0[i] = ZERO_20_19();); + result0[i] = ZERO_ef_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -4132,11 +4139,11 @@ static KRML_MUSTINLINE void compute_vector_u_cc( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(a_element, &r_as_ntt[j]); - add_to_ring_element_20_3a(&result0[i1], &product); + ntt_multiply_ef_76(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_3a(&result0[i1], &product); } invert_ntt_montgomery_45(&result0[i1]); - add_error_reduce_20_bd(&result0[i1], &error_1[i1]); + add_error_reduce_ef_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[4U]; memcpy( @@ -4173,7 +4180,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_then_decompress_message_52(uint8_t serialized[32U]) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); KRML_MAYBE_FOR16( i, (size_t)0U, (size_t)16U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_vector_portable_vector_type_PortableVector @@ -4190,16 +4197,17 @@ deserialize_then_decompress_message_52(uint8_t serialized[32U]) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_message_error_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -add_message_error_reduce_20_42( +add_message_error_reduce_ef_42( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result) { @@ -4234,13 +4242,13 @@ compute_ring_element_v_14( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_3a(&result, &product);); + ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_3a(&result, &product);); invert_ntt_montgomery_45(&result); - result = add_message_error_reduce_20_42(error_2, message, result); + result = add_message_error_reduce_ef_42(error_2, message, result); return result; } @@ -4593,7 +4601,7 @@ generics */ static void encrypt_f41(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1568U]) { - IndCpaPublicKeyUnpacked_42 unpacked_public_key = default_85_6b(); + IndCpaPublicKeyUnpacked_42 unpacked_public_key = default_8d_6b(); deserialize_ring_elements_reduced_bb( Eurydice_slice_subslice_to(public_key, (size_t)1536U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -4712,7 +4720,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_to_uncompressed_ring_element_7a(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)24U; i++) { size_t i0 = i; @@ -4736,7 +4744,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_a71( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_19();); + secret_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -4805,7 +4813,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_then_decompress_10_58(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); LowStar_Ignore_ignore( Eurydice_slice_len( Eurydice_array_to_slice( @@ -4872,7 +4880,7 @@ libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_then_decompress_11_5c(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)22U; i++) { size_t i0 = i; @@ -4914,7 +4922,7 @@ static KRML_MUSTINLINE void ntt_vector_u_72( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** @@ -4930,7 +4938,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_1e( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[4U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[4U]; KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, - u_as_ntt[i] = ZERO_20_19();); + u_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1568U, ciphertext, uint8_t), @@ -5001,7 +5009,7 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_then_decompress_4_6c(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)8U; i++) { size_t i0 = i; @@ -5061,7 +5069,7 @@ with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialize_then_decompress_5_96(Eurydice_slice serialized) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re = ZERO_ef_19(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(serialized, uint8_t) / (size_t)10U; i++) { size_t i0 = i; @@ -5089,16 +5097,17 @@ deserialize_then_decompress_ring_element_v_ad(Eurydice_slice serialized) { /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_20 +A monomorphic instance of libcrux_ml_kem.polynomial.subtract_reduce_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics */ static KRML_MUSTINLINE libcrux_ml_kem_polynomial_PolynomialRingElement_f0 -subtract_reduce_20_87(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, +subtract_reduce_ef_87(libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 b) { for (size_t i = (size_t)0U; i < LIBCRUX_ML_KEM_POLYNOMIAL_VECTORS_IN_RING_ELEMENT; i++) { @@ -5127,13 +5136,13 @@ compute_message_7e( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR4(i, (size_t)0U, (size_t)4U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_3a(&result, &product);); + ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_3a(&result, &product);); invert_ntt_montgomery_45(&result); - result = subtract_reduce_20_87(v, result); + result = subtract_reduce_ef_87(v, result); return result; } @@ -5371,7 +5380,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_610( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - deserialized_pk[i] = ZERO_20_19();); + deserialized_pk[i] = ZERO_ef_19();); deserialize_ring_elements_reduced_bb0(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -5525,18 +5534,18 @@ typedef struct IndCpaPrivateKeyUnpacked_ae_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static IndCpaPrivateKeyUnpacked_ae default_f6_a30(void) { +static IndCpaPrivateKeyUnpacked_ae default_1a_a30(void) { IndCpaPrivateKeyUnpacked_ae lit; - lit.secret_as_ntt[0U] = ZERO_20_19(); - lit.secret_as_ntt[1U] = ZERO_20_19(); + lit.secret_as_ntt[0U] = ZERO_ef_19(); + lit.secret_as_ntt[1U] = ZERO_ef_19(); return lit; } @@ -5555,28 +5564,28 @@ typedef struct IndCpaPublicKeyUnpacked_ae_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static IndCpaPublicKeyUnpacked_ae default_85_6b0(void) { +static IndCpaPublicKeyUnpacked_ae default_8d_6b0(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - uu____0[i] = ZERO_20_19();); + uu____0[i] = ZERO_ef_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_ae lit; memcpy( lit.t_as_ntt, uu____0, (size_t)2U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_19(); - lit.A[0U][1U] = ZERO_20_19(); - lit.A[1U][0U] = ZERO_20_19(); - lit.A[1U][1U] = ZERO_20_19(); + lit.A[0U][0U] = ZERO_ef_19(); + lit.A[0U][1U] = ZERO_ef_19(); + lit.A[1U][0U] = ZERO_ef_19(); + lit.A[1U][1U] = ZERO_ef_19(); return lit; } @@ -5905,7 +5914,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba0( int16_t s[272U]) { - return from_i16_array_20_bb( + return from_i16_array_ef_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -6100,7 +6109,7 @@ static KRML_MUSTINLINE tuple_740 sample_vector_cbd_then_ntt_out_440( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - re_as_ntt[i] = ZERO_20_19();); + re_as_ntt[i] = ZERO_ef_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6121,15 +6130,16 @@ static KRML_MUSTINLINE tuple_740 sample_vector_cbd_then_ntt_out_440( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 2 */ -static KRML_MUSTINLINE void add_to_ring_element_20_3a0( +static KRML_MUSTINLINE void add_to_ring_element_ef_3a0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -6167,7 +6177,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f00( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -6180,10 +6190,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f00( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_3a0(&t_as_ntt[i0], &product); + ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_3a0(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -6236,7 +6246,7 @@ static void generate_keypair_unpacked_860( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -6254,8 +6264,8 @@ libcrux_ml_kem_variant_MlKem with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair512 generate_keypair_790( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_ae private_key = default_f6_a30(); - IndCpaPublicKeyUnpacked_ae public_key = default_85_6b0(); + IndCpaPrivateKeyUnpacked_ae private_key = default_1a_a30(); + IndCpaPublicKeyUnpacked_ae public_key = default_8d_6b0(); generate_keypair_unpacked_860(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[800U]; serialize_public_key_8c0( @@ -6439,7 +6449,7 @@ static KRML_MUSTINLINE tuple_740 sample_ring_element_cbd_f90(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - error_1[i] = ZERO_20_19();); + error_1[i] = ZERO_ef_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -6503,7 +6513,7 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_450( invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** @@ -6519,7 +6529,7 @@ static KRML_MUSTINLINE void compute_vector_u_cc0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - result0[i] = ZERO_20_19();); + result0[i] = ZERO_ef_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -6539,11 +6549,11 @@ static KRML_MUSTINLINE void compute_vector_u_cc0( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(a_element, &r_as_ntt[j]); - add_to_ring_element_20_3a0(&result0[i1], &product); + ntt_multiply_ef_76(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_3a0(&result0[i1], &product); } invert_ntt_montgomery_450(&result0[i1]); - add_error_reduce_20_bd(&result0[i1], &error_1[i1]); + add_error_reduce_ef_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[2U]; memcpy( @@ -6566,13 +6576,13 @@ compute_ring_element_v_140( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_3a0(&result, &product);); + ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_3a0(&result, &product);); invert_ntt_montgomery_450(&result); - result = add_message_error_reduce_20_42(error_2, message, result); + result = add_message_error_reduce_ef_42(error_2, message, result); return result; } @@ -6754,7 +6764,7 @@ generics */ static void encrypt_f40(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[768U]) { - IndCpaPublicKeyUnpacked_ae unpacked_public_key = default_85_6b0(); + IndCpaPublicKeyUnpacked_ae unpacked_public_key = default_8d_6b0(); deserialize_ring_elements_reduced_bb0( Eurydice_slice_subslice_to(public_key, (size_t)768U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -6876,7 +6886,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_a70( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_19();); + secret_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -6927,7 +6937,7 @@ static KRML_MUSTINLINE void ntt_vector_u_720( ntt_at_layer_3_1b(&zeta_i, re); ntt_at_layer_2_ea(&zeta_i, re); ntt_at_layer_1_21(&zeta_i, re); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** @@ -6943,7 +6953,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_1e0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[2U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[2U]; KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, - u_as_ntt[i] = ZERO_20_19();); + u_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)768U, ciphertext, uint8_t), @@ -6991,13 +7001,13 @@ compute_message_7e0( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR2(i, (size_t)0U, (size_t)2U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_3a0(&result, &product);); + ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_3a0(&result, &product);); invert_ntt_montgomery_450(&result); - result = subtract_reduce_20_87(v, result); + result = subtract_reduce_ef_87(v, result); return result; } @@ -7195,7 +7205,7 @@ static KRML_MUSTINLINE void deserialize_ring_elements_reduced_out_61( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 deserialized_pk[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - deserialized_pk[i] = ZERO_20_19();); + deserialized_pk[i] = ZERO_ef_19();); deserialize_ring_elements_reduced_bb1(public_key, deserialized_pk); memcpy( ret, deserialized_pk, @@ -7349,19 +7359,19 @@ typedef struct IndCpaPrivateKeyUnpacked_f8_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPrivateKeyUnpacked[TraitClause@0])} +K>[TraitClause@0, TraitClause@1])} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_f6 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_1a with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static IndCpaPrivateKeyUnpacked_f8 default_f6_a31(void) { +static IndCpaPrivateKeyUnpacked_f8 default_1a_a31(void) { IndCpaPrivateKeyUnpacked_f8 lit; - lit.secret_as_ntt[0U] = ZERO_20_19(); - lit.secret_as_ntt[1U] = ZERO_20_19(); - lit.secret_as_ntt[2U] = ZERO_20_19(); + lit.secret_as_ntt[0U] = ZERO_ef_19(); + lit.secret_as_ntt[1U] = ZERO_ef_19(); + lit.secret_as_ntt[2U] = ZERO_ef_19(); return lit; } @@ -7380,33 +7390,33 @@ typedef struct IndCpaPublicKeyUnpacked_f8_s { /** This function found in impl {(core::default::Default for libcrux_ml_kem::ind_cpa::unpacked::IndCpaPublicKeyUnpacked[TraitClause@0])#1} +K>[TraitClause@0, TraitClause@1])#1} */ /** -A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_85 +A monomorphic instance of libcrux_ml_kem.ind_cpa.unpacked.default_8d with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static IndCpaPublicKeyUnpacked_f8 default_85_6b1(void) { +static IndCpaPublicKeyUnpacked_f8 default_8d_6b1(void) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - uu____0[i] = ZERO_20_19();); + uu____0[i] = ZERO_ef_19();); uint8_t uu____1[32U] = {0U}; IndCpaPublicKeyUnpacked_f8 lit; memcpy( lit.t_as_ntt, uu____0, (size_t)3U * sizeof(libcrux_ml_kem_polynomial_PolynomialRingElement_f0)); memcpy(lit.seed_for_A, uu____1, (size_t)32U * sizeof(uint8_t)); - lit.A[0U][0U] = ZERO_20_19(); - lit.A[0U][1U] = ZERO_20_19(); - lit.A[0U][2U] = ZERO_20_19(); - lit.A[1U][0U] = ZERO_20_19(); - lit.A[1U][1U] = ZERO_20_19(); - lit.A[1U][2U] = ZERO_20_19(); - lit.A[2U][0U] = ZERO_20_19(); - lit.A[2U][1U] = ZERO_20_19(); - lit.A[2U][2U] = ZERO_20_19(); + lit.A[0U][0U] = ZERO_ef_19(); + lit.A[0U][1U] = ZERO_ef_19(); + lit.A[0U][2U] = ZERO_ef_19(); + lit.A[1U][0U] = ZERO_ef_19(); + lit.A[1U][1U] = ZERO_ef_19(); + lit.A[1U][2U] = ZERO_ef_19(); + lit.A[2U][0U] = ZERO_ef_19(); + lit.A[2U][1U] = ZERO_ef_19(); + lit.A[2U][2U] = ZERO_ef_19(); return lit; } @@ -7735,7 +7745,7 @@ generics */ static libcrux_ml_kem_polynomial_PolynomialRingElement_f0 closure_ba1( int16_t s[272U]) { - return from_i16_array_20_bb( + return from_i16_array_ef_bb( Eurydice_array_to_subslice2(s, (size_t)0U, (size_t)256U, int16_t)); } @@ -7919,7 +7929,7 @@ static KRML_MUSTINLINE tuple_b00 sample_vector_cbd_then_ntt_out_441( uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 re_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - re_as_ntt[i] = ZERO_20_19();); + re_as_ntt[i] = ZERO_ef_19();); libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *uu____0 = re_as_ntt; uint8_t uu____1[33U]; memcpy(uu____1, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -7940,15 +7950,16 @@ static KRML_MUSTINLINE tuple_b00 sample_vector_cbd_then_ntt_out_441( /** This function found in impl -{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0]#2} +{libcrux_ml_kem::polynomial::PolynomialRingElement[TraitClause@0, +TraitClause@1]#2} */ /** -A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_20 +A monomorphic instance of libcrux_ml_kem.polynomial.add_to_ring_element_ef with types libcrux_ml_kem_vector_portable_vector_type_PortableVector with const generics - K= 3 */ -static KRML_MUSTINLINE void add_to_ring_element_20_3a1( +static KRML_MUSTINLINE void add_to_ring_element_ef_3a1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *self, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *rhs) { for (size_t i = (size_t)0U; @@ -7986,7 +7997,7 @@ static KRML_MUSTINLINE void compute_As_plus_e_f01( i++) { size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *row = matrix_A[i0]; - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 uu____0 = ZERO_ef_19(); t_as_ntt[i0] = uu____0; for (size_t i1 = (size_t)0U; i1 < Eurydice_slice_len( @@ -7999,10 +8010,10 @@ static KRML_MUSTINLINE void compute_As_plus_e_f01( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *matrix_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(matrix_element, &s_as_ntt[j]); - add_to_ring_element_20_3a1(&t_as_ntt[i0], &product); + ntt_multiply_ef_76(matrix_element, &s_as_ntt[j]); + add_to_ring_element_ef_3a1(&t_as_ntt[i0], &product); } - add_standard_error_reduce_20_69(&t_as_ntt[i0], &error_as_ntt[i0]); + add_standard_error_reduce_ef_69(&t_as_ntt[i0], &error_as_ntt[i0]); } } @@ -8055,7 +8066,7 @@ static void generate_keypair_unpacked_861( uint8_t uu____5[32U]; core_result_Result_00 dst; Eurydice_slice_to_array2(&dst, seed_for_A, Eurydice_slice, uint8_t[32U]); - core_result_unwrap_41_33(dst, uu____5); + core_result_unwrap_26_33(dst, uu____5); memcpy(public_key->seed_for_A, uu____5, (size_t)32U * sizeof(uint8_t)); } @@ -8073,8 +8084,8 @@ libcrux_ml_kem_variant_MlKem with const generics */ static libcrux_ml_kem_utils_extraction_helper_Keypair768 generate_keypair_79( Eurydice_slice key_generation_seed) { - IndCpaPrivateKeyUnpacked_f8 private_key = default_f6_a31(); - IndCpaPublicKeyUnpacked_f8 public_key = default_85_6b1(); + IndCpaPrivateKeyUnpacked_f8 private_key = default_1a_a31(); + IndCpaPublicKeyUnpacked_f8 public_key = default_8d_6b1(); generate_keypair_unpacked_861(key_generation_seed, &private_key, &public_key); uint8_t public_key_serialized[1184U]; serialize_public_key_8c1( @@ -8226,7 +8237,7 @@ static KRML_MUSTINLINE tuple_b00 sample_ring_element_cbd_f91(uint8_t prf_input[33U], uint8_t domain_separator) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 error_1[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - error_1[i] = ZERO_20_19();); + error_1[i] = ZERO_ef_19();); /* Passing arrays by value in Rust generates a copy in C */ uint8_t copy_of_prf_input[33U]; memcpy(copy_of_prf_input, prf_input, (size_t)33U * sizeof(uint8_t)); @@ -8290,7 +8301,7 @@ static KRML_MUSTINLINE void invert_ntt_montgomery_451( invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)5U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)6U); invert_ntt_at_layer_4_plus_8c(&zeta_i, re, (size_t)7U); - poly_barrett_reduce_20_0a(re); + poly_barrett_reduce_ef_0a(re); } /** @@ -8306,7 +8317,7 @@ static KRML_MUSTINLINE void compute_vector_u_cc1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result0[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - result0[i] = ZERO_20_19();); + result0[i] = ZERO_ef_19();); for (size_t i0 = (size_t)0U; i0 < Eurydice_slice_len( Eurydice_array_to_slice( @@ -8326,11 +8337,11 @@ static KRML_MUSTINLINE void compute_vector_u_cc1( size_t j = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *a_element = &row[j]; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(a_element, &r_as_ntt[j]); - add_to_ring_element_20_3a1(&result0[i1], &product); + ntt_multiply_ef_76(a_element, &r_as_ntt[j]); + add_to_ring_element_ef_3a1(&result0[i1], &product); } invert_ntt_montgomery_451(&result0[i1]); - add_error_reduce_20_bd(&result0[i1], &error_1[i1]); + add_error_reduce_ef_bd(&result0[i1], &error_1[i1]); } libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result[3U]; memcpy( @@ -8353,13 +8364,13 @@ compute_ring_element_v_141( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *r_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *error_2, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *message) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&t_as_ntt[i0], &r_as_ntt[i0]); - add_to_ring_element_20_3a1(&result, &product);); + ntt_multiply_ef_76(&t_as_ntt[i0], &r_as_ntt[i0]); + add_to_ring_element_ef_3a1(&result, &product);); invert_ntt_montgomery_451(&result); - result = add_message_error_reduce_20_42(error_2, message, result); + result = add_message_error_reduce_ef_42(error_2, message, result); return result; } @@ -8490,7 +8501,7 @@ generics */ static void encrypt_f4(Eurydice_slice public_key, uint8_t message[32U], Eurydice_slice randomness, uint8_t ret[1088U]) { - IndCpaPublicKeyUnpacked_f8 unpacked_public_key = default_85_6b1(); + IndCpaPublicKeyUnpacked_f8 unpacked_public_key = default_8d_6b1(); deserialize_ring_elements_reduced_bb1( Eurydice_slice_subslice_to(public_key, (size_t)1152U, uint8_t, size_t), unpacked_public_key.t_as_ntt); @@ -8612,7 +8623,7 @@ static KRML_MUSTINLINE void deserialize_secret_key_a7( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 secret_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - secret_as_ntt[i] = ZERO_20_19();); + secret_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len(secret_key, uint8_t) / LIBCRUX_ML_KEM_CONSTANTS_BYTES_PER_RING_ELEMENT; @@ -8649,7 +8660,7 @@ static KRML_MUSTINLINE void deserialize_then_decompress_u_1e1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 ret[3U]) { libcrux_ml_kem_polynomial_PolynomialRingElement_f0 u_as_ntt[3U]; KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, - u_as_ntt[i] = ZERO_20_19();); + u_as_ntt[i] = ZERO_ef_19();); for (size_t i = (size_t)0U; i < Eurydice_slice_len( Eurydice_array_to_slice((size_t)1088U, ciphertext, uint8_t), @@ -8686,13 +8697,13 @@ compute_message_7e1( libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *v, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *secret_as_ntt, libcrux_ml_kem_polynomial_PolynomialRingElement_f0 *u_as_ntt) { - libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_20_19(); + libcrux_ml_kem_polynomial_PolynomialRingElement_f0 result = ZERO_ef_19(); KRML_MAYBE_FOR3(i, (size_t)0U, (size_t)3U, (size_t)1U, size_t i0 = i; libcrux_ml_kem_polynomial_PolynomialRingElement_f0 product = - ntt_multiply_20_76(&secret_as_ntt[i0], &u_as_ntt[i0]); - add_to_ring_element_20_3a1(&result, &product);); + ntt_multiply_ef_76(&secret_as_ntt[i0], &u_as_ntt[i0]); + add_to_ring_element_ef_3a1(&result, &product);); invert_ntt_montgomery_451(&result); - result = subtract_reduce_20_87(v, result); + result = subtract_reduce_ef_87(v, result); return result; } diff --git a/libcrux-ml-kem/c/libcrux_mlkem_portable.h b/libcrux-ml-kem/c/libcrux_mlkem_portable.h index 148c73ed6..850ef79ff 100644 --- a/libcrux-ml-kem/c/libcrux_mlkem_portable.h +++ b/libcrux-ml-kem/c/libcrux_mlkem_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem_portable_H diff --git a/libcrux-ml-kem/c/libcrux_sha3.h b/libcrux-ml-kem/c/libcrux_sha3.h index 7c2339260..3c9d12e58 100644 --- a/libcrux-ml-kem/c/libcrux_sha3.h +++ b/libcrux-ml-kem/c/libcrux_sha3.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_H diff --git a/libcrux-ml-kem/c/libcrux_sha3_avx2.c b/libcrux-ml-kem/c/libcrux_sha3_avx2.c index 1ff80c854..b246030f2 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_avx2.c +++ b/libcrux-ml-kem/c/libcrux_sha3_avx2.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "internal/libcrux_sha3_avx2.h" @@ -167,16 +167,16 @@ split_at_mut_n_ef(Eurydice_slice a[4U], size_t mid) { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0]#1} +N>[TraitClause@0, TraitClause@1]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_1e +A monomorphic instance of libcrux_sha3.generic_keccak.new_89 with types core_core_arch_x86___m256i with const generics - N= 4 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_29 -new_1e_71(void) { +new_89_71(void) { libcrux_sha3_generic_keccak_KeccakState_29 lit; lit.st[0U][0U] = zero_ef(); lit.st[0U][1U] = zero_ef(); @@ -1679,7 +1679,7 @@ with const generics */ static KRML_MUSTINLINE void keccak_b9(Eurydice_slice data[4U], Eurydice_slice out[4U]) { - libcrux_sha3_generic_keccak_KeccakState_29 s = new_1e_71(); + libcrux_sha3_generic_keccak_KeccakState_29 s = new_89_71(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -1719,7 +1719,7 @@ static KRML_MUSTINLINE void keccak_b9(Eurydice_slice data[4U], .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1757,7 +1757,7 @@ void libcrux_sha3_avx2_x4_shake256(Eurydice_slice input0, Eurydice_slice input1, */ libcrux_sha3_generic_keccak_KeccakState_29 libcrux_sha3_avx2_x4_incremental_init(void) { - return new_1e_71(); + return new_89_71(); } /** diff --git a/libcrux-ml-kem/c/libcrux_sha3_avx2.h b/libcrux-ml-kem/c/libcrux_sha3_avx2.h index 4a83c4c39..ae63d5635 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/c/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_avx2_H diff --git a/libcrux-ml-kem/c/libcrux_sha3_internal.h b/libcrux-ml-kem/c/libcrux_sha3_internal.h index 2986801bc..1ccb6aef7 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_internal.h +++ b/libcrux-ml-kem/c/libcrux_sha3_internal.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_internal_H @@ -192,16 +192,16 @@ typedef struct libcrux_sha3_generic_keccak_KeccakState_48_s { */ /** This function found in impl {libcrux_sha3::generic_keccak::KeccakState[TraitClause@0]#1} +N>[TraitClause@0, TraitClause@1]#1} */ /** -A monomorphic instance of libcrux_sha3.generic_keccak.new_1e +A monomorphic instance of libcrux_sha3.generic_keccak.new_89 with types uint64_t with const generics - N= 1 */ static KRML_MUSTINLINE libcrux_sha3_generic_keccak_KeccakState_48 -libcrux_sha3_generic_keccak_new_1e_cf(void) { +libcrux_sha3_generic_keccak_new_89_cf(void) { libcrux_sha3_generic_keccak_KeccakState_48 lit; lit.st[0U][0U] = libcrux_sha3_portable_keccak_zero_5a(); lit.st[0U][1U] = libcrux_sha3_portable_keccak_zero_5a(); @@ -247,7 +247,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_65( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, uu____0); + core_result_unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1465,7 +1465,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_650( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, uu____0); + core_result_unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -1740,7 +1740,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)168U; i++) { size_t i0 = i; @@ -1781,7 +1781,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_064( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -1832,7 +1832,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_653( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, uu____0); + core_result_unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2089,7 +2089,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)104U; i++) { size_t i0 = i; @@ -2130,7 +2130,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_063( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2181,7 +2181,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_652( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, uu____0); + core_result_unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -2438,7 +2438,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)144U; i++) { size_t i0 = i; @@ -2479,7 +2479,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_062( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2627,7 +2627,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2668,7 +2668,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_061( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2745,7 +2745,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)136U; i++) { size_t i0 = i; @@ -2786,7 +2786,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_060( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; @@ -2837,7 +2837,7 @@ static KRML_MUSTINLINE void libcrux_sha3_portable_keccak_load_block_651( Eurydice_slice_subslice2(blocks[0U], (size_t)8U * i0, (size_t)8U * i0 + (size_t)8U, uint8_t), Eurydice_slice, uint8_t[8U]); - core_result_unwrap_41_0e(dst, uu____0); + core_result_unwrap_26_0e(dst, uu____0); size_t uu____1 = i0 / (size_t)5U; size_t uu____2 = i0 % (size_t)5U; s[uu____1][uu____2] = @@ -3093,7 +3093,7 @@ with const generics static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( Eurydice_slice data[1U], Eurydice_slice out[1U]) { libcrux_sha3_generic_keccak_KeccakState_48 s = - libcrux_sha3_generic_keccak_new_1e_cf(); + libcrux_sha3_generic_keccak_new_89_cf(); for (size_t i = (size_t)0U; i < Eurydice_slice_len(data[0U], uint8_t) / (size_t)72U; i++) { size_t i0 = i; @@ -3134,7 +3134,7 @@ static KRML_MUSTINLINE void libcrux_sha3_generic_keccak_keccak_06( .end = blocks}), core_ops_range_Range_b3, core_ops_range_Range_b3); while (true) { - if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A___6__next( + if (core_iter_range___core__iter__traits__iterator__Iterator_for_core__ops__range__Range_A__TraitClause_0___6__next( &iter, size_t, core_option_Option_b3) .tag == core_option_None) { break; diff --git a/libcrux-ml-kem/c/libcrux_sha3_neon.c b/libcrux-ml-kem/c/libcrux_sha3_neon.c index ebfa2320d..e84736e6c 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_neon.c +++ b/libcrux-ml-kem/c/libcrux_sha3_neon.c @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #include "libcrux_sha3_neon.h" diff --git a/libcrux-ml-kem/c/libcrux_sha3_neon.h b/libcrux-ml-kem/c/libcrux_sha3_neon.h index 6756fcc4b..dcf61fdac 100644 --- a/libcrux-ml-kem/c/libcrux_sha3_neon.h +++ b/libcrux-ml-kem/c/libcrux_sha3_neon.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d - * Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46 - * Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0 + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 + * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 9e07b1b2962c1f8d7ad6c5cacb94bd68fd4d8a3d + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_neon_H diff --git a/libcrux-ml-kem/cg/code_gen.txt b/libcrux-ml-kem/cg/code_gen.txt index cfb1412a1..e4e28910d 100644 --- a/libcrux-ml-kem/cg/code_gen.txt +++ b/libcrux-ml-kem/cg/code_gen.txt @@ -1,6 +1,6 @@ This code was generated with the following revisions: -Charon: 1bd0af95285033fec42133810440d56977c17ade +Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac -Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 +Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd -Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 +Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 diff --git a/libcrux-ml-kem/cg/libcrux_core.h b/libcrux-ml-kem/cg/libcrux_core.h index c34810389..167e6f0ec 100644 --- a/libcrux-ml-kem/cg/libcrux_core.h +++ b/libcrux-ml-kem/cg/libcrux_core.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_core_H diff --git a/libcrux-ml-kem/cg/libcrux_ct_ops.h b/libcrux-ml-kem/cg/libcrux_ct_ops.h index 8d410ee3b..be254be76 100644 --- a/libcrux-ml-kem/cg/libcrux_ct_ops.h +++ b/libcrux-ml-kem/cg/libcrux_ct_ops.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_ct_ops_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h index af0f83010..31e79d8fb 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_avx2_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h index 25b048abc..9d502829e 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_avx2_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_avx2_types_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h index ded408c91..32f0d2918 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_portable_H diff --git a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h index 026ba1bf6..b8421f790 100644 --- a/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h +++ b/libcrux-ml-kem/cg/libcrux_mlkem768_portable_types.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_mlkem768_portable_types_H diff --git a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h index 4343a48cd..5b77b14b3 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_avx2.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_avx2.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_avx2_H diff --git a/libcrux-ml-kem/cg/libcrux_sha3_portable.h b/libcrux-ml-kem/cg/libcrux_sha3_portable.h index 10e5c1870..eb7601a34 100644 --- a/libcrux-ml-kem/cg/libcrux_sha3_portable.h +++ b/libcrux-ml-kem/cg/libcrux_sha3_portable.h @@ -4,11 +4,11 @@ * SPDX-License-Identifier: MIT or Apache-2.0 * * This code was generated with the following revisions: - * Charon: 1bd0af95285033fec42133810440d56977c17ade + * Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4 * Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac - * Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8 + * Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152 * F*: 650b216aeb5901ec6f1c44ff275acd924e54bdbd - * Libcrux: 5971b6982c7af3edf6b84c36aa90697e599288a4 + * Libcrux: ff16b9e8164d0fd89efabd103d4a6c874df0c127 */ #ifndef __libcrux_sha3_portable_H