pub trait P384ScalarInvert {
// Required methods
fn invert(k: P384Scalar) -> P384Scalar;
fn invert_vartime(k: P384Scalar) -> P384Scalar;
}Expand description
P-384 scalar field inversion accelerator (optional).
ECDSA signing and verification each need one inversion modulo the curve
order. embassy-crypto routes to this trait only when its
driver-p384-scalar-invert feature is NOT enabled.
§Contract
The caller guarantees k is in the range [1, n-1], where n is the
curve order, so the inverse always exists. The result is canonical,
in the same range.
Required Methods§
Sourcefn invert(k: P384Scalar) -> P384Scalar
fn invert(k: P384Scalar) -> P384Scalar
k^-1 mod n. Must not have secret-dependent timing: k may be secret.
Sourcefn invert_vartime(k: P384Scalar) -> P384Scalar
fn invert_vartime(k: P384Scalar) -> P384Scalar
k^-1 mod n, variable time. Callers only pass public values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".