Changeset 18 for trunk/src/sh_tiger0.c
- Timestamp:
- Jan 28, 2006, 9:07:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_tiger0.c
r11 r18 25 25 #include "sh_utils.h" 26 26 27 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 27 #define PRIV_MAX 32768 28 29 #if defined(TIGER_64_BIT) 28 30 #if defined(HAVE_LONG_64) 29 31 typedef unsigned long int word64; 32 #elif defined(HAVE_LONG_LONG_64) 33 typedef unsigned long long int word64; 30 34 #else 31 typedef unsigned long long int word64; 35 #error No 64 bit type found ! 32 36 #endif 33 37 #endif … … 46 50 #define GPGFORMAT (_("%08X %08X %08X %08X %08X %08X")) 47 51 #else 48 #error No 32 b ytetype found !52 #error No 32 bit type found ! 49 53 #endif 50 54 … … 54 58 #define FIL__ _("sh_tiger0.c") 55 59 56 #if defined( HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)57 /* #ifdef HAVE_LONG_64 */ 60 #if defined(TIGER_64_BIT) 61 58 62 void tiger_t(word64 *str, word64 length, word64 * res); 59 63 void tiger(word64 *str, word64 length, word64 * res); … … 97 101 static sh_byte buffer[PRIV_MAX + 72]; 98 102 99 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 100 /* #ifdef HAVE_LONG_64 */ 103 #if defined(TIGER_64_BIT) 101 104 static 102 105 word64 * sh_tiger_hash_val (char * filename, TigerType what, … … 114 117 char * tmp; 115 118 sh_byte * bptr; 116 /* sh_byte buffer[PRIV_MAX + 72]; */117 119 sh_byte bbuf[64]; 118 120 … … 131 133 #endif 132 134 133 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 134 /* #ifdef HAVE_LONG_64 */ 135 #if defined(TIGER_64_BIT) 135 136 #define TIGER_CAST (word64*) 136 137 static word64 res[3]; … … 254 255 } 255 256 256 if (blk < 64) /* this must be (PRIV_MAX / 64) */257 if (blk < (PRIV_MAX / 64)) /* this must be (PRIV_MAX / 64) */ 257 258 break; 258 259 … … 359 360 bptr = buffer; 360 361 361 memcpy(bptr, bbuf, 64); bptr += 64; 362 memcpy(bptr, bbuf, 64); bptr += 64; 363 memcpy(bptr, buffer, 128); bptr += 128; 364 memcpy(bptr, buffer, 256); bptr += 256; 365 memcpy(bptr, buffer, 512); bptr += 512; 366 memcpy(bptr, buffer,1024); bptr += 1024; 367 memcpy(bptr, buffer,2048); 362 memcpy(bptr, bbuf, 64); bptr += 64; 363 memcpy(bptr, bbuf, 64); bptr += 64; 364 memcpy(bptr, buffer, 128); bptr += 128; 365 memcpy(bptr, buffer, 256); bptr += 256; 366 memcpy(bptr, buffer, 512); bptr += 512; 367 memcpy(bptr, buffer, 1024); bptr += 1024; 368 memcpy(bptr, buffer, 2048); bptr += 2048; 369 memcpy(bptr, buffer, 4096); bptr += 4096; 370 memcpy(bptr, buffer, 8192); bptr += 8192; 371 memcpy(bptr, buffer,16384); 368 372 369 373 if (what == TIGER_FILE) … … 814 818 MSG_E_SUBGEN, _("Not TIGER_FD"), 815 819 _("sh_tiger_md5_hash")); 820 out[0] = '\0'; 816 821 return out; 817 822 } … … 1328 1333 MSG_E_SUBGEN, _("Not TIGER_FD"), 1329 1334 _("sh_tiger_sha1_hash")); 1335 out[0] = '\0'; 1330 1336 return out; 1331 1337 } … … 1410 1416 unsigned long Length, int timeout) 1411 1417 { 1412 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1413 /* #ifdef HAVE_LONG_64 */ 1418 #if defined(TIGER_64_BIT) 1414 1419 word64 * res; 1415 1420 #else … … 1425 1430 { 1426 1431 /*@-bufferoverflowhigh -formatconst@*/ 1427 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1428 /* #ifdef HAVE_LONG_64 */ 1432 #if defined(TIGER_64_BIT) 1429 1433 sprintf(out, /* known to fit */ 1430 1434 MYFORMAT, … … 1461 1465 char * out; 1462 1466 char outhash[48+6+1]; 1463 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1464 /* #ifdef HAVE_LONG_64 */ 1467 #if defined(TIGER_64_BIT) 1465 1468 word64 * res; 1466 1469 #else … … 1474 1477 { 1475 1478 /*@-bufferoverflowhigh -formatconst@*/ 1476 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1477 /* #ifdef HAVE_LONG_64 */ 1479 #if defined(TIGER_64_BIT) 1478 1480 sprintf(outhash, /* known to fit */ 1479 1481 GPGFORMAT, … … 1530 1532 unsigned long Length) 1531 1533 { 1532 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1533 /* #ifdef HAVE_LONG_64 */ 1534 #if defined(TIGER_64_BIT) 1534 1535 word64 * res; 1535 1536 #else … … 1548 1549 if (res != NULL) 1549 1550 { 1550 #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) 1551 /* #ifdef HAVE_LONG_64 */ 1551 #if defined(TIGER_64_BIT) 1552 1552 out[0] = (UINT32)(res[0]>>32); 1553 1553 out[1] = (UINT32)(res[0]);
Note:
See TracChangeset
for help on using the changeset viewer.