All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----cryptix.util.checksum.PRZ24
Notes on making a good 24-bit CRC: [FH]
The primitive irreducible polynomial of degree 23 over GF(2), 040435651 (octal), comes from Appendix C of "Error Correcting Codes, 2nd edition" by Peterson and Weldon, page 490. This polynomial was chosen for its uniform density of ones and zeros, which has better error detection properties than polynomials with a minimal number of nonzero terms. Multiplying this primitive degree-23 polynomial by the polynomial x + 1 yields the additional property of detecting any odd number of bits in error, which means it adds parity. This approach was recommended by Neal Glover.
To multiply the polynomial 040435651 by (x + 1), shift it left 1 bit and bitwise add (xor) the unshifted version back in. Dropping the unused upper bit (bit 24) produces a CRC-24 generator bitmask of 041446373 octal, or 0x864CFB (hex).
You can detect spurious leading zeros or framing errors in the message by initializing the CRC accumulator to some agreed-upon nonzero "random- like" value, but this is a bit nonstandard.
General notes:
These CRC functions are derived from code in chapter 19 of the book "C Programmer's Guide to Serial Communications", by Joe Campbell. Generalized to any CRC width by Philip Zimmermann.
Adapted from PGP, by Philip Zimmermann, source file armor.c.
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1.1.1 $
public PRZ24()
public void reset()
public void update(byte buffer[], int offset, int length)
public void update(int n)
public long getValue()
All Packages Class Hierarchy This Package Previous Next Index