Skip to content

Commit 68d2711

Browse files
committed
fix black
1 parent 4134ae4 commit 68d2711

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kyber_py/polynomials/polynomials.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .polynomials_generic import PolynomialRing, Polynomial
22

3+
34
class PolynomialRingKyber(PolynomialRing):
45
"""
56
Initialise the polynomial ring:
@@ -63,12 +64,12 @@ def cbd(self, input_bytes, eta, is_ntt=False):
6364
coefficients = [0 for _ in range(256)]
6465
b_int = int.from_bytes(input_bytes, "little")
6566
mask = (1 << eta) - 1
66-
mask2 = (1 << 2*eta) - 1
67+
mask2 = (1 << 2 * eta) - 1
6768
for i in range(256):
6869
x = b_int & mask2
6970
a = (x & mask).bit_count()
7071
b = ((x >> eta) & mask).bit_count()
71-
b_int >>= 2*eta
72+
b_int >>= 2 * eta
7273
coefficients[i] = (a - b) % 3329
7374
return self(coefficients, is_ntt=is_ntt)
7475

@@ -129,7 +130,7 @@ def encode(self, d):
129130
t <<= d
130131
t |= self.coeffs[0]
131132
return t.to_bytes(32 * d, "little")
132-
133+
133134
def _compress_ele(self, x, d):
134135
"""
135136
Compute round((2^d / q) * x) % 2^d

0 commit comments

Comments
 (0)