Skip to content

Pre-calculating Parameters #42

@fjarri

Description

@fjarri

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions