Changeset 481 for trunk/src/sh_tiger1_64.c
- Timestamp:
- Jul 18, 2015, 5:06:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_tiger1_64.c
r474 r481 384 384 void tiger_compress(const word64 *str, word64 state[3]) 385 385 { 386 tiger_compress_macro((( word64*)str), ((word64*)state));386 tiger_compress_macro(((const word64*)str), ((word64*)state)); 387 387 } 388 388 … … 419 419 register word64 i; 420 420 register word64 j = 0; 421 unsigned char temp[64]; 421 union { 422 word64 w64_temp[8]; 423 unsigned char temp[64]; 424 } dd; 422 425 union { 423 426 word64 itmp; … … 435 438 #ifdef BIG_ENDIAN 436 439 for(j=0; j<64; j++) 437 temp[j^7] = ((sh_byte*)str)[j];438 tiger_compress(( (word64*)temp), res);440 dd.temp[j^7] = ((sh_byte*)str)[j]; 441 tiger_compress((dd.w64_temp), res); 439 442 #else 440 443 tiger_compress(str, res); … … 445 448 #ifdef BIG_ENDIAN 446 449 for(j=0; j<i; j++) 447 temp[j^7] = ((sh_byte*)str)[j];448 449 temp[j^7] = 0x01;450 dd.temp[j^7] = ((sh_byte*)str)[j]; 451 452 dd.temp[j^7] = 0x01; 450 453 j++; 451 454 for(; j&7; j++) 452 temp[j^7] = 0;455 dd.temp[j^7] = 0; 453 456 #else 454 457 455 458 #ifndef USE_MEMSET 456 459 for(j=0; j<i; j++) 457 temp[j] = ((sh_byte*)str)[j];458 #else 459 memcpy( temp, str, j=i );460 #endif 461 temp[j++] = 0x01;460 dd.temp[j] = ((const sh_byte*)str)[j]; 461 #else 462 memcpy( dd.temp, str, j=i ); 463 #endif 464 dd.temp[j++] = 0x01; 462 465 for(; j&7; j++) 463 temp[j] = 0;466 dd.temp[j] = 0; 464 467 465 468 #endif … … 469 472 #ifndef USE_MEMSET 470 473 for(; j<64; j++) 471 temp[j] = 0;472 #else 473 memset( temp+j, 0, 64-j);474 #endif 475 tiger_compress(( (word64*)temp), res);474 dd.temp[j] = 0; 475 #else 476 memset( (dd.temp)+j, 0, 64-j); 477 #endif 478 tiger_compress((dd.w64_temp), res); 476 479 j=0; 477 480 } … … 479 482 #ifndef USE_MEMSET 480 483 for(; j<56; j++) 481 temp[j] = 0;482 #else 483 memset( temp+j, 0, 56-j);484 dd.temp[j] = 0; 485 #else 486 memset( (dd.temp)+j, 0, 56-j); 484 487 #endif 485 488 … … 488 491 uu.itmp = ((word64)length)<<3; 489 492 for (j=0; j<8; j++) 490 temp[56+j] = uu.ctmp[j];491 492 tiger_compress(( (word64*)temp), res);493 dd.temp[56+j] = uu.ctmp[j]; 494 495 tiger_compress((dd.w64_temp), res); 493 496 } 494 497
Note:
See TracChangeset
for help on using the changeset viewer.