Skip to content

Commit

Permalink
update extracted C code
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Sep 9, 2024
1 parent 99498ee commit 717b165
Show file tree
Hide file tree
Showing 40 changed files with 2,425 additions and 2,302 deletions.
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/code_gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ This code was generated with the following revisions:
Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d
Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46
Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0
F*: 58c915a86a2c07c8eca8d9deafd76cb7a91f0eb7
Libcrux: 6ff01fb3c57ff29ecb59bc62d9dc7fd231060cfb
F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
Libcrux: 99498eed461fa03566e0382b445c77bd2af5b59d
52 changes: 26 additions & 26 deletions libcrux-ml-kem/c/internal/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d
* Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46
* Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0
* F*: 58c915a86a2c07c8eca8d9deafd76cb7a91f0eb7
* Libcrux: 6ff01fb3c57ff29ecb59bc62d9dc7fd231060cfb
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 99498eed461fa03566e0382b445c77bd2af5b59d
*/

#ifndef __internal_libcrux_core_H
Expand Down Expand Up @@ -69,7 +69,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_b6
with const generics
- SIZE= 1568
*/
libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_b6_961(
libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_b6_8c1(
uint8_t value[1568U]);

/**
Expand All @@ -85,7 +85,7 @@ with const generics
- PRIVATE_KEY_SIZE= 3168
- PUBLIC_KEY_SIZE= 1568
*/
libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_17_821(
libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_17_f61(
libcrux_ml_kem_types_MlKemPrivateKey_95 sk,
libcrux_ml_kem_types_MlKemPublicKey_1f pk);

Expand All @@ -98,7 +98,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_05
with const generics
- SIZE= 3168
*/
libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_05_891(
libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_05_9d1(
uint8_t value[3168U]);

/**
Expand All @@ -110,7 +110,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_01
with const generics
- SIZE= 1568
*/
libcrux_ml_kem_mlkem1024_MlKem1024Ciphertext libcrux_ml_kem_types_from_01_331(
libcrux_ml_kem_mlkem1024_MlKem1024Ciphertext libcrux_ml_kem_types_from_01_131(
uint8_t value[1568U]);

/**
Expand All @@ -124,7 +124,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_cb
with const generics
- SIZE= 1568
*/
uint8_t *libcrux_ml_kem_types_as_slice_cb_3d1(
uint8_t *libcrux_ml_kem_types_as_slice_cb_a91(
libcrux_ml_kem_types_MlKemPublicKey_1f *self);

/**
Expand All @@ -136,7 +136,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_d81(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_df1(
libcrux_ml_kem_mlkem1024_MlKem1024Ciphertext *self);

/**
Expand All @@ -147,7 +147,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 1600
*/
void libcrux_ml_kem_utils_into_padded_array_6d4(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_424(Eurydice_slice slice,
uint8_t ret[1600U]);

/**
Expand All @@ -159,7 +159,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_b6
with const generics
- SIZE= 1184
*/
libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_b6_960(
libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_b6_8c0(
uint8_t value[1184U]);

/**
Expand All @@ -175,7 +175,7 @@ with const generics
- PRIVATE_KEY_SIZE= 2400
- PUBLIC_KEY_SIZE= 1184
*/
libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_17_820(
libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_17_f60(
libcrux_ml_kem_types_MlKemPrivateKey_55 sk,
libcrux_ml_kem_types_MlKemPublicKey_15 pk);

Expand All @@ -188,7 +188,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_05
with const generics
- SIZE= 2400
*/
libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_05_890(
libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_05_9d0(
uint8_t value[2400U]);

/**
Expand All @@ -200,7 +200,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_330(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_130(
uint8_t value[1088U]);

/**
Expand All @@ -214,7 +214,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_cb
with const generics
- SIZE= 1184
*/
uint8_t *libcrux_ml_kem_types_as_slice_cb_3d0(
uint8_t *libcrux_ml_kem_types_as_slice_cb_a90(
libcrux_ml_kem_types_MlKemPublicKey_15 *self);

/**
Expand All @@ -226,7 +226,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_d80(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_df0(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self);

/**
Expand All @@ -237,7 +237,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 1120
*/
void libcrux_ml_kem_utils_into_padded_array_6d3(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_423(Eurydice_slice slice,
uint8_t ret[1120U]);

/**
Expand All @@ -249,7 +249,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_b6
with const generics
- SIZE= 800
*/
libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_b6_96(
libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_b6_8c(
uint8_t value[800U]);

/**
Expand All @@ -265,7 +265,7 @@ with const generics
- PRIVATE_KEY_SIZE= 1632
- PUBLIC_KEY_SIZE= 800
*/
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_17_82(
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_17_f6(
libcrux_ml_kem_types_MlKemPrivateKey_5e sk,
libcrux_ml_kem_types_MlKemPublicKey_be pk);

Expand All @@ -278,7 +278,7 @@ A monomorphic instance of libcrux_ml_kem.types.from_05
with const generics
- SIZE= 1632
*/
libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_05_89(
libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_05_9d(
uint8_t value[1632U]);

/**
Expand Down Expand Up @@ -313,7 +313,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_33(
libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_13(
uint8_t value[768U]);

/**
Expand All @@ -327,7 +327,7 @@ A monomorphic instance of libcrux_ml_kem.types.as_slice_cb
with const generics
- SIZE= 800
*/
uint8_t *libcrux_ml_kem_types_as_slice_cb_3d(
uint8_t *libcrux_ml_kem_types_as_slice_cb_a9(
libcrux_ml_kem_types_MlKemPublicKey_be *self);

/**
Expand All @@ -338,7 +338,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 33
*/
void libcrux_ml_kem_utils_into_padded_array_6d2(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_422(Eurydice_slice slice,
uint8_t ret[33U]);

/**
Expand All @@ -349,7 +349,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 34
*/
void libcrux_ml_kem_utils_into_padded_array_6d1(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_421(Eurydice_slice slice,
uint8_t ret[34U]);

/**
Expand All @@ -361,7 +361,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_d8(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_df(
libcrux_ml_kem_types_MlKemCiphertext_e8 *self);

/**
Expand All @@ -372,7 +372,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 800
*/
void libcrux_ml_kem_utils_into_padded_array_6d0(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_420(Eurydice_slice slice,
uint8_t ret[800U]);

/**
Expand All @@ -383,7 +383,7 @@ A monomorphic instance of libcrux_ml_kem.utils.into_padded_array
with const generics
- LEN= 64
*/
void libcrux_ml_kem_utils_into_padded_array_6d(Eurydice_slice slice,
void libcrux_ml_kem_utils_into_padded_array_42(Eurydice_slice slice,
uint8_t ret[64U]);

/**
Expand Down
34 changes: 17 additions & 17 deletions libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Charon: b351338f6a84c7a1afc27433eb0ffdc668b3581d
* Eurydice: 7efec1624422fd5e94388ef06b9c76dfe7a48d46
* Karamel: c96fb69d15693284644d6aecaa90afa37e4de8f0
* F*: 58c915a86a2c07c8eca8d9deafd76cb7a91f0eb7
* Libcrux: 6ff01fb3c57ff29ecb59bc62d9dc7fd231060cfb
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 99498eed461fa03566e0382b445c77bd2af5b59d
*/

#ifndef __internal_libcrux_mlkem_avx2_H
Expand Down Expand Up @@ -48,7 +48,7 @@ with const generics
- RANKED_BYTES_PER_RING_ELEMENT= 1152
- PUBLIC_KEY_SIZE= 1184
*/
bool libcrux_ml_kem_ind_cca_validate_public_key_311(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_6e1(uint8_t *public_key);

/**
Validate an ML-KEM private key.
Expand All @@ -65,7 +65,7 @@ with const generics
- SECRET_KEY_SIZE= 2400
- CIPHERTEXT_SIZE= 1088
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_4e1(
bool libcrux_ml_kem_ind_cca_validate_private_key_fd1(
libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key,
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext);

Expand All @@ -91,7 +91,7 @@ with const generics
- ETA1_RANDOMNESS_SIZE= 128
*/
libcrux_ml_kem_mlkem768_MlKem768KeyPair
libcrux_ml_kem_ind_cca_generate_keypair_5d1(uint8_t randomness[64U]);
libcrux_ml_kem_ind_cca_generate_keypair_611(uint8_t randomness[64U]);

/**
A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate
Expand All @@ -112,7 +112,7 @@ with const generics
- ETA2= 2
- ETA2_RANDOMNESS_SIZE= 128
*/
tuple_3c libcrux_ml_kem_ind_cca_encapsulate_cf1(
tuple_3c libcrux_ml_kem_ind_cca_encapsulate_ae1(
libcrux_ml_kem_types_MlKemPublicKey_15 *public_key,
uint8_t randomness[32U]);

Expand All @@ -138,7 +138,7 @@ with const generics
- ETA2_RANDOMNESS_SIZE= 128
- IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1120
*/
void libcrux_ml_kem_ind_cca_decapsulate_a41(
void libcrux_ml_kem_ind_cca_decapsulate_bb1(
libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key,
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *ciphertext, uint8_t ret[32U]);

Expand All @@ -157,7 +157,7 @@ with const generics
- RANKED_BYTES_PER_RING_ELEMENT= 1536
- PUBLIC_KEY_SIZE= 1568
*/
bool libcrux_ml_kem_ind_cca_validate_public_key_310(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_6e0(uint8_t *public_key);

/**
Validate an ML-KEM private key.
Expand All @@ -174,7 +174,7 @@ with const generics
- SECRET_KEY_SIZE= 3168
- CIPHERTEXT_SIZE= 1568
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_4e0(
bool libcrux_ml_kem_ind_cca_validate_private_key_fd0(
libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key,
libcrux_ml_kem_mlkem1024_MlKem1024Ciphertext *_ciphertext);

Expand All @@ -200,7 +200,7 @@ with const generics
- ETA1_RANDOMNESS_SIZE= 128
*/
libcrux_ml_kem_mlkem1024_MlKem1024KeyPair
libcrux_ml_kem_ind_cca_generate_keypair_5d0(uint8_t randomness[64U]);
libcrux_ml_kem_ind_cca_generate_keypair_610(uint8_t randomness[64U]);

/**
A monomorphic instance of libcrux_ml_kem.ind_cca.encapsulate
Expand All @@ -221,7 +221,7 @@ with const generics
- ETA2= 2
- ETA2_RANDOMNESS_SIZE= 128
*/
tuple_21 libcrux_ml_kem_ind_cca_encapsulate_cf0(
tuple_21 libcrux_ml_kem_ind_cca_encapsulate_ae0(
libcrux_ml_kem_types_MlKemPublicKey_1f *public_key,
uint8_t randomness[32U]);

Expand All @@ -247,7 +247,7 @@ with const generics
- ETA2_RANDOMNESS_SIZE= 128
- IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600
*/
void libcrux_ml_kem_ind_cca_decapsulate_a40(
void libcrux_ml_kem_ind_cca_decapsulate_bb0(
libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key,
libcrux_ml_kem_mlkem1024_MlKem1024Ciphertext *ciphertext, uint8_t ret[32U]);

Expand All @@ -266,7 +266,7 @@ with const generics
- RANKED_BYTES_PER_RING_ELEMENT= 768
- PUBLIC_KEY_SIZE= 800
*/
bool libcrux_ml_kem_ind_cca_validate_public_key_31(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_6e(uint8_t *public_key);

/**
Validate an ML-KEM private key.
Expand All @@ -283,7 +283,7 @@ with const generics
- SECRET_KEY_SIZE= 1632
- CIPHERTEXT_SIZE= 768
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_4e(
bool libcrux_ml_kem_ind_cca_validate_private_key_fd(
libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key,
libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext);

Expand All @@ -308,7 +308,7 @@ with const generics
- ETA1= 3
- ETA1_RANDOMNESS_SIZE= 192
*/
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_5d(
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_61(
uint8_t randomness[64U]);

/**
Expand All @@ -330,7 +330,7 @@ with const generics
- ETA2= 2
- ETA2_RANDOMNESS_SIZE= 128
*/
tuple_ec libcrux_ml_kem_ind_cca_encapsulate_cf(
tuple_ec libcrux_ml_kem_ind_cca_encapsulate_ae(
libcrux_ml_kem_types_MlKemPublicKey_be *public_key,
uint8_t randomness[32U]);

Expand All @@ -356,7 +356,7 @@ with const generics
- ETA2_RANDOMNESS_SIZE= 128
- IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800
*/
void libcrux_ml_kem_ind_cca_decapsulate_a4(
void libcrux_ml_kem_ind_cca_decapsulate_bb(
libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key,
libcrux_ml_kem_types_MlKemCiphertext_e8 *ciphertext, uint8_t ret[32U]);

Expand Down
Loading

0 comments on commit 717b165

Please sign in to comment.