pub trait P384Lincomb {
// Required method
fn lincomb(
k1: P384Scalar,
p1: P384AffinePoint,
k2: P384Scalar,
p2: P384AffinePoint,
) -> Option<P384AffinePoint>;
}Expand description
P-384 double-base scalar multiplication accelerator (optional).
Computes k1 * p1 + k2 * p2 in one operation, which is what ECDSA
verification needs; backends can use a combined ladder (Shamir’s trick).
§Contract
The caller guarantees k1 and k2 are in [0, n-1] and p1, p2
are valid on-curve affine points. A zero scalar contributes the
identity. The sum can be the identity (when the non-zero terms
cancel), which has no affine encoding; the implementation returns
None in that case.
Must not have secret-dependent timing with respect to the scalars and points. Whether the result is the identity is not treated as secret.
Required Methods§
Sourcefn lincomb(
k1: P384Scalar,
p1: P384AffinePoint,
k2: P384Scalar,
p2: P384AffinePoint,
) -> Option<P384AffinePoint>
fn lincomb( k1: P384Scalar, p1: P384AffinePoint, k2: P384Scalar, p2: P384AffinePoint, ) -> Option<P384AffinePoint>
k1 * p1 + k2 * p2, or None if the sum is the identity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".