Closed enzoh closed 4 years ago
Hello :)
I think you're correct. The gfPolyRemainder() code expects the []gfElement{}s to be specified in our "normalised" form, that is, the last coefficient should be 1, not 0. This allows for easy determining of the degree of the polynomial. The test violates this assumption, and also has the wrong answer.
I've fixed this in f7f7eae5c66797549ecc55be0144bf46bccdfc92 .The qrcode library should be only using normalised form anyway. I'll have a look around to see if any other similar cases need fixing.
thanks!
Apologies in advance if I have misread your code. I was looking at test case #3 for TestGFPolyRemainder with
where coefficients are of the form a0 + a1 x + a2 x^2 + a3 x^3... I read this test case as
1 mod (1 + 0 * x)
=1 mod 1
=0
!=1
Did you mean to writeremainder = gfPoly{[]gfElement{0}}
?