2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Author : Ross Williams (ross@guest.adelaide.edu.au.). 2N/A * Date : 3 June 1993. 2N/A * Status : Public domain. 2N/A * Description : This is the implementation (.c) file for the reference 2N/A * implementation of the Rocksoft^tm Model CRC Algorithm. For more 2N/A * information on the Rocksoft^tm Model CRC Algorithm, see the document 2N/A * titled "A Painless Guide to CRC Error Detection Algorithms" by Ross 2N/A * Williams (ross@guest.adelaide.edu.au.). This document is likely to be in 2N/A * Note: Rocksoft is a trademark of Rocksoft Pty Ltd, Adelaide, Australia. 2N/A * Implementation Notes 2N/A * -------------------- 2N/A * To avoid inconsistencies, the specification of each function is not echoed 2N/A * here. See the header file for a description of these functions. 2N/A * This package is light on checking because I want to keep it short and 2N/A * simple and portable (i.e. it would be too messy to distribute my entire 2N/A * C culture (e.g. assertions package) with this package. 2N/A/* The following definitions make the code more readable. */ 2N/A/* Returns the value v with the bottom b [0,32] bits reflected. */ 2N/A/* Example: reflect(0x3e23L,3) == 0x3e26 */ 2N/A for (i = 0; i < b; i++) {
2N/A/* Returns a longword whose value is (2^p_cm->cm_width)-1. */ 2N/A/* The trick is to do this portably (e.g. without doing <<32). */ 2N/A for (i = 0; i <
8; i++) {
2N/A for (i = 0; i <
8; i++)