From owner-freebsd-hackers Thu Jan 23 10:47:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id KAA04141 for hackers-outgoing; Thu, 23 Jan 1997 10:47:38 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id KAA04134 for ; Thu, 23 Jan 1997 10:47:36 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA24098; Thu, 23 Jan 1997 11:31:20 -0700 From: Terry Lambert Message-Id: <199701231831.LAA24098@phaeton.artisoft.com> Subject: Re: CRC-16 algorithms? To: msmith@atrad.adelaide.edu.au (Michael Smith) Date: Thu, 23 Jan 1997 11:31:20 -0700 (MST) Cc: hackers@FreeBSD.ORG In-Reply-To: <199701231259.XAA21523@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Jan 23, 97 11:29:27 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > (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( > > If you're into cracking these sorts of things, here's the parameter space : > > 00000000 00 39 3c 3e 01 02 03 00 80 00 00 00 00 00 00 00 |.9<>............| > 00000010 08 00 0e 20 3d 4b 00 00 00 00 00 00 00 02 01 00 |... =K..........| > 00000020 01 03 00 de ad 01 00 00 00 00 00 00 00 00 00 01 |....-...........| > 00000030 00 00 00 00 00 00 00 00 00 00 00 00 01 26 3c aa |.............&<.| > > The bytes at 0x3d and 0x3e are the CRC-16 of the bytes from 0-0x3c > inclusive. Any help here will help make the DOS configuration utility > for this device unnecessary, which would be nice 8) Brute-force it; there are only 65536 * 2 * 4^2 possibilities, and of these, there are only 32768 "likely" values (non-reflected, polynomial value ends in 1, W XOR value is all 0's). Here is a pointer to code for generalized CRC algorithms: http://www.strangecreations.com/strange/library/misc/crc.txt It also contains code for table generation for building a table-driven implementation once you find the correct polynomial. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.