From d6cac70b394ecef5fd4854303a85d47e5385554f Mon Sep 17 00:00:00 2001 From: Gerald Teschl Date: Mon, 22 Jul 2024 18:10:42 +0200 Subject: [PATCH] Update poly.py --- kryptools/poly.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kryptools/poly.py b/kryptools/poly.py index 6c6370c..d37d627 100644 --- a/kryptools/poly.py +++ b/kryptools/poly.py @@ -16,11 +16,11 @@ class Poly: """ def __init__(self, coeff: list, ring = None, modulus: list = None): - for i in range(len(coeff) - 1, 0, -1): - if coeff[i]: + self.coeff = list(coeff) + for i in range(len(self.coeff) - 1, 0, -1): + if self.coeff[i]: break - coeff.pop(i) - self.coeff = coeff + self.coeff.pop(i) self.modulus = modulus if ring: self.map(ring)