[BACK]Return to crc32.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/Attic/crc32.c between version 1.7 and 1.7.2.2

version 1.7, 2000/09/07 20:27:51 version 1.7.2.2, 2001/02/19 17:18:51
Line 31 
Line 31 
  *      tions for all combinations of data and CRC register values   *      tions for all combinations of data and CRC register values
  *   *
  *      The values must be right-shifted by eight bits by the "updcrc   *      The values must be right-shifted by eight bits by the "updcrc
  *      logic; the shift must be unsigned (bring in zeroes).  On some   *      logic; the shift must be u_(bring in zeroes).  On some
  *      hardware you could probably optimize the shift in assembler by   *      hardware you could probably optimize the shift in assembler by
  *      using byte-swap instructions   *      using byte-swap instructions
  *      polynomial $edb88320   *      polynomial $edb88320
Line 43 
Line 43 
   
 #include "crc32.h"  #include "crc32.h"
   
 static unsigned int crc32_tab[] = {  static u_int crc32_tab[] = {
         0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,          0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
         0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,          0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
         0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,          0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
Line 100 
Line 100 
   
 /* Return a 32-bit CRC of the contents of the buffer. */  /* Return a 32-bit CRC of the contents of the buffer. */
   
 unsigned int  u_int
 ssh_crc32(const unsigned char *s, unsigned int len)  ssh_crc32(const u_char *s, u_int len)
 {  {
         unsigned int i;          u_int i;
         unsigned int crc32val;          u_int crc32val;
   
         crc32val = 0;          crc32val = 0;
         for (i = 0;  i < len;  i ++) {          for (i = 0;  i < len;  i ++) {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.7.2.2