From 58f5d8ced0c870aeb0420963fc9416f6cd57d94c Mon Sep 17 00:00:00 2001 From: supinie <86788874+supinie@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:45:41 +0100 Subject: [PATCH] fix compression bug --- src/polynomials.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/polynomials.rs b/src/polynomials.rs index 0e3592e..30b0272 100644 --- a/src/polynomials.rs +++ b/src/polynomials.rs @@ -57,6 +57,8 @@ impl Default for Poly { impl Poly { // Sets self to self + x + // The coeffs of self and x should be small enough that no overflow can occur. + // If in doubt, reduce first. // Example: // ``` // let new_poly = poly1.add(&poly2); @@ -313,7 +315,7 @@ impl Poly { buf_chunk.copy_from_slice( &t.chunks_exact(2) .map(|chunk| chunk[0] | (chunk[1] << 4)) - .collect::>() + .collect::>() .into_inner(), ); } @@ -350,7 +352,7 @@ impl Poly { // poly will NOT be normalised, but 0 <= coeffs < 4096 // Example: // ``` - // unpacked_poly = unpack_to_poly(buf); + // unpacked_poly = Poly::unpack(buf); // ``` pub fn unpack(buf: &[u8]) -> Result, PackingError> { if buf.len() != POLYBYTES {