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.
I've started work integrating the Rust output from fiat-crypto into the RustCrypto
p384crate.One of the biggest hurdles I've encountered is that in our other elliptic curve crates we make extensive use of
const fnto precompute constants at compile time. This isn't possible with the Rust output fromfiat-cryptotoday as the generated functions aren'tconst 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 byconst fn: rust-lang/rust#57349It seems when this upstream blocker is addressed, it should be trivial to add
constto the function signatures. Alternatively, the functions could return the outputs as opposed to writing them into an&mutoutput buffer.