feat: add division and powmod (WIP) and start adapting task runner

This commit is contained in:
alivecow 2024-11-14 22:30:55 +01:00
parent a05f2f02b6
commit deb4261121
4 changed files with 183 additions and 16 deletions

View file

@ -2,6 +2,7 @@ pub mod block2poly;
pub mod gcm;
pub mod gfmul;
pub mod pad_oracle;
pub mod pfmath;
pub mod poly2block;
pub mod sea128;
pub mod xex;

View file

@ -0,0 +1,15 @@
use anyhow::Result;
use base64::{prelude::BASE64_STANDARD, Engine};
use serde_json::Value;
use crate::utils::field::Polynomial;
pub fn gfpoly_add(args: &Value) -> Result<Polynomial> {
let poly_a = Polynomial::from_c_array(&args["A"].clone());
let poly_b = Polynomial::from_c_array(&args["B"].clone());
let result = poly_a + poly_b;
Ok(result)
}