"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cipher/rmd160.c" between
libgcrypt-1.9.1.tar.bz2 and libgcrypt-1.9.2.tar.bz2

About: Libgcrypt is a general purpose library of cryptographic building blocks (originally based on GnuPG code).

rmd160.c  (libgcrypt-1.9.1.tar.bz2):rmd160.c  (libgcrypt-1.9.2.tar.bz2)
skipping to change at line 433 skipping to change at line 433
t = lsb; t = lsb;
lsb <<= 3; lsb <<= 3;
msb <<= 3; msb <<= 3;
msb |= t >> 29; msb |= t >> 29;
if (hd->bctx.count < 56) /* enough room */ if (hd->bctx.count < 56) /* enough room */
{ {
hd->bctx.buf[hd->bctx.count++] = 0x80; /* pad */ hd->bctx.buf[hd->bctx.count++] = 0x80; /* pad */
if (hd->bctx.count < 56) if (hd->bctx.count < 56)
memset (&hd->bctx.buf[hd->bctx.count], 0, 56 - hd->bctx.count); memset (&hd->bctx.buf[hd->bctx.count], 0, 56 - hd->bctx.count);
hd->bctx.count = 56;
/* append the 64 bit count */ /* append the 64 bit count */
buf_put_le32(hd->bctx.buf + 56, lsb); buf_put_le32(hd->bctx.buf + 56, lsb);
buf_put_le32(hd->bctx.buf + 60, msb); buf_put_le32(hd->bctx.buf + 60, msb);
burn = transform (hd, hd->bctx.buf, 1); burn = transform (hd, hd->bctx.buf, 1);
} }
else /* need one extra block */ else /* need one extra block */
{ {
hd->bctx.buf[hd->bctx.count++] = 0x80; /* pad character */ hd->bctx.buf[hd->bctx.count++] = 0x80; /* pad character */
/* fill pad and next block with zeroes */ /* fill pad and next block with zeroes */
memset (&hd->bctx.buf[hd->bctx.count], 0, 64 - hd->bctx.count + 56); memset (&hd->bctx.buf[hd->bctx.count], 0, 64 - hd->bctx.count + 56);
hd->bctx.count = 64 + 56;
/* append the 64 bit count */ /* append the 64 bit count */
buf_put_le32(hd->bctx.buf + 64 + 56, lsb); buf_put_le32(hd->bctx.buf + 64 + 56, lsb);
buf_put_le32(hd->bctx.buf + 64 + 60, msb); buf_put_le32(hd->bctx.buf + 64 + 60, msb);
burn = transform (hd, hd->bctx.buf, 2); burn = transform (hd, hd->bctx.buf, 2);
} }
p = hd->bctx.buf; p = hd->bctx.buf;
#define X(a) do { buf_put_le32(p, hd->h##a); p += 4; } while(0) #define X(a) do { buf_put_le32(p, hd->h##a); p += 4; } while(0)
X(0); X(0);
X(1); X(1);
X(2); X(2);
X(3); X(3);
X(4); X(4);
#undef X #undef X
hd->bctx.count = 0;
_gcry_burn_stack (burn); _gcry_burn_stack (burn);
} }
static byte * static byte *
rmd160_read( void *context ) rmd160_read( void *context )
{ {
RMD160_CONTEXT *hd = context; RMD160_CONTEXT *hd = context;
return hd->bctx.buf; return hd->bctx.buf;
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)