From 7e68abda362fce76e91631973d062fd7c8ff5e4e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 29 Mar 2001 10:01:44 +0000 Subject: Fixed the bug in the hash code --- cipher/tiger.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'cipher/tiger.c') diff --git a/cipher/tiger.c b/cipher/tiger.c index e68959ca..7152492e 100644 --- a/cipher/tiger.c +++ b/cipher/tiger.c @@ -805,18 +805,19 @@ tiger_final( TIGER_CONTEXT *hd ) tiger_write(hd, NULL, 0); /* flush */; - msb = 0; t = hd->nblocks; - if( (lsb = t << 6) < t ) /* multiply by 64 to make a byte count */ - msb++; - msb += t >> 26; + /* multiply by 64 to make a byte count */ + lsb = t << 6; + msb = t >> 26; + /* add the count */ t = lsb; - if( (lsb = t + hd->count) < t ) /* add the count */ + if( (lsb += hd->count) < t ) msb++; + /* multiply by 8 to make a bit count */ t = lsb; - if( (lsb = t << 3) < t ) /* multiply by 8 to make a bit count */ - msb++; - msb += t >> 29; + lsb <<= 3; + msb <<= 3; + msb |= t >> 29; if( hd->count < 56 ) { /* enough room */ hd->buf[hd->count++] = 0x01; /* pad */ @@ -904,7 +905,7 @@ tiger_get_info( int algo, size_t *contextsize, *(void (**)(TIGER_CONTEXT *))r_final = tiger_final; *(byte *(**)(TIGER_CONTEXT *))r_read = tiger_read; - return "TIGER"; + return "TIGER192"; } -- cgit v1.2.1