Skip to content

Commit 5fc4136

Browse files
committed
Fix test failure
1 parent a8e4786 commit 5fc4136

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mife/single/lwe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def encrypt(x: List[int], pub: _FeLWE_MK) -> _FeLWE_C:
109109
e1 = Matrix([round(sys_random.gauss(0, pub.alpha * pub.q)) for _ in range(pub.l)], dtype=object)
110110

111111
c0 = ((pub.A @ s) + e0) % pub.q
112-
c1 = ((pub.U @ s) + e1 + ((pub.q // pub.k) * Matrix(x))) % pub.q
112+
c1 = ((pub.U @ s) + e1 + ((pub.q // pub.k) * Matrix(x, dtype=object))) % pub.q
113113

114114
return _FeLWE_C(c0, c1)
115115

@@ -127,7 +127,7 @@ def decrypt(c: _FeLWE_C, pub: _FeLWE_MK, sk: _FeLWE_SK) -> int:
127127
minimum = abs(u1)
128128
answer = i
129129

130-
if answer > pub.k//2 :
130+
if answer > pub.k//2:
131131
return answer - pub.k
132132
return answer
133133

0 commit comments

Comments
 (0)