diff --git a/src/tasks/tasks01/pfmath.rs b/src/tasks/tasks01/pfmath.rs index 0f5d134..6830e1a 100644 --- a/src/tasks/tasks01/pfmath.rs +++ b/src/tasks/tasks01/pfmath.rs @@ -1,20 +1,16 @@ -use std::usize; use anyhow::Result; use base64::{prelude::BASE64_STANDARD, Engine}; use serde_json::Value; -use crate::{ - tasks, - utils::{ +use crate::utils::{ self, dff::ddf, edf::edf, field::FieldElement, poly::{gcd, Polynomial}, sff::{sff, Factors}, - }, -}; + }; pub fn gfpoly_add(args: &Value) -> Result { let poly_a = Polynomial::from_c_array(&args["A"].clone()); @@ -126,7 +122,7 @@ pub fn gfpoly_gcd(args: &Value) -> Result { Ok(result) } -pub fn gfpoly_factor_sff(arsg: &Value) -> Result> { +pub fn gfpoly_factor_sff(arsg: &Value) -> Result> { let poly_f = Polynomial::from_c_array(&arsg["F"].clone()); let mut factors = sff(poly_f); @@ -143,7 +139,7 @@ pub fn gfpoly_factor_sff(arsg: &Value) -> Result> { Ok(result) } -pub fn gfpoly_factor_ddf(arsg: &Value) -> Result> { +pub fn gfpoly_factor_ddf(arsg: &Value) -> Result> { let poly_f = Polynomial::from_c_array(&arsg["F"].clone()); let mut factors = ddf(poly_f); diff --git a/src/utils/dff.rs b/src/utils/dff.rs index be63040..bcd1ca0 100644 --- a/src/utils/dff.rs +++ b/src/utils/dff.rs @@ -1,6 +1,6 @@ use std::usize; -use num::{cast::AsPrimitive, pow::Pow, traits::ToBytes, BigUint, FromPrimitive}; +use num::{pow::Pow, BigUint, FromPrimitive}; use serde::{Deserialize, Serialize}; use super::poly::{gcd, Polynomial}; diff --git a/src/utils/edf.rs b/src/utils/edf.rs index 134a743..80f552c 100644 --- a/src/utils/edf.rs +++ b/src/utils/edf.rs @@ -1,8 +1,6 @@ -use base64::{prelude::BASE64_STANDARD, Engine}; -use num::{BigUint, FromPrimitive, Integer, One}; +use num::{BigUint, FromPrimitive, One}; use rand::Rng; -use crate::utils::{field::FieldElement, poly::non_monic_gcd}; use super::poly::{gcd, Polynomial}; diff --git a/src/utils/field.rs b/src/utils/field.rs index 7b4059c..9b9876b 100644 --- a/src/utils/field.rs +++ b/src/utils/field.rs @@ -1,5 +1,4 @@ use base64::prelude::*; -use rand::{random, Rng, RngCore}; use std::{u128, u8, usize}; use std::{ diff --git a/src/utils/poly.rs b/src/utils/poly.rs index eeffc34..68edb82 100644 --- a/src/utils/poly.rs +++ b/src/utils/poly.rs @@ -1,8 +1,9 @@ use crate::utils::field::ByteArray; -use base64::alphabet::BIN_HEX; use base64::prelude::*; + use num::traits::FromBytes; use num::{BigInt, BigUint, One, Zero}; + use std::{str::FromStr, u128, u8, usize}; use std::{