fn hash_to_scalar()

in src/key_exchange/group/elliptic_curve.rs [52:62]


    fn hash_to_scalar<H>(input: &[&[u8]], dst: &[u8]) -> Result<Self::Sk, InternalError>
    where
        H: Digest + BlockSizeUser,
        H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize>,
    {
        Self::hash_to_scalar::<ExpandMsgXmd<H>>(input, dst)
            .ok()
            .and_then(|scalar| Option::<NonZeroScalar<Self>>::from(NonZeroScalar::new(scalar)))
            .map(SecretKey::from)
            .ok_or(InternalError::HashToScalar)
    }