Skip to main content

hash_to_scalar

Function hash_to_scalar 

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

Computes the hash to field routine according to https://www.rfc-editor.org/rfc/rfc9380.html#section-5-4 and returns a scalar.

For the expand_message call, len_in_bytes = <Self::FieldElement as FromOkm>::Length. This value must be less than u16::MAX or otherwise a compiler error will occur.

ยงErrors

When the chosen ExpandMsg implementation returns an error. See ExpandMsgXmdError and ExpandMsgXofError for examples.