From: Mark Adler Date: Tue, 9 Jul 2019 15:55:13 +0000 (-0700) Subject: Fix error in comment on the polynomial representation of a byte. X-Git-Tag: 2.0.0~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f3cbc1c75dc9a5ded272360df3e4b88eff5a171;p=thirdparty%2Fzlib-ng.git Fix error in comment on the polynomial representation of a byte. --- diff --git a/tools/makecrct.c b/tools/makecrct.c index 323d0c03..3f6b37b1 100644 --- a/tools/makecrct.c +++ b/tools/makecrct.c @@ -37,7 +37,7 @@ static void gf2_matrix_square(uint32_t *square, const uint32_t *mat) { is just exclusive-or, and multiplying a polynomial by x is a right shift by one. If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b. This calculation is done using the shift-register method of multiplying and