Function k256::ecdsa::hazmat::bits2field

source ·
pub fn bits2field<C>(
    bits: &[u8]
) -> Result<GenericArray<u8, <C as Curve>::FieldBytesSize>, Error>
where C: PrimeCurve,
Available on (crate features ecdsa or sha256) and crate feature hazmat and crate feature ecdsa-core only.
Expand description

Partial implementation of the bits2int function as defined in RFC6979 § 2.3.2 as well as SEC1 § 2.3.8.

This is used to convert a message digest whose size may be smaller or larger than the size of the curve’s scalar field into a serialized (unreduced) field element.