expand_to_scalar

Function expand_to_scalar 

Source
pub fn expand_to_scalar(msg: &[u8], dst: &[u8]) -> Result<Scalar, Error>
Expand description

Expands a message using the XMD (eXpandable Message Digest) method with SHA-256, and reduces the result modulo the curve order to produce a Scalar.

§Arguments

  • msg: The input message to be expanded.
  • dst: A domain separation tag (DST). Must be 255 bytes or fewer, as required by the hash-to-curve specification.

§Returns

  • Ok(Scalar): A scalar derived by expanding and reducing the message.
  • Err(EllipticCurveError): If dst is longer than 255 bytes