chore: Merge newest dev to get most recent changes

This commit is contained in:
0xalivecow 2024-10-23 10:54:50 +02:00
commit a6571e43af
No known key found for this signature in database
1769 changed files with 398681 additions and 20 deletions

View file

@ -1,15 +1,13 @@
use std::{str::Bytes, string};
use crate::utils::poly::{self, block_2_number, get_coefficients};
use crate::utils::poly::{b64_2_num, get_coefficients};
use anyhow::Result;
use base64::prelude::*;
use serde_json::Value;
pub fn block2poly(val: &Value) -> Result<Vec<u8>> {
// Convert JSON data in to a u128
// TODO: Transfer decoding into own function?
let string: String = serde_json::from_value(val["block"].clone())?;
let number: u128 = block_2_number(string)?;
let number = b64_2_num(&string)?;
let coefficients: Vec<u8> = get_coefficients(number);