pub trait DigestPrimitive: PrimeCurve {
type Digest: Digest;
// Provided method
fn prehash_to_field_bytes(prehash: &[u8]) -> Result<FieldBytes<Self>> { ... }
}
Expand description
Bind a preferred Digest
algorithm to an elliptic curve type.
Generally there is a preferred variety of the SHA-2 family used with ECDSA for a particular elliptic curve.
This trait can be used to specify it, and with it receive a blanket impl of
[PrehashSignature
], used by signature_derive
) for the Signature
type for a particular elliptic curve.
Required Associated Types§
Provided Methods§
Sourcefn prehash_to_field_bytes(prehash: &[u8]) -> Result<FieldBytes<Self>>
fn prehash_to_field_bytes(prehash: &[u8]) -> Result<FieldBytes<Self>>
Compute field bytes for a prehash (message digest), either zero-padding or truncating if the prehash size does not match the field size.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.