Skip to content

Commit

Permalink
update C extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer committed Nov 13, 2024
1 parent 150df23 commit 122ee3d
Show file tree
Hide file tree
Showing 33 changed files with 132 additions and 90 deletions.
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/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: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/internal/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __internal_libcrux_core_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/internal/libcrux_mlkem_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __internal_libcrux_mlkem_avx2_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/internal/libcrux_mlkem_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __internal_libcrux_mlkem_portable_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/internal/libcrux_sha3_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __internal_libcrux_sha3_avx2_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/internal/libcrux_sha3_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __internal_libcrux_sha3_internal_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "internal/libcrux_core.h"
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_core_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem1024.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem1024_H
Expand Down
18 changes: 14 additions & 4 deletions libcrux-ml-kem/c/libcrux_mlkem1024_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "libcrux_mlkem1024_avx2.h"
Expand Down Expand Up @@ -205,7 +205,12 @@ libcrux_ml_kem_mlkem1024_avx2_generate_key_pair(uint8_t randomness[64U]) {
}

/**
Private key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_private_key_avx2 with const
generics
- K= 4
- SECRET_KEY_SIZE= 3168
- CIPHERTEXT_SIZE= 1568
*/
static bool validate_private_key_avx2_6b(
libcrux_ml_kem_types_MlKemPrivateKey_83 *private_key,
Expand Down Expand Up @@ -265,7 +270,12 @@ bool libcrux_ml_kem_mlkem1024_avx2_validate_private_key_only(
}

/**
Public key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_public_key_avx2 with const
generics
- K= 4
- RANKED_BYTES_PER_RING_ELEMENT= 1536
- PUBLIC_KEY_SIZE= 1568
*/
static bool validate_public_key_avx2_6b(uint8_t *public_key) {
return libcrux_ml_kem_ind_cca_validate_public_key_1e(public_key);
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem1024_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem1024_avx2_H
Expand Down
8 changes: 4 additions & 4 deletions libcrux-ml-kem/c/libcrux_mlkem1024_portable.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "libcrux_mlkem1024_portable.h"
Expand Down Expand Up @@ -146,7 +146,7 @@ generics
- SECRET_KEY_SIZE= 3168
- CIPHERTEXT_SIZE= 1568
*/
static bool validate_private_key_6b(
static KRML_MUSTINLINE bool validate_private_key_6b(
libcrux_ml_kem_types_MlKemPrivateKey_83 *private_key,
libcrux_ml_kem_types_MlKemCiphertext_64 *ciphertext) {
return libcrux_ml_kem_ind_cca_validate_private_key_b5(private_key,
Expand Down Expand Up @@ -200,7 +200,7 @@ generics
- RANKED_BYTES_PER_RING_ELEMENT= 1536
- PUBLIC_KEY_SIZE= 1568
*/
static bool validate_public_key_6b(uint8_t *public_key) {
static KRML_MUSTINLINE bool validate_public_key_6b(uint8_t *public_key) {
return libcrux_ml_kem_ind_cca_validate_public_key_00(public_key);
}

Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem1024_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem1024_portable_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem512.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem512_H
Expand Down
18 changes: 14 additions & 4 deletions libcrux-ml-kem/c/libcrux_mlkem512_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "libcrux_mlkem512_avx2.h"
Expand Down Expand Up @@ -205,7 +205,12 @@ libcrux_ml_kem_mlkem512_avx2_generate_key_pair(uint8_t randomness[64U]) {
}

/**
Private key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_private_key_avx2 with const
generics
- K= 2
- SECRET_KEY_SIZE= 1632
- CIPHERTEXT_SIZE= 768
*/
static bool validate_private_key_avx2_1c(
libcrux_ml_kem_types_MlKemPrivateKey_fa *private_key,
Expand Down Expand Up @@ -265,7 +270,12 @@ bool libcrux_ml_kem_mlkem512_avx2_validate_private_key_only(
}

/**
Public key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_public_key_avx2 with const
generics
- K= 2
- RANKED_BYTES_PER_RING_ELEMENT= 768
- PUBLIC_KEY_SIZE= 800
*/
static bool validate_public_key_avx2_1c(uint8_t *public_key) {
return libcrux_ml_kem_ind_cca_validate_public_key_ba(public_key);
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem512_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem512_avx2_H
Expand Down
8 changes: 4 additions & 4 deletions libcrux-ml-kem/c/libcrux_mlkem512_portable.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "libcrux_mlkem512_portable.h"
Expand Down Expand Up @@ -146,7 +146,7 @@ generics
- SECRET_KEY_SIZE= 1632
- CIPHERTEXT_SIZE= 768
*/
static bool validate_private_key_1c(
static KRML_MUSTINLINE bool validate_private_key_1c(
libcrux_ml_kem_types_MlKemPrivateKey_fa *private_key,
libcrux_ml_kem_types_MlKemCiphertext_1a *ciphertext) {
return libcrux_ml_kem_ind_cca_validate_private_key_fb(private_key,
Expand Down Expand Up @@ -200,7 +200,7 @@ generics
- RANKED_BYTES_PER_RING_ELEMENT= 768
- PUBLIC_KEY_SIZE= 800
*/
static bool validate_public_key_1c(uint8_t *public_key) {
static KRML_MUSTINLINE bool validate_public_key_1c(uint8_t *public_key) {
return libcrux_ml_kem_ind_cca_validate_public_key_86(public_key);
}

Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem512_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem512_portable_H
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem768.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem768_H
Expand Down
18 changes: 14 additions & 4 deletions libcrux-ml-kem/c/libcrux_mlkem768_avx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#include "libcrux_mlkem768_avx2.h"
Expand Down Expand Up @@ -205,7 +205,12 @@ libcrux_ml_kem_mlkem768_avx2_generate_key_pair(uint8_t randomness[64U]) {
}

/**
Private key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_private_key_avx2 with const
generics
- K= 3
- SECRET_KEY_SIZE= 2400
- CIPHERTEXT_SIZE= 1088
*/
static bool validate_private_key_avx2_31(
libcrux_ml_kem_types_MlKemPrivateKey_d9 *private_key,
Expand Down Expand Up @@ -265,7 +270,12 @@ bool libcrux_ml_kem_mlkem768_avx2_validate_private_key_only(
}

/**
Public key validation
A monomorphic instance of
libcrux_ml_kem.ind_cca.instantiations.avx2.validate_public_key_avx2 with const
generics
- K= 3
- RANKED_BYTES_PER_RING_ELEMENT= 1152
- PUBLIC_KEY_SIZE= 1184
*/
static bool validate_public_key_avx2_31(uint8_t *public_key) {
return libcrux_ml_kem_ind_cca_validate_public_key_ed(public_key);
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/c/libcrux_mlkem768_avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*
* This code was generated with the following revisions:
* Charon: 45f5a34f336e35c6cc2253bc90cbdb8d812cefa9
* Eurydice: e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20
* Eurydice: 7d686376ec943225ff89942978c6c3028bac689c
* Karamel: 8c3612018c25889288da6857771be3ad03b75bcd
* F*: 5643e656b989aca7629723653a2570c7df6252b9-dirty
* Libcrux: 76be5813ea48977a7e122f6af350f1a5324b2cb6
* Libcrux: 150df2319c18ad9912639a9541adddd0d0e40015
*/

#ifndef __libcrux_mlkem768_avx2_H
Expand Down
Loading

0 comments on commit 122ee3d

Please sign in to comment.