feat: Add edf calculation

This commit is contained in:
Alivecow 2024-11-28 13:17:51 +01:00
parent fa7d33aaf6
commit 39c4d9b80d
4 changed files with 131 additions and 2 deletions

View file

@ -1,4 +1,5 @@
use base64::prelude::*;
use rand::{random, Rng, RngCore};
use std::{u128, u8, usize};
use std::{
@ -24,6 +25,11 @@ impl FieldElement {
87, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 01,
];
pub fn rand() -> Self {
let rand_field: [u8; 16] = rand::random();
FieldElement::new(rand_field.to_vec())
}
pub fn zero(self) -> Self {
FieldElement::new(vec![0])
}