You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Possible crates that can help with that: lazy_static, or static_init. Just need to make sure they don't increase the internal complexity too much (static_init seems to be using a separate thread to initialize the statics... which won't play very well with embedded environments).
Currently a
Parameters
object (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
static
variables 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.
The text was updated successfully, but these errors were encountered: