Skip to content

Commit

Permalink
restored c/cg
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikbhargavan committed Oct 30, 2024
1 parent 7f7e08c commit 4b0d787
Show file tree
Hide file tree
Showing 42 changed files with 2,133 additions and 2,300 deletions.
2 changes: 1 addition & 1 deletion libcrux-ml-kem/c/code_gen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Charon: 28d543bfacc902ba9cc2a734b76baae9583892a4
Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
F*: 3063d19312f8ec3af5945f24ed3ebbb6b6cd9678
Libcrux: 020cd93ab7a1437ba4a4c626b1acbf9fa14525ad
Libcrux: a089e8609d2bf2df5c165076a79e3fd30dbf87cf
38 changes: 19 additions & 19 deletions libcrux-ml-kem/c/internal/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
* Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
* F*: 3063d19312f8ec3af5945f24ed3ebbb6b6cd9678
* Libcrux: 020cd93ab7a1437ba4a4c626b1acbf9fa14525ad
* Libcrux: a089e8609d2bf2df5c165076a79e3fd30dbf87cf
*/

#ifndef __internal_libcrux_core_H
Expand Down Expand Up @@ -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_451(
libcrux_ml_kem_types_MlKemPublicKey_1f libcrux_ml_kem_types_from_5a_671(
uint8_t value[1568U]);

/**
Expand All @@ -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_f61(
libcrux_ml_kem_mlkem1024_MlKem1024KeyPair libcrux_ml_kem_types_from_3a_ee1(
libcrux_ml_kem_types_MlKemPrivateKey_95 sk,
libcrux_ml_kem_types_MlKemPublicKey_1f pk);

Expand All @@ -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_8c1(
libcrux_ml_kem_types_MlKemPrivateKey_95 libcrux_ml_kem_types_from_7f_af1(
uint8_t value[3168U]);

/**
Expand All @@ -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_450(
libcrux_ml_kem_types_MlKemPublicKey_15 libcrux_ml_kem_types_from_5a_670(
uint8_t value[1184U]);

/**
Expand All @@ -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_f60(
libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_ml_kem_types_from_3a_ee0(
libcrux_ml_kem_types_MlKemPrivateKey_55 sk,
libcrux_ml_kem_types_MlKemPublicKey_15 pk);

Expand All @@ -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_8c0(
libcrux_ml_kem_types_MlKemPrivateKey_55 libcrux_ml_kem_types_from_7f_af0(
uint8_t value[2400U]);

/**
Expand All @@ -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_45(
libcrux_ml_kem_types_MlKemPublicKey_be libcrux_ml_kem_types_from_5a_67(
uint8_t value[800U]);

/**
Expand All @@ -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_f6(
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_types_from_3a_ee(
libcrux_ml_kem_types_MlKemPrivateKey_5e sk,
libcrux_ml_kem_types_MlKemPublicKey_be pk);

Expand All @@ -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_8c(
libcrux_ml_kem_types_MlKemPrivateKey_5e libcrux_ml_kem_types_from_7f_af(
uint8_t value[1632U]);

/**
Expand All @@ -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_d11(
uint8_t *libcrux_ml_kem_types_as_slice_fd_fe1(
libcrux_ml_kem_types_MlKemPublicKey_15 *self);

/**
Expand All @@ -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_3a1(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext libcrux_ml_kem_types_from_01_451(
uint8_t value[1088U]);

/**
Expand All @@ -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_be1(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_401(
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *self);

/**
Expand All @@ -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_d10(
uint8_t *libcrux_ml_kem_types_as_slice_fd_fe0(
libcrux_ml_kem_types_MlKemPublicKey_be *self);

/**
Expand All @@ -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_3a0(
libcrux_ml_kem_types_MlKemCiphertext_e8 libcrux_ml_kem_types_from_01_450(
uint8_t value[768U]);

/**
Expand All @@ -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_be0(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_400(
libcrux_ml_kem_types_MlKemCiphertext_e8 *self);

/**
Expand All @@ -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_d1(
uint8_t *libcrux_ml_kem_types_as_slice_fd_fe(
libcrux_ml_kem_types_MlKemPublicKey_1f *self);

/**
Expand Down Expand Up @@ -321,7 +321,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_3a(
libcrux_ml_kem_types_MlKemCiphertext_1f libcrux_ml_kem_types_from_01_45(
uint8_t value[1568U]);

/**
Expand All @@ -344,7 +344,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_be(
Eurydice_slice libcrux_ml_kem_types_as_ref_00_40(
libcrux_ml_kem_types_MlKemCiphertext_1f *self);

/**
Expand Down
32 changes: 16 additions & 16 deletions libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Eurydice: 1a65dbf3758fe310833718c645a64266294a29ac
* Karamel: 15d4bce74a2d43e34a64f48f8311b7d9bcb0e152
* F*: 3063d19312f8ec3af5945f24ed3ebbb6b6cd9678
* Libcrux: 020cd93ab7a1437ba4a4c626b1acbf9fa14525ad
* Libcrux: a089e8609d2bf2df5c165076a79e3fd30dbf87cf
*/

#ifndef __internal_libcrux_mlkem_avx2_H
Expand Down Expand Up @@ -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_db1(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_521(uint8_t *public_key);

/**
A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key
Expand All @@ -51,7 +51,7 @@ with const generics
- SECRET_KEY_SIZE= 2400
- CIPHERTEXT_SIZE= 1088
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_a81(
bool libcrux_ml_kem_ind_cca_validate_private_key_701(
libcrux_ml_kem_types_MlKemPrivateKey_55 *private_key,
libcrux_ml_kem_mlkem768_MlKem768Ciphertext *_ciphertext);

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

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

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

Expand All @@ -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_db0(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_520(uint8_t *public_key);

/**
A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key
Expand All @@ -138,7 +138,7 @@ with const generics
- SECRET_KEY_SIZE= 3168
- CIPHERTEXT_SIZE= 1568
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_a80(
bool libcrux_ml_kem_ind_cca_validate_private_key_700(
libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key,
libcrux_ml_kem_types_MlKemCiphertext_1f *_ciphertext);

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

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

Expand All @@ -203,7 +203,7 @@ with const generics
- ETA2_RANDOMNESS_SIZE= 128
- IMPLICIT_REJECTION_HASH_INPUT_SIZE= 1600
*/
void libcrux_ml_kem_ind_cca_decapsulate_cd0(
void libcrux_ml_kem_ind_cca_decapsulate_7f0(
libcrux_ml_kem_types_MlKemPrivateKey_95 *private_key,
libcrux_ml_kem_types_MlKemCiphertext_1f *ciphertext, uint8_t ret[32U]);

Expand All @@ -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_db(uint8_t *public_key);
bool libcrux_ml_kem_ind_cca_validate_public_key_52(uint8_t *public_key);

/**
A monomorphic instance of libcrux_ml_kem.ind_cca.validate_private_key
Expand All @@ -225,7 +225,7 @@ with const generics
- SECRET_KEY_SIZE= 1632
- CIPHERTEXT_SIZE= 768
*/
bool libcrux_ml_kem_ind_cca_validate_private_key_a8(
bool libcrux_ml_kem_ind_cca_validate_private_key_70(
libcrux_ml_kem_types_MlKemPrivateKey_5e *private_key,
libcrux_ml_kem_types_MlKemCiphertext_e8 *_ciphertext);

Expand All @@ -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_dd(
libcrux_ml_kem_types_MlKemKeyPair_cb libcrux_ml_kem_ind_cca_generate_keypair_0b(
uint8_t randomness[64U]);

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

Expand All @@ -290,7 +290,7 @@ with const generics
- ETA2_RANDOMNESS_SIZE= 128
- IMPLICIT_REJECTION_HASH_INPUT_SIZE= 800
*/
void libcrux_ml_kem_ind_cca_decapsulate_cd(
void libcrux_ml_kem_ind_cca_decapsulate_7f(
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 4b0d787

Please sign in to comment.