feat: add the gcm crack

Example testcase is working
This commit is contained in:
Alivecow 2024-12-03 16:52:21 +01:00
parent 16b65b0de4
commit 4c9adb9fdc
7 changed files with 253 additions and 24 deletions

View file

@ -39,6 +39,18 @@ impl FieldElement {
FieldElement::new_no_convert(vec![0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
}
pub fn to_vec(&self) -> Vec<u8> {
self.field_element.clone()
}
/*
pub fn padd(&mut self) {
if self.field_element.len() % 16 != 0 || ad.is_empty() {
ad.append(vec![0u8; 16 - (ad.len() % 16)].as_mut());
}
}
*/
pub fn new(field_element: Vec<u8>) -> Self {
Self {
field_element: reverse_bits_in_bytevec(field_element),