Currently a Parameters object (basically, just the value of u) is created on the spot where it is needed, since it's always the same (see #3). Even though its calculation is pretty fast (we hit the point on the first try, and it takes ~8us for me on a laptop), it may still be significant if we ever target embedded environments.
We wouldn't want to hardcode the value; we need to show the process with which it is obtained.
Rust's requirements for static variables are restrictive, so we can't just make it static (a lot of functions in RustCrypto stack would have to be made const fn). Maybe they will relax them in the future.
An alternative is a build script, which will require extracting all the required machinery (since we cannot import the crate itself from the build script) and duplicating some parameter definitions.
Currently a
Parametersobject (basically, just the value ofu) is created on the spot where it is needed, since it's always the same (see #3). Even though its calculation is pretty fast (we hit the point on the first try, and it takes ~8us for me on a laptop), it may still be significant if we ever target embedded environments.We wouldn't want to hardcode the value; we need to show the process with which it is obtained.
Rust's requirements for
staticvariables are restrictive, so we can't just make itstatic(a lot of functions in RustCrypto stack would have to be madeconst fn). Maybe they will relax them in the future.An alternative is a build script, which will require extracting all the required machinery (since we cannot import the crate itself from the build script) and duplicating some parameter definitions.