A
cyclic redundancy check (CRC) is a non-secure
hash functionA hash function is any well-defined procedure or mathematical function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index to an array...
designed to detect accidental changes to raw computer data, and is commonly used in digital
networksA telecommunications network is a network of telecommunications links and nodes arranged so that messages may be passed from one part of the network to another over multiple links and through various nodes....
and storage devices such as
hard disk driveA hard disk drive is a non-volatile storage device that stores digitally encoded data on rapidly rotating platters with magnetic surfaces. Strictly speaking, "drive" refers to the motorized mechanical aspect that is distinct from its medium, such as a tape drive and its tape, or a floppy disk...
s. A CRC-enabled device calculates a short, fixed-length binary sequence, known as the
CRC code or just
CRC, for each block of data and sends or stores them both together. When a block is read or received the device repeats the calculation; if the new CRC does not match the one calculated earlier, then the block contains a
data error and the device may take corrective action such as rereading or requesting the block be sent again.
CRCs are so called because the
check (data verification) code is a
redundancy (it adds zero information) and the algorithm is based on
cyclic codesIn mathematics of coding theory and digital communications, cyclic codes find an important application in error detection and correction.-Definition:Let C be a linear code over a finite field A of block length n...
. The term CRC may refer to the check code or to the function that calculates it, which accepts data streams of any length as input but always outputs a fixed-length code. CRCs are popular because they are simple to implement in binary
hardwareA personal computer is made up of multiple physical components of computer hardware, upon which can be installed an operating system and a multitude of software to perform the operator's desired functions.-Typical PC hardware:...
, are easy to analyse mathematically, and are particularly good at detecting common errors caused by
noiseIn common use, the word noise means unwanted sound or noise pollution. In both analog and digital electronics, noise or signal noise is an unwanted random addition to a wanted signal; it is called noise as a generalisation of the audible noise heard when listening to a weak radio transmission...
in transmission channels. The CRC was invented by
W. Wesley PetersonWilliam Wesley Peterson, PhD was an American mathematician and computer scientist...
, and published in his 1961 paper. The
IEEEThe IEEE is an international non-profit, professional organization for the advancement of technology related to electricity. It has the most members of any technical professional organization in the world, with more than 365,000 members in around 150 countries.-History:The IEEE is incorporated in...
-recommended 32-bit CRC, used in
EthernetEthernet is a family of frame-based computer networking technologies for local area networks . The name comes from the physical concept of the ether...
and elsewhere, appeared at a telecommunications conference in 1975.
Introduction
A CRC is an error-detecting code. Its computation resembles a
long divisionIn arithmetic, long division is the standard procedure suitable for dividing simple or complex multidigit numbers. It breaks down a division problem into a series of easier steps. As in all division problems, one number, called the dividend, is divided by another, called the divisor, producing a...
operation in which the
quotientIn mathematics, a quotient is the result of a division. For example, when dividing 6 by 3, the quotient is 2, while 6 is called the dividend, and 3 the divisor. The quotient can also be expressed as the number of times the divisor divides into the dividend....
is discarded and the
remainderIn arithmetic, when the result of the division of two integers cannot be expressed with an integer quotient, the remainder is the amount "left over."- The remainder for natural numbers :...
becomes the
resultA result is the final consequence of a sequence of actions or events expressed qualitatively or quantitatively. Possible results include advantage, disadvantage, gain, injury, loss, value and victory. There may be a range of possible outcomes associated with an event depending on the point of...
, with the important distinction that the arithmetic used is the carry-less arithmetic of a
finite fieldIn abstract algebra, a finite field or Galois field is a field that contains only finitely many elements. Finite fields are important in number theory, algebraic geometry, Galois theory, cryptography, and coding theory...
. The length of the remainder is always less than or equal to the length of the divisor, which therefore determines how long the result can be. The definition of a particular CRC specifies the divisor to be used, among other things.
Although CRCs can be constructed using any finite field, all commonly used CRCs employ the finite field
GF(2)GF is the Galois field of two elements. It is the smallest nontrivial finite field, a consequence of the fact that 2 is a prime number.- Definition :...
. This is the field of two elements, usually called 0 and 1, comfortably matching computer architecture. The rest of this article will discuss only these binary CRCs, but the principles are more general.
An important reason for the popularity of CRCs for detecting the accidental alteration of data is their efficiency guarantee. Typically, an n-bit CRC, applied to a data block of arbitrary length, will detect any single
error burstIn telecommunication, an error burst is a contiguous sequence of symbols, received over a data transmission channel, such that the first and last symbols are in error and there exists no contiguous subsequence of m correctly received symbols within the error burst.The integer parameter m is...
not longer than n bits (in other words, any single alteration that spans no more than n bits of the data), and will detect a fraction of all longer error bursts. Errors in both data transmission channels and magnetic storage media tend to be distributed non-randomly (i.e. are "bursty"), making CRCs' properties more useful than alternative schemes such as multiple parity checks.
The simplest error-detection system, the
parity bitA parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code....
, is in fact a trivial CRC: it uses the two-bit-long divisor 11.
CRCs and data integrity
CRCs are not, by themselves, suitable for protecting against intentional alteration of data (for example, in authentication applications for data security), because their convenient mathematical properties make it easy to compute the CRC adjustment required to match any given change to the data.
It is often falsely assumed that when a message and its CRC are received from an open channel and the CRC matches the message's calculated CRC then the message cannot have been altered in transit. This is of course false, because both could have been changed, such that the new CRC would match the new message. Therefore, CRCs can be relied upon to verify correctness but not
integrityData integrity is a term used in computer science and telecommunications that can mean ensuring data is "whole" or complete, the condition in which data is identically maintained during any operation , the preservation of data for their intended use, or, relative to specified operations, the a...
.
Although CRCs share a problem with
message digestsA cryptographic hash function is a deterministic procedure that takes an arbitrary block of data and returns a fixed-size bit string, the hash value, such that an accidental or intentional change to the data will change the hash value...
in that there cannot be a 1:1 relationship between all possible messages and all possible CRCs, the CRC function fares worse because it is not a
trapdoor functionA trapdoor function is a function that is easy to compute in one direction, yet believed to be difficult to compute in the opposite direction without special information, called the "trapdoor"...
. That is, it is easy to generate other messages that result in the same CRC, especially messages based on the original. By design, however, a message that is too similar (differing only by a trivial
noiseElectronic noise is a random signal characteristic of all electronic circuits. Depending on the circuit, the noise generated by electronic devices can vary greatly. Noise can be produced by several different effects. Thermal noise and shot noise are inherent to all devices...
pattern) will have a dramatically different CRC and thus be detected.
In contrast, an effective way to protect messages against intentional tampering is by the use of a
message authentication codeIn cryptography, a message authentication code is a short piece of information used to authenticate a message.A MAC algorithm, sometimes called a keyed hash function, accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC...
such as
HMACIn cryptography, a keyed-Hash Message Authentication Code , is a type of message authentication code calculated using a specific algorithm involving a cryptographic hash function in combination with a secret key. As with any MAC, it may be used to simultaneously verify both the data integrity and...
.
Computation of CRC
To compute an n-bit binary CRC, line the bits representing the input in a row, and position the (n+1)-bit pattern representing the CRC's divisor (called a "
polynomialIn mathematics, a polynomial is a finite length expression constructed from variables and constants, by using the operations of addition, subtraction, multiplication, and constant non-negative whole number exponents...
") underneath the left-hand end of the row. Here is the first calculation for computing a 3-bit CRC:
11010011101100 <--- Input
1011 <--- divisor (4 Bits)
--------------
01100011101100 <--- result
If the input bit above the leftmost divisor bit is 0, do nothing and move the divisor to the right by one bit. If the input bit above the leftmost divisor bit is 1, the divisor is exclusive-ORed into the input (in other words, the input bit above each 1-bit in the divisor is toggled). The divisor is then shifted one bit to the right, and the process is repeated until the divisor reaches the right-hand end of the input row. Here is the last calculation:
00000000001110 <--- result of multiplication calculation
1011 <--- divisor
--------------
00000000000101 <--- remainder (3 bits)
Since the leftmost divisor bit zeroed every input bit it touched, when this process ends the only bits in the input row that can be nonzero are the n bits at the right-hand end of the row. These n bits are the remainder of the division step, and will also be the value of the CRC function (unless the chosen CRC specification calls for some post-processing).
Mathematics of CRC
Mathematical analysis of this division-like process reveals how to pick a divisor that guarantees good error-detection properties. In this analysis, the digits of the bit strings are thought of as the coefficients of a polynomial in some variable x—coefficients that are elements of the finite field
GF(2)GF is the Galois field of two elements. It is the smallest nontrivial finite field, a consequence of the fact that 2 is a prime number.- Definition :...
instead of more familiar numbers. This "polynomial trick" allows bit strings to be viewed as elements of a
ringIn mathematics, a ring is an algebraic structure consisting of a set together with two binary operations , where each operation combines two elements to form a third element...
. A ring is, loosely speaking, a set of elements somewhat like numbers, that can be operated on by an operation that somewhat resembles addition and another operation that somewhat resembles multiplication, these operations possessing many of the familiar arithmetic properties of commutativity, associativity, and distributivity. Many analytical tools commonly used with numbers also work on rings, and this is why the "polynomial" view helps the analysis.
Specification of CRC
The concept of the CRC as an error-detecting code gets complicated when an implementer or standards committee turns it into a practical system. Here are some of the complications:
- Sometimes an implementation prefixes a fixed bit pattern to the bitstream to be checked. This is useful when clocking errors might insert 0-bits in front of a message, an alteration that would otherwise leave the CRC unchanged.
- Sometimes an implementation appends n 0-bits (n being the size of the CRC) to the bitstream to be checked before the polynomial division occurs. This has the convenience that the CRC of the original bitstream with the CRC appended is exactly zero, so the CRC can be checked simply by performing the polynomial division on the expanded bitstream and comparing the remainder with zero.
- Sometimes an implementation exclusive-ORs a fixed bit pattern into the remainder of the polynomial division.
- Bit order: Some schemes view the low-order bit of each byte as "first", which then during polynomial division means "leftmost", which is contrary to our customary understanding of "low-order". This convention makes sense when serial-port
In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time...
transmissions are CRC-checked in hardware, because some widespread serial-port transmission conventions transmit bytes least-significant bit first.
- Byte order: With multi-byte CRCs, there can be confusion over whether the byte transmitted first (or stored in the lowest-addressed byte of memory) is the least-significant byte or the most-significant byte. For example, some 16-bit CRC schemes swap the bytes of the CRC.
- Omission of the high-order bit of the divisor polynomial: Since the high-order bit is always 1, and since an -bit CRC must be defined by an -bit divisor which overflow
The term arithmetic overflow or simply overflow has the following meanings.# In a computer, the condition that occurs when a calculation produces a result that is greater in magnitude than that which a given register or storage location can store or represent.# In a computer, the amount by which a...
s an -bit registerIn computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere. Most, but not all, modern computers adopt the so-called load-store architecture...
, some writers assume that it is unnecessary to mention the divisor's high-order bit.
Commonly used and standardized CRCs
While cyclic redundancy checks form part of several standards, they are not themselves standardized to the point of adopting one algorithm of each degree worldwide: there are three polynomials reported for CRC-12, ten conflicting definitions of CRC-16, and four of CRC-32. The polynomials usually seen are not the most efficient ones possible. Between 1993 and 2004, Koopman, Castagnoli and others surveyed the space of polynomials up to 16 bits, and of 24 and 32 bits, finding examples that have much better performance (in terms of
Hamming distanceIn information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different...
for a given message size) than the polynomials of earlier protocols, and publishing the best of these with the aim of improving the error detection capacity of future standards. In particular,
iSCSIIn computing, iSCSI , is an abbreviation of Internet Small Computer System Interface, an Internet Protocol -based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage...
has adopted one of the findings of this research.
The popular and IEEE-recommended CRC-32 polynomial, used by
EthernetEthernet is a family of frame-based computer networking technologies for local area networks . The name comes from the physical concept of the ether...
, FDDI and others, is the generating polynomial of a
Hamming codeIn telecommunication, a Hamming code is a linear error-correcting code named after its inventor, Richard Hamming. Hamming codes can detect up to two simultaneous bit errors, and correct single-bit errors; thus, reliable communication is possible when the Hamming distance between the transmitted and...
and, far from being arbitrarily chosen, was selected for its error detection performance. Even so, the Castagnoli CRC-32C polynomial used in iSCSI matches its performance on messages from 58 bits–131 kbits, and outperforms it in several size ranges including the two most common sizes of Internet packet. The
ITU-TThe Telecommunication Standardization Sector coordinates standards for telecommunications on behalf of the International Telecommunication Union and is based in Geneva, Switzerland....
G.hnG.hn is the common name for the "next generation" home network technology standard being developed under the International Telecommunication Union and promoted by the and many other organizations....
standard also uses CRC-32C to detect errors in the payload (although it uses CRC-16-CCITT for PHY headers).
The table below lists only the polynomials of the various algorithms in use. Any particular protocol can impose pre-inversion, post-inversion and reversed bit ordering as described above. CRCs in proprietary protocols might use a complicated initial value and final XOR for
obfuscationObfuscation is the concealment of intended meaning in communication, making communication confusing, intentionally ambiguous, and more difficult to interpret.- Background :...
but this does not add cryptographic strength to the algorithm.
Note: in this table the high-order bit is omitted; see Specification of CRC above.
| Name |
Polynomial |
Representations: normal / reversed / reverse of reciprocal |
| CRC-1 |
(most hardware; also known as parity bitA parity bit is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code.... ) |
0x1 / 0x1 / 0x1 |
| CRC-4-ITU |
(ITUItu is an old and historic municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language. Itu is linked with the highway numbered the SP-75 and are flowed with two rivers, Tietê... G.704, p. 12) |
0x3 / 0xC / 0x9 |
| CRC-5-EPC |
(Gen 2 RFID) |
0x09 / 0x12 / 0x14 |
| CRC-5-ITU |
(ITUItu is an old and historic municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language. Itu is linked with the highway numbered the SP-75 and are flowed with two rivers, Tietê... G.704, p. 9) |
0x15 / 0x15 / 0x1A |
| CRC-5-USB |
(USB token packets) |
0x05 / 0x14 / 0x12 |
| CRC-6-ITU |
(ITUItu is an old and historic municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language. Itu is linked with the highway numbered the SP-75 and are flowed with two rivers, Tietê... G.704, p. 3) |
0x03 / 0x30 / 0x21 |
| CRC-7 |
(telecom systems, ITUItu is an old and historic municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language. Itu is linked with the highway numbered the SP-75 and are flowed with two rivers, Tietê... -T G.707, ITUItu is an old and historic municipality in the state of São Paulo in Brazil. The population in 2004 is 149,758 and the area is 641.68 km². The elevation is 583 m. This place name comes from the Tupi language. Itu is linked with the highway numbered the SP-75 and are flowed with two rivers, Tietê... -T G.832, MMCThe MultiMediaCard is a flash memory memory card standard. Unveiled in 1997 by Siemens AG and SanDisk, it is based on Toshiba's NAND-based flash memory, and is therefore much smaller than earlier systems based on Intel NOR-based memory such as CompactFlash. MMC is about the size of a postage... ,SDSecure Digital is a non-volatile memory card format developed by Matsushita, SanDisk, and Toshiba for use in portable devices. Today it is widely used in digital cameras, digital camcorders, handheld computers, PDAs, media players, mobile phones, GPS receivers, and video games... ) |
0x09 / 0x48 / 0x44 |
CRC-8-ATMAsynchronous transfer mode is an electronic digital data transmission technology. ATM is implemented as a network protocol and was first developed in the mid 1980s. The goal was to design a single networking strategy that could transport real-time video conference and audio as well as image... |
(ATM HEC This is a bit error detection and correction mechanism used in data transmitter and receiver.The Header Error Correction is the last field in the Asynchronous Transfer Mode cell consisting of an 8-bit CRC of the cell's header only.... ) |
0x07 / 0xE0 / 0x83 |
| CRC-8-CCITT |
(1-Wire 1-Wire is a registered trademark of Dallas Semiconductor Corp. for a device communications bus system designed by Dallas Semiconductor that provides low-speed data, signaling and power over a single signal, albeit using two wires, one for ground, one for power and data. 1-Wire is similar in concept... bus) |
0x8D / 0xB1 / 0xC6 |
| CRC-8-Dallas Dallas Semiconductor, now a subsidiary of Maxim Integrated Products, designs and manufactures analog, digital, and mixed-signal semiconductors... /MaximMaxim Integrated Products is a publicly traded company that designs, manufactures, and sells high-performance semiconductor products. The company’s stated mission is to deliver innovative analog and mixed-signal engineering solutions that add value to its customers’ products... |
(1-Wire 1-Wire is a registered trademark of Dallas Semiconductor Corp. for a device communications bus system designed by Dallas Semiconductor that provides low-speed data, signaling and power over a single signal, albeit using two wires, one for ground, one for power and data. 1-Wire is similar in concept... bus) |
0x31 / 0x8C / 0x98 |
| CRC-8 |
|
0xD5 / 0xAB / 0xEA |
| CRC-8-SAE J1850 |
|
0x1D / 0xB8 / 0x8E |
| CRC-10 |
|
0x233 / 0x331 / 0x319 |
| CRC-11 |
(FlexRay FlexRay is a new automotive network communications protocol under development by the . It is designed to be faster and more reliable than CAN, but is also more expensive.-Features:FlexRay's prominent features are:... ) |
0x385 / 0x50E / 0x5C2 |
| CRC-12 |
(telecom systems, )
|
0x80F / 0xF01 / 0xC07 |
CRC-15-CANController–area network is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer....
|
|
0x4599 / 0x4CD1 / 0x62CC |
CRC-16-IBMInternational Business Machines Corporation, abbreviated IBM, is a multinational computer technology and IT consulting corporation headquartered in Armonk, Town of North Castle, New York, United States. The company is one of the few information technology companies with a continuous history dating... |
(Bisync Binary Synchronous Communication is an IBM link protocol, announced in 1967 after the introduction of System/360. It replaced the synchronous-transmit-receive protocol used with second generation computers. The intent was that common link management rules could be used with three different... , ModbusModbus is a serial communications protocol published by Modicon in 1979 for use with its programmable logic controllers . It has become a de facto standard communications protocol in industry, and is now the most commonly available means of connecting industrial electronic devices... , USB, ANSI X3.28, many others; also known as CRC-16 and CRC-16-ANSI) |
0x8005 / 0xA001 / 0xC002 |
| CRC-16-CCITT |
(X.25 X.25 is an ITU-T standard protocol suite for packet switched wide area network communication. An X.25 WAN consists of packet-switching exchange nodes as the networking hardware, and leased lines, Plain old telephone service connections or ISDN connections as physical links... , HDLC, XMODEMXMODEM is a simple file transfer protocol developed as a quick hack by Ward Christensen for use in his 1977 MODEM.ASM terminal program. XMODEM became extremely popular in the early bulletin board system market, largely because it was so simple to implement... , BluetoothBluetooth is an open wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables... , SDSecure Digital is a non-volatile memory card format developed by Matsushita, SanDisk, and Toshiba for use in portable devices. Today it is widely used in digital cameras, digital camcorders, handheld computers, PDAs, media players, mobile phones, GPS receivers, and video games... , many others; known as CRC-CCITT) |
0x1021 / 0x8408 / 0x8810 |
| CRC-16-T10-DIF DIF stands for Data Integrity Field. The purpose of this field is to provide End-to-End data protection in Computer/Enterprise data storage methodology.... |
(SCSI Small Computer System Interface, or SCSI , is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, and electrical and optical interfaces... DIF) |
0x8BB7 / 0xEDD1 / 0xC5DB |
CRC-16-DNPDNP3 is a set of communications protocols used between components in process automation systems. Its main use is in utilities such as electric and water companies. Usage in other industries is not common, although technically possible. Specifically, it was developed to facilitate communications... |
(DNP, IEC 870 IEC 60870-5 provides a communication profile for sending basic telecontrol messages between two systems, which uses permanent directly connected data circuits between the systems. The IEC Technical Committee 57 have developed a protocol standard for Telecontrol, Teleprotection, and associated... , M-BusM-Bus is a European standard for the remote reading of gas or electricity meters. M-Bus is also usable for other types of consumption meters. The M-Bus interface is made for communication on two wire, making it very cost effective... ) |
0x3D65 / 0xA6BC / 0x9EB2 |
| CRC-16-Fletcher |
Not a CRC; see Fletcher's checksum Fletcher's checksum is one of several types of checksum algorithms, which are relatively simple processes used by computers to check the integrity of data.... |
Used in Adler-32 Adler-32 is a checksum algorithm which was invented by Mark Adler. Compared to a cyclic redundancy check of the same length, it trades reliability for speed. Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32... A & B CRCs |
| CRC-24 |
(FlexRay FlexRay is a new automotive network communications protocol under development by the . It is designed to be faster and more reliable than CAN, but is also more expensive.-Features:FlexRay's prominent features are:... ) |
0x5D6DCB / 0xD3B6BA / 0xAEB6E5 |
| CRC-24-Radix-64 |
(OpenPGP) |
0x864CFB / 0xDF3261 / 0xC3267D |
| CRC-30 |
(CDMA) |
0x2030B9C7 / 0x38E74301 / 0x30185CE3 |
| CRC-32-Adler |
Not a CRC; see Adler-32 Adler-32 is a checksum algorithm which was invented by Mark Adler. Compared to a cyclic redundancy check of the same length, it trades reliability for speed. Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32... |
See Adler-32 Adler-32 is a checksum algorithm which was invented by Mark Adler. Compared to a cyclic redundancy check of the same length, it trades reliability for speed. Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32...
|
| CRC-32-IEEE 802.3 IEEE 802.3 is a collection of IEEE standards defining the Physical Layer and Data Link Layer's media access control sublayer of wired Ethernet. This is generally a LAN technology with some WAN applications... |
(V.42, MPEG-2MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission... , PNG, POSIXPOSIX or "Portable Operating System Interface [for Unix"] is the name of a family of related standards specified by the IEEE to define the application programming interface , along with shell and utilities interfaces for software compatible with variants of the Unix operating system, although the... cksumcksum is a command in Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads the file or files specified as arguments, or standard input if no arguments are provided, and calculates a checksum value, cyclic redundancy check and the byte... ) |
0x04C11DB7 / 0xEDB88320 / 0x82608EDB |
| CRC-32C (Castagnoli) |
(iSCSI In computing, iSCSI , is an abbreviation of Internet Small Computer System Interface, an Internet Protocol -based storage networking standard for linking data storage facilities. By carrying SCSI commands over IP networks, iSCSI is used to facilitate data transfers over intranets and to manage... , G.hnG.hn is the common name for the "next generation" home network technology standard being developed under the International Telecommunication Union and promoted by the and many other organizations.... payload) |
0x1EDC6F41 / 0x82F63B78 / 0x8F6E37A0 |
| CRC-32K (Koopman) |
|
0x741B8CD7 / 0xEB31D82E / 0xBA0DC66B |
| CRC-32Q |
(aviation; AIXM The Aeronautical Information Exchange Model is designed to enable the management and distribution of Aeronautical Information Services data in digital format. AIXM version 5.0, set to be finalized in late 2007, is based on Geography Markup Language and is one of the GML Application Schemas... ) |
0x814141AB / 0xD5828281 / 0xC0A0A0D5 |
| CRC-64-ISO |
(HDLC — ISO 3309High-Level Data Link Control is a bit-oriented synchronous data link layer protocol developed by the International Organization for Standardization... ) |
0x000000000000001B / 0xD800000000000000 / 0x800000000000000D |
CRC-64-ECMAEcma International ' is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's international reach... -182 |
(as described in ECMA-182 p. 51) |
0x42F0E1EBA9EA3693 / 0xC96C5795D7870F42 / 0xA17870F5D4F51B49 |
Known to exist, but technologically defunct—mainly replaced by cryptographic hash functions:
- CRC-128 (IEEE)
- CRC-256 (IEEE)
Designing CRC polynomials
The selection of generator polynomial is the most important part of implementing the CRC algorithm. The polynomial must be chosen to maximise the error detecting capabilities while minimising overall collision probabilities.
The most important attribute of the polynomial is its length (the number of the highest nonzero coefficient), because of its direct influence of the length of the computed checksum.
The most commonly used polynomial lengths are:
- 9 bits (CRC-8)
- 17 bits (CRC-16)
- 33 bits (CRC-32)
- 65 bits (CRC-64)
The design of the CRC polynomial depends on what is the maximum total length of the block to be protected (data + CRC bits), the desired error protection features, and the type resources for implementing the CRC as well as the desired performance. A common misconception is that the "best" CRC polynomials are derived from either an
irreducible polynomialIn mathematics, the adjective irreducible means that an object cannot be expressed as a product of more than one non-trivial factors in a given set. See also factorization.For any field F, the ring of polynomials with coefficients in F is denoted by...
or an
irreducible polynomialIn mathematics, the adjective irreducible means that an object cannot be expressed as a product of more than one non-trivial factors in a given set. See also factorization.For any field F, the ring of polynomials with coefficients in F is denoted by...
times the factor , which adds to the code the ability to detect all errors affecting an odd number of bits. In reality, all the factors described above should enter in the selection of the polynomial.
The advantage of choosing say a primitive polynomial as the generator for a CRC code is that the resulting code has maximal total block length; in here if r is the degree of the primitive generator polynomial then the maximal total blocklength is equal to , and the associated code is able to detect any single bit or double errors. If instead, we used as generator polynomial , where is a primitive polynomial of degree , then the maximal total blocklength would be equal to but the code would be able to detect single, double, and triple errors.
A polynomial that admits other factorizations may be chosen then so as to balance the maximal total blocklength with a desired error detection power. A powerful class of such polynomials, which subsumes the two examples described above, is that of BCH codes. Regardless of the reducibility properties of a generator polynomial of degree r, assuming that it includes the "+1" term, such error detection code will be able to detect all error patterns that are confined to a window of r contiguous bits. These patterns are called "error bursts".
See also
- Error correcting code
- Cyclic code
In mathematics of coding theory and digital communications, cyclic codes find an important application in error detection and correction.-Definition:Let C be a linear code over a finite field A of block length n...
- Redundancy check
- List of checksum algorithms
- Parity
- Information security
Information security means protecting information and information systems from unauthorized access, use, disclosure, disruption, modification or destruction.The terms information security, computer security and information assurance are...
- Simple file verification
- cksum
cksum is a command in Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads the file or files specified as arguments, or standard input if no arguments are provided, and calculates a checksum value, cyclic redundancy check and the byte...
- Header Error Correction
This is a bit error detection and correction mechanism used in data transmitter and receiver.The Header Error Correction is the last field in the Asynchronous Transfer Mode cell consisting of an 8-bit CRC of the cell's header only....
- Adler-32
Adler-32 is a checksum algorithm which was invented by Mark Adler. Compared to a cyclic redundancy check of the same length, it trades reliability for speed. Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32...
- Fletcher's checksum
Fletcher's checksum is one of several types of checksum algorithms, which are relatively simple processes used by computers to check the integrity of data....
- Mathematics of CRC
Cyclic Redundancy Check is based on division in the ring of polynomials over the finite field GF , that is, the set of polynomials where each coefficient is either zero or one, and arithmetic operations wrap around .Any string of bits can be interpreted as the coefficients of a message polynomial...
s
External links
- MathPages - Cyclic Redundancy Checks: overview with an explanation of error-detection of different polynomials.
- Free CRC Source Code from the Boost C++ Libraries
- The CRC Pitstop
- Williams, R. (1993-09) A Painless Guide to CRC Error Detection Algorithms Contains a rigorous explanation of how to generate the CRC table typically found in implementations.
- Black, R. (1994-02) Fast CRC32 in Software; algorithm 4 is used in Linux and info-zip's zip and unzip.
- Kounavis, M. and Berry, F. (2005). A Systematic Approach to Building High Performance, Software-based, CRC generators, Slicing-by-4 and slicing-by-8 algorithms
- CRC32: Generating a checksum for a file, C++ implementation by Brian Friesen
- The CRC++ Project Implementation in C++ which uses template classes to deal with different bit order
- Reversing CRC - Theory and Practice.
- 'CRC-Analysis with Bitfilters'.
- Cyclic Redundancy Check: theory, practice, hardware, and software with emphasis on CRC-32. A sample chapter from Henry S. Warren, Jr. Hacker's Delight
Hacker's Delight by Henry S. Warren, Jr., is a book published by Addison-Wesley Professional July 17, 2002. It discusses a variety of programming algorithms for common tasks involving integer types, often with the aim of performing the minimum number of operations or replacing slow operations by...
.