Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 1997 17:27:28 +0100
From:      Arve Ronning <Arve.Ronning@alcatel.no>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        hackers@freebsd.org
Subject:   Re: CRC-16 algorithms?
Message-ID:  <32E79170.41C67EA6@alcatel.no>
References:  <199701231259.XAA21523@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Smith wrote:
> 
> (Yes, this is FreeBSD-related 8)
> 
> I'm looking for any implementations of various CRC-16 polynomials; I'm
> trying to compute a checksum for a parameter save area for a
> peripheral, which is documented as "CRC-16", but no details of the
> polynomial are given. 8(
> 

You should get hold of an article written by Aram Perez in IEEE MICRO
june 1983 pages 40-50. It contains an excellent description of byte-wise
CRC calculations with examples for CRC-16.

The 16 bit polynominals mentioned in the article are
CRC-16          x^16 + x^15 + x^2 + 1
SDLC(IBM,CCITT) x^16 + x^12 + x^5 + 1
CRC-16 reverse  x^16 + x^14 + x^1 + 1
SDLC reverse    x^16 + x^11 + x^4 + 1

As you may suspect from these examples, there can only be 2^15
different polynominals for calculating a 16 bit CRC result
(they must all be x^16 + .... + 1). So, it should be possible
to try them all :).

However, a CRC calculation is'nt completely specified by the
polynominal alone. There's also the question of which initial
value use for the CRC (I've seen 0 and 0xFFFF) and one's 
complementing of the final CRC.

So, you now have 2^17 possibilities (minimum, someone may be
taking the one's complement of only part of the final CRC:(,
or two different polynominals may give the same CRC for your
test data).

The chance is however, that one of the polynominals above has
been used, which only leaves sixteen probable possibilities:).
Test those. You may very well succeed ;-).

Good luck,
  -Arve




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32E79170.41C67EA6>