Merge branch 'main' into dev

This commit is contained in:
An0nymous 2024-11-29 14:33:47 +01:00 committed by GitHub
commit c24d47e4b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 14 deletions

View file

@ -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<Polynomial> {
let poly_a = Polynomial::from_c_array(&args["A"].clone());
@ -126,7 +122,7 @@ pub fn gfpoly_gcd(args: &Value) -> Result<Polynomial> {
Ok(result)
}
pub fn gfpoly_factor_sff(arsg: &Value) -> Result<Vec<(Factors)>> {
pub fn gfpoly_factor_sff(arsg: &Value) -> Result<Vec<Factors>> {
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<Vec<(Factors)>> {
Ok(result)
}
pub fn gfpoly_factor_ddf(arsg: &Value) -> Result<Vec<(utils::dff::Factors)>> {
pub fn gfpoly_factor_ddf(arsg: &Value) -> Result<Vec<utils::dff::Factors>> {
let poly_f = Polynomial::from_c_array(&arsg["F"].clone());
let mut factors = ddf(poly_f);

View file

@ -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};

View file

@ -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};

View file

@ -1,5 +1,4 @@
use base64::prelude::*;
use rand::{random, Rng, RngCore};
use std::{u128, u8, usize};
use std::{

View file

@ -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::{