- changed milestone to Going Public
- edited description
GRS doesn't properly check for field of column multipliers
Issue #23
resolved
F = GF(59)
n, k = 40, 12
F3 = GF(3)
try:
C = GeneralizedReedSolomonCode(F, n, k, F.list()[:n], [F3(2)]+[F.one()]*(n-1))
assert False , "Shouldn't be accepted"
except ValueError, e:
print "This should be an error for non-zero column multipliers:\n\t", e
The problem is in grs.py on the line
if (c in F for c in column_multipliers) == False:
raise ValueError("All column_multipliers must be elements of the field")
This code is semantically wrong. You should use the function all() to check whether a list/generating expr of bools are all true.
Comments (4)
-
reporter -
repo owner - changed status to resolved
See commit 7b46b30
-
reporter - changed status to open
Check your fix before you close the issue! Now your code rejects column multipliers exactly when they are all from the field.
-
repo owner - changed status to resolved
Resolved issue
#23→ <<cset 68e17a253748>>
- Log in to comment