sctp_crc32.c (163980) | sctp_crc32.c (163996) |
---|---|
1/*- 2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 18 unchanged lines hidden (view full) --- 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ 32 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 18 unchanged lines hidden (view full) --- 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ 32 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.c 163980 2006-11-04 08:45:50Z ru $"); | 35__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.c 163996 2006-11-05 13:25:18Z rrs $"); |
36 37#include "opt_sctp.h" 38#include <sys/param.h> 39#include <netinet/sctp_crc32.h> 40 41#ifndef SCTP_USE_ADLER32 42 43 --- 540 unchanged lines hidden (view full) --- 584 unsigned char *buffer, 585 unsigned int length) 586{ 587 uint32_t offset; 588 589 if (length == 0) { 590 return (crc32); 591 } | 36 37#include "opt_sctp.h" 38#include <sys/param.h> 39#include <netinet/sctp_crc32.h> 40 41#ifndef SCTP_USE_ADLER32 42 43 --- 540 unchanged lines hidden (view full) --- 584 unsigned char *buffer, 585 unsigned int length) 586{ 587 uint32_t offset; 588 589 if (length == 0) { 590 return (crc32); 591 } |
592 offset = (uintptr_t) buffer & 3; | 592 offset = (uintptr_t) (buffer & ~0x3); |
593 return (sctp_crc32c_sb8_64_bit(crc32, buffer, length, offset)); 594} 595 596unsigned long sctp_crc_c[256] = { 597 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 598 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 599 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, 600 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, --- 113 unchanged lines hidden --- | 593 return (sctp_crc32c_sb8_64_bit(crc32, buffer, length, offset)); 594} 595 596unsigned long sctp_crc_c[256] = { 597 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, 598 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, 599 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, 600 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, --- 113 unchanged lines hidden --- |