feat: Sorting of polynomial array with rust standard sort implemented

This commit is contained in:
Alivecow 2024-11-20 19:37:46 +01:00
parent bb5e762a1d
commit c3ea652c87
3 changed files with 185 additions and 33 deletions

View file

@ -8,10 +8,12 @@ use tasks01::{
gcm::{gcm_decrypt, gcm_encrypt},
gfmul::gfmul_task,
pad_oracle::padding_oracle,
pfmath::{gfdiv, gfpoly_add, gfpoly_divmod, gfpoly_mul, gfpoly_pow, gfpoly_powmod},
pfmath::{
gfdiv, gfpoly_add, gfpoly_divmod, gfpoly_mul, gfpoly_pow, gfpoly_powmod, gfpoly_sort,
},
poly2block::poly2block,
sea128::sea128,
xex::{fde_xex},
xex::fde_xex,
};
use anyhow::{anyhow, Result};
@ -118,6 +120,12 @@ pub fn task_deploy(testcase: &Testcase) -> Result<Value> {
Ok(json)
}
"gfpoly_sort" => {
let result = gfpoly_sort(args)?;
let json = json!({"sorted_polys" : json!(result)});
Ok(json)
}
_ => Err(anyhow!(
"Fatal. No compatible action found. Json data was {:?}. Arguments were; {:?}",