/// Decode a field element from encoded big-endian bytes
///
/// The byte string must be the exact length of the field (32 bytes for
/// P-256 and secp256k1), and must in big-endian convention encode an
/// integer that is less than the prime.
Decode a field element from encoded big-endian bytes
The byte string must be the exact length of the field (32 bytes for
P-256 and secp256k1), and must in big-endian convention encode an
integer that is less than the prime.
Decode a field element from encoded big - endian bytes The byte string must be the exact length of the field ( 32 bytes for P - 256 and secp256k1 ) and must in big - endian convention encode an integer that is less than the prime .
pub fn from_bytes(curve: EccCurveType, bytes: &[u8]) -> ThresholdEcdsaResult<Self> {
        match curve {
            EccCurveType::K256 => {
                let x = secp256k1::FieldElement::from_bytes(bytes)?;
                Ok(Self::K256(x))
            }
            EccCurveType::P256 => {
                let x = secp256r1::FieldElement::from_bytes(bytes)?;
                Ok(Self::P256(x))
            }
        }
    }
pub fn from_bytes ( curve : EccCurveType , bytes : & [ u8 ] ) -> ThresholdEcdsaResult < Self > { match curve { EccCurveType :: K256 => { let x = secp256k1 :: FieldElement :: from_bytes ( bytes ) ? ; Ok ( Self :: K256 ( x ) ) } EccCurveType :: P256 => { let x = secp256r1 :: FieldElement :: from_bytes ( bytes ) ? ; Ok ( Self :: P256 ( x ) ) } } }
Decode a field element from encoded big-endian bytes
The byte string must be the exact length of the field (32 bytes for
P-256 and secp256k1), and must in big-endian convention encode an
integer that is less than the prime.
Decode a field element from encoded big - endian bytes The byte string must be the exact length of the field ( 32 bytes for P - 256 and secp256k1 ) and must in big - endian convention encode an integer that is less than the prime .
curve
EccCurveType
bytes
&[u8]