pub fn from_bytes_wide(curve: EccCurveType, bytes: &[u8]) -> ThresholdEcdsaResult<Self> {
        match curve {
            EccCurveType::K256 => {
                let x = secp256k1::FieldElement::from_bytes_wide(bytes)?;
                Ok(Self::K256(x))
            }
            EccCurveType::P256 => {
                let x = secp256r1::FieldElement::from_bytes_wide(bytes)?;
                Ok(Self::P256(x))
            }
        }
    }
/// Decode a field element from encoded big-endian bytes
///
/// The byte string may be any length up to twice the length of the
/// field. The bytes are taken to form an big-endian integer, which
/// is then reduced modulo the prime to form a field element.
Decode a field element from encoded big-endian bytes
The byte string may be any length up to twice the length of the
field. The bytes are taken to form an big-endian integer, which
is then reduced modulo the prime to form a field element.
Decode a field element from encoded big - endian bytes The byte string may be any length up to twice the length of the field . The bytes are taken to form an big - endian integer which is then reduced modulo the prime to form a field element .
pub fn from_bytes_wide(curve: EccCurveType, bytes: &[u8]) -> ThresholdEcdsaResult<Self> {
        match curve {
            EccCurveType::K256 => {
                let x = secp256k1::FieldElement::from_bytes_wide(bytes)?;
                Ok(Self::K256(x))
            }
            EccCurveType::P256 => {
                let x = secp256r1::FieldElement::from_bytes_wide(bytes)?;
                Ok(Self::P256(x))
            }
        }
    }
pub fn from_bytes_wide ( curve : EccCurveType , bytes : & [ u8 ] ) -> ThresholdEcdsaResult < Self > { match curve { EccCurveType :: K256 => { let x = secp256k1 :: FieldElement :: from_bytes_wide ( bytes ) ? ; Ok ( Self :: K256 ( x ) ) } EccCurveType :: P256 => { let x = secp256r1 :: FieldElement :: from_bytes_wide ( bytes ) ? ; Ok ( Self :: P256 ( x ) ) } } }
Decode a field element from encoded big-endian bytes
The byte string may be any length up to twice the length of the
field.
Decode a field element from encoded big - endian bytes The byte string may be any length up to twice the length of the field .
curve
EccCurveType
bytes
&[u8]
curve
EccCurveType
bytes
&[u8]