From 0a573d84da8d0984f4ea5d14a04f27c0f7fb14e9 Mon Sep 17 00:00:00 2001 From: Alivecow Date: Mon, 23 Dec 2024 10:30:21 +0100 Subject: [PATCH] refactor: Remove unused function --- src/utils/poly.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/utils/poly.rs b/src/utils/poly.rs index f2e7d33..6a61853 100644 --- a/src/utils/poly.rs +++ b/src/utils/poly.rs @@ -591,39 +591,6 @@ pub fn gfmul(poly_a: &Vec, poly_b: &Vec, semantic: &str) -> Result, poly_b: &Vec, semantic: &str) -> Result> { - let red_poly_bytes: BigUint = BigUint::from_slice(&[ - 0x87, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0x01, - ]); - - let mut poly1: BigUint = BigUint::from_le_bytes(poly_a); - - let mut poly2: BigUint = BigUint::from_le_bytes(poly_b); - - let mut result: BigUint = BigUint::zero(); - - if (&poly2 & (BigUint::one() << 127)) == BigUint::one() { - result = &result ^ &poly1; - } - poly2 = &poly2 >> 1; - - while &poly2 != &BigUint::zero() { - poly1 = &poly1 << 1; - - if (&poly1 & (BigUint::one() << 127)) == BigUint::one() { - poly1 = &poly1 ^ &red_poly_bytes; - } - - if &poly2 & BigUint::one() == BigUint::one() { - result = &result ^ &poly1; - } - - poly2 = &poly2 >> 1; - } - - Ok(result.to_bytes_le()) -} - pub fn convert_gcm_to_xex(gcm_poly: Vec) -> Result> { let xex_poly = gcm_poly .into_iter()