Skip to content

Stable type names in C extractions #1468

Description

@djmdjm

This is a feature request for stable type names in the C extraction.

For example, libcrux_ml_kem_mlkem768_portable_encapsulate has this sigature:

static inline tuple_f4 libcrux_ml_kem_mlkem768_portable_encapsulate(
    const Eurydice_arr_5f *public_key, Eurydice_arr_ec randomness) {

There are two problems here.

First the types Eurydice_arr_5f, Eurydice_arr_ec, etc do not obviously reflect the function of the type. Second, the types are not stable from release to release of libcrux.

This isn't a huge hassle to work around. OpenSSH has a block like this that renames the types that I fix up each time I update to a new libcrux release:

typedef Eurydice_arr_c7 libcrux_mlkem768_keypair_rnd;
typedef Eurydice_arr_ec libcrux_mlkem768_enc_rnd;
typedef libcrux_ml_kem_mlkem768_MlKem768KeyPair libcrux_mlkem768_keypair;
typedef Eurydice_arr_5f libcrux_mlkem768_pk;
typedef Eurydice_arr_7d libcrux_mlkem768_sk;
typedef Eurydice_arr_2b libcrux_mlkem768_ciphertext;
typedef tuple_f4 libcrux_mlkem768_enc_result;
typedef Eurydice_arr_ec libcrux_mlkem768_dec_result;

But it is a bit of a hassle 😃 - it would be great if this was maintained automatically by the extraction tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions