[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-144-gc2e1f8f

Yuriy Kaminskiy yumkam at gmail.com
Fri Jan 2 16:46:00 CET 2015


by Jussi Kivilinna wrote:
> commit 4515315f61fbf79413e150fbd1d5f5a2435f2bc5
> Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
> Date:   Tue Dec 23 13:01:33 2014 +0200
> 
>     hash: fix compiler warning on ARM
>     
>     * cipher/md.c (md_open, md_copy): Cast 'char *' to ctx through
>     'void *'.
>     * cipher/md4.c (md4_final): Use buf_put_* helper instead of
>     converting 'char *' to 'u32 *'.
>     * cipher/md5.c (md5_final): Ditto.
>     * cipher/rmd160.c (_gcry_rmd160_mixblock, rmd160_final): Ditto.
>     * cipher/sha1.c (sha1_final): Ditto.
>     * cipher/sha256.c (sha256_final): Ditto.
>     * cipher/sha512.c (sha512_final): Ditto.
>     * cipher/tiger.c (tiger_final): Ditto.
>     --
>     
>     Patch fixes 'cast increases required alignment' warnings seen on GCC:
>     
...
>     
>     Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
> 
[...]
> diff --git a/cipher/rmd160.c b/cipher/rmd160.c
> index e6d02f5..2b1f321 100644
> --- a/cipher/rmd160.c
> +++ b/cipher/rmd160.c
> @@ -411,7 +411,7 @@ _gcry_rmd160_mixblock ( RMD160_CONTEXT *hd, void *blockof64byte )
>    char *p = blockof64byte;
>  
>    transform ( hd, blockof64byte, 1 );
> -#define X(a) do { *(u32*)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(1);
>    X(2);

Note that this commit changes result of this function on BE arches (it was
stored as "native-endian integer" before, it is stored as "little-endian
integer" now). This function is only used in random-csprng.c, so there should be
no practical consequences (except it is a tiny bit slower on BE arches now).




More information about the Gcrypt-devel mailing list