Skip to content

Commit

Permalink
add read/write for avx2 unpacked keys
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Sep 27, 2024
1 parent 8c05744 commit 08cdf38
Show file tree
Hide file tree
Showing 17 changed files with 1,780 additions and 785 deletions.
6 changes: 3 additions & 3 deletions libcrux-ml-kem/cg/code_gen.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This code was generated with the following revisions:
Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4
Charon: 65c45918a38d1b3e2155d3d69e9831b670d0a09f
Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8
F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
Libcrux: 65d06b7e81ff34bcc90ca741249b4545ebcec5b3
Libcrux: 6a8770c9d9d51b553169e0f2cc8cfd808fc7caa6
34 changes: 17 additions & 17 deletions libcrux-ml-kem/cg/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* SPDX-License-Identifier: MIT or Apache-2.0
*
* This code was generated with the following revisions:
* Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4
* Charon: 65c45918a38d1b3e2155d3d69e9831b670d0a09f
* Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
* Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
* Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 65d06b7e81ff34bcc90ca741249b4545ebcec5b3
* Libcrux: 6a8770c9d9d51b553169e0f2cc8cfd808fc7caa6
*/

#ifndef __libcrux_core_H
Expand All @@ -30,26 +30,26 @@ typedef struct core_ops_range_Range_b3_s {
size_t end;
} core_ops_range_Range_b3;

#define Ok 0
#define Err 1

typedef uint8_t Result_86_tags;

#define None 0
#define Some 1

typedef uint8_t Option_ef_tags;
typedef uint8_t Option_b3_tags;

/**
A monomorphic instance of core.option.Option
with types size_t
*/
typedef struct Option_b3_s {
Option_ef_tags tag;
Option_b3_tags tag;
size_t f0;
} Option_b3;

#define Ok 0
#define Err 1

typedef uint8_t Result_86_tags;

static inline uint16_t core_num__u16_7__wrapping_add(uint16_t x0, uint16_t x1);

#define CORE_NUM__U32_8__BITS (32U)
Expand Down Expand Up @@ -224,7 +224,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_07
with const generics
- SIZE= 1088
*/
static inline uint8_t *libcrux_ml_kem_types_as_slice_07_4f(
static inline uint8_t *libcrux_ml_kem_types_as_slice_07_46(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self) {
return self->value;
}
Expand All @@ -248,7 +248,7 @@ with const generics
- SIZE= 1184
*/
static inline libcrux_ml_kem_types_MlKemPublicKey_15
libcrux_ml_kem_types_from_40_60(uint8_t value[1184U]) {
libcrux_ml_kem_types_from_40_cb(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));
Expand Down Expand Up @@ -285,7 +285,7 @@ with const generics
- PUBLIC_KEY_SIZE= 1184
*/
static inline libcrux_ml_kem_mlkem768_MlKem768KeyPair
libcrux_ml_kem_types_from_17_8b(libcrux_ml_kem_types_MlKemPrivateKey_55 sk,
libcrux_ml_kem_types_from_17_dc(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});
Expand All @@ -301,7 +301,7 @@ with const generics
- SIZE= 2400
*/
static inline libcrux_ml_kem_types_MlKemPrivateKey_55
libcrux_ml_kem_types_from_88_2d(uint8_t value[2400U]) {
libcrux_ml_kem_types_from_88_58(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));
Expand Down Expand Up @@ -365,7 +365,7 @@ with const generics
- SIZE= 1088
*/
static inline libcrux_ml_kem_mlkem768_MlKem768Ciphertext
libcrux_ml_kem_types_from_fc_cd(uint8_t value[1088U]) {
libcrux_ml_kem_types_from_fc_89(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));
Expand All @@ -385,7 +385,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_ba
with const generics
- SIZE= 1184
*/
static inline uint8_t *libcrux_ml_kem_types_as_slice_ba_91(
static inline uint8_t *libcrux_ml_kem_types_as_slice_ba_c1(
libcrux_ml_kem_types_MlKemPublicKey_15 *self) {
return self->value;
}
Expand Down Expand Up @@ -437,7 +437,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_ref_fd
with const generics
- SIZE= 1088
*/
static inline Eurydice_slice libcrux_ml_kem_types_as_ref_fd_7b(
static inline Eurydice_slice libcrux_ml_kem_types_as_ref_fd_89(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self) {
return Eurydice_array_to_slice((size_t)1088U, self->value, uint8_t);
}
Expand Down
6 changes: 3 additions & 3 deletions libcrux-ml-kem/cg/libcrux_ct_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* SPDX-License-Identifier: MIT or Apache-2.0
*
* This code was generated with the following revisions:
* Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4
* Charon: 65c45918a38d1b3e2155d3d69e9831b670d0a09f
* Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
* Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
* Karamel: baec61db14d5132ae8eb4bd7a288638b7f2f1db8
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 65d06b7e81ff34bcc90ca741249b4545ebcec5b3
* Libcrux: 6a8770c9d9d51b553169e0f2cc8cfd808fc7caa6
*/

#ifndef __libcrux_ct_ops_H
Expand Down
Loading

0 comments on commit 08cdf38

Please sign in to comment.