diff --git a/src/elliptic/curves/secp256_k1.rs b/src/elliptic/curves/secp256_k1.rs index 9408c0e4..687bea6c 100644 --- a/src/elliptic/curves/secp256_k1.rs +++ b/src/elliptic/curves/secp256_k1.rs @@ -204,14 +204,32 @@ impl ECScalar for Secp256k1Scalar { impl Mul for Secp256k1Scalar { type Output = Secp256k1Scalar; fn mul(self, other: Secp256k1Scalar) -> Secp256k1Scalar { - (&self).mul(&other.get_element()) + //(&self).mul(&other.get_element()) + let res: FE = ECScalar::from(&BigInt::mod_mul( + &self.to_big_int(), + &other.to_big_int(), + &FE::q(), + )); + Secp256k1Scalar { + purpose: "mul", + fe: res.get_element(), + } } } impl<'o> Mul<&'o Secp256k1Scalar> for Secp256k1Scalar { type Output = Secp256k1Scalar; fn mul(self, other: &'o Secp256k1Scalar) -> Secp256k1Scalar { - (&self).mul(&other.get_element()) + //(&self).mul(&other.get_element()) + let res: FE = ECScalar::from(&BigInt::mod_mul( + &self.to_big_int(), + &other.to_big_int(), + &FE::q(), + )); + Secp256k1Scalar { + purpose: "mul", + fe: res.get_element(), + } } }