diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-01-02 19:07:24 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-01-02 19:07:24 +0200 |
commit | d7c7453cf5e6b8f3c6b522a30e680f844a28c9de (patch) | |
tree | 129aea22ee00bc4530c99d2c2c44a7861ff1f6ec /cipher/rmd160.c | |
parent | 8eabecc883332156adffc1df42d27f614c157e06 (diff) | |
download | libgcrypt-d7c7453cf5e6b8f3c6b522a30e680f844a28c9de.tar.gz |
rmd160: restore native-endian store in _gcry_rmd160_mixblock
* cipher/rmd160.c (_gcry_rmd160_mixblock): Store result to buffer in
native-endianess.
--
Commit 4515315f61fbf79413e150fbd1d5f5a2435f2bc5 unintendedly changed this
native-endian store to little-endian.
Reported-by: Yuriy Kaminskiy <yumkam@gmail.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/rmd160.c')
-rw-r--r-- | cipher/rmd160.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cipher/rmd160.c b/cipher/rmd160.c index 2b1f3213..2695db29 100644 --- a/cipher/rmd160.c +++ b/cipher/rmd160.c @@ -403,15 +403,16 @@ transform ( void *c, const unsigned char *data, size_t nblks ) * Apply the rmd160 transform function on the buffer which must have * a length 64 bytes. Do not use this function together with the * other functions, use rmd160_init to initialize internal variables. - * Returns: 16 bytes in buffer with the mixed contentes of buffer. + * Buffer must be 32-bit aligned. + * Returns: 20 bytes in buffer with the mixed contents of buffer. */ void _gcry_rmd160_mixblock ( RMD160_CONTEXT *hd, void *blockof64byte ) { - char *p = blockof64byte; + u32 *p = blockof64byte; transform ( hd, blockof64byte, 1 ); -#define X(a) do { buf_put_le32(p, hd->h##a); p += 4; } while(0) +#define X(a) do { p[a] = hd->h##a; } while(0) X(0); X(1); X(2); |