diff --git a/src/sm2/ecc.rs b/src/sm2/ecc.rs index beb4ad0..952ef82 100644 --- a/src/sm2/ecc.rs +++ b/src/sm2/ecc.rs @@ -485,6 +485,7 @@ impl EccCtx { ret } + #[allow(clippy::result_unit_err)] pub fn bytes_to_point(&self, b: &[u8]) -> Result { let ctx = &self.fctx; diff --git a/src/sm2/field.rs b/src/sm2/field.rs index 879ae35..05e5bea 100644 --- a/src/sm2/field.rs +++ b/src/sm2/field.rs @@ -239,6 +239,7 @@ impl FieldCtx { } // Square root of a field element + #[allow(clippy::result_unit_err)] pub fn sqrt(&self, g: &FieldElem) -> Result { // p = 4 * u + 3 // u = u + 1 diff --git a/src/sm2/signature.rs b/src/sm2/signature.rs index e7d56a9..aa3fbe0 100644 --- a/src/sm2/signature.rs +++ b/src/sm2/signature.rs @@ -48,6 +48,7 @@ impl Signature { Ok(Signature { r, s }) } + #[allow(clippy::result_unit_err)] pub fn der_decode_raw(buf: &[u8]) -> Result { if buf[0] != 0x02 { return Err(()); @@ -303,6 +304,7 @@ impl SigCtx { curve.mul(&sk, &curve.generator()) } + #[allow(clippy::result_unit_err)] pub fn load_pubkey(&self, buf: &[u8]) -> Result { self.curve.bytes_to_point(buf) } @@ -311,6 +313,7 @@ impl SigCtx { self.curve.point_to_bytes(p, compress) } + #[allow(clippy::result_unit_err)] pub fn load_seckey(&self, buf: &[u8]) -> Result { if buf.len() != 32 { return Err(());