diff --git a/src/gf256.py b/src/gf256.py --- a/src/gf256.py +++ b/src/gf256.py @@ -26,6 +26,7 @@ inv=[E[255-L[i]] if i!=0 else None for i def gfmul(a, b): """Fast multiplication. Basic multiplication is expensive. a*b==g**(log(a)+log(b))""" + assert 0<=a<=255, 0<=b<=255 if a==0 or b==0: return 0 t=L[a]+L[b] if t>255: t-=255