Skip to content

rust: const fn support #1086

Description

@tarcieri

I've started work integrating the Rust output from fiat-crypto into the RustCrypto p384 crate.

One of the biggest hurdles I've encountered is that in our other elliptic curve crates we make extensive use of const fn to precompute constants at compile time. This isn't possible with the Rust output from fiat-crypto today as the generated functions aren't const fn.

While for the most part this could be relatively straightforward due to the arithmetic nature of these functions, there is one major impediment: the APIs all operate on an out: &mut ... parameter as opposed to returning a value, and this is not presently supported by const fn: rust-lang/rust#57349

It seems when this upstream blocker is addressed, it should be trivial to add const to the function signatures. Alternatively, the functions could return the outputs as opposed to writing them into an &mut output buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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