feat: gfmul fix algorithm. test is passing.

This commit is contained in:
0xalivecow 2024-10-26 17:57:14 +02:00
parent 4dc6cdfef8
commit 7564869ea8
No known key found for this signature in database
2 changed files with 24 additions and 5 deletions

View file

@ -44,10 +44,13 @@ pub fn gfmul(args: &Value) -> Result<String> {
if poly2.LSB_is_one() {
result.xor_byte_arrays(&poly1);
poly2.right_shift();
} else {
poly2.right_shift();
}
while !poly2.is_empty() {
if !poly2.LSB_is_one() {
if poly2.LSB_is_one() {
poly1.left_shift();
poly1.xor_byte_arrays(&red_poly_bytes);
eprintln!("Poly1 after reduction: {:01X?}", poly1);