refactor: Apply general cargo recommendations

This commit is contained in:
Alivecow 2024-12-22 18:13:23 +01:00
parent 2f0e265ed6
commit b24c703429
4 changed files with 3 additions and 10 deletions

View file

@ -1,13 +1,10 @@
use std::{env::args, fs::canonicalize, slice::Chunks};
use anyhow::{Ok, Result};
use base64::{prelude::BASE64_STANDARD, Engine};
use openssl::derive;
use serde::{Deserialize, Serialize};
use serde_json::{map, Value};
use serde_json::Value;
use crate::utils::{
self,
ciphers::ghash,
dff::ddf,
edf::edf,

View file

@ -1,6 +1,5 @@
use crate::utils::{field::ByteArray, poly::gfmul};
use anyhow::Result;
use base64::prelude::*;
use openssl::symm::{Cipher, Crypter, Mode};
use super::math::xor_bytes;

View file

@ -8,9 +8,7 @@ use std::{
use anyhow::{anyhow, Ok, Result};
use crate::utils::poly::bgfmul;
use super::poly::polynomial_2_block;
use super::{
math::{reverse_bits_in_bytevec, xor_bytes},
poly::gfmul,

View file

@ -2,7 +2,7 @@ use crate::utils::field::ByteArray;
use base64::prelude::*;
use num::traits::{FromBytes, ToBytes};
use num::{BigInt, BigUint, One, Zero};
use num::{BigUint, One, Zero};
use std::{str::FromStr, u128, u8, usize};
@ -15,7 +15,6 @@ use anyhow::{anyhow, Ok, Result};
use serde_json::Value;
use super::field::FieldElement;
use super::math::reverse_bits_in_bytevec;
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct Polynomial {
@ -574,7 +573,7 @@ pub fn sort_polynomial_array(mut polys: Vec<Polynomial>) -> Result<Vec<Polynomia
pub const RED_POLY: u128 = 0x87000000_00000000_00000000_00000000;
pub fn gfmul(poly_a: &Vec<u8>, poly_b: &Vec<u8>, semantic: &str) -> Result<Vec<u8>> {
let mut red_poly_bytes: ByteArray = ByteArray(RED_POLY.to_be_bytes().to_vec());
let red_poly_bytes: ByteArray = ByteArray(RED_POLY.to_be_bytes().to_vec());
//red_poly_bytes.0.push(0x01);
let mut poly1: ByteArray = ByteArray(poly_a.to_vec());