version 1.1.1.1, 2013/01/17 10:05:35
|
version 1.4, 2015/06/25 17:53:50
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 | Copyright 2004 - 2015 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 78 const crcPoly_t crc_Poly[] = {
|
Line 78 const crcPoly_t crc_Poly[] = {
|
inline u_int |
inline u_int |
crcReflect(u_int crcNum, u_char crcBits) |
crcReflect(u_int crcNum, u_char crcBits) |
{ |
{ |
register u_int i, j, rev; | register u_int i, j = 1, rev = 0; |
|
|
for (i = (u_int) 1 << (crcBits - 1), j = 1, rev ^= rev; i; i >>= 1, j <<= 1) | for (i = (u_int) 1 << (crcBits - 1); i; i >>= 1, j <<= 1) |
if (crcNum & i) |
if (crcNum & i) |
rev |= j; |
rev |= j; |
return rev; |
return rev; |
Line 287 crcFletcher(u_short * __restrict nBuf, int bufLen)
|
Line 287 crcFletcher(u_short * __restrict nBuf, int bufLen)
|
inline u_int |
inline u_int |
crcAdler(u_char * __restrict psBuf, int bufLen) |
crcAdler(u_char * __restrict psBuf, int bufLen) |
{ |
{ |
register u_int s1, s2, clen; | register u_int s1 = 1, s2 = 0, clen; |
|
|
assert(psBuf); |
assert(psBuf); |
|
|
s1 = 1L; |
|
s2 ^= s2; |
|
while (bufLen) { |
while (bufLen) { |
clen = bufLen > MAX_ADLER_DIGEST ? MAX_ADLER_DIGEST : bufLen; |
clen = bufLen > MAX_ADLER_DIGEST ? MAX_ADLER_DIGEST : bufLen; |
bufLen -= clen; |
bufLen -= clen; |