[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-349-gd1cadd1

by Jussi Kivilinna cvs at cvs.gnupg.org
Wed Oct 30 08:34:13 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, master has been updated
       via  d1cadd145199040299538891ab2ccd1208f7776e (commit)
      from  ba6bffafd17bea11985afc500022d66da261d59a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d1cadd145199040299538891ab2ccd1208f7776e
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date:   Wed Oct 30 08:57:15 2013 +0200

    bithelp: fix undefined behaviour with rol and ror
    
    * cipher/bithelp.h (rol, ror): Mask shift with 31.
    --
    
    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>

diff --git a/cipher/bithelp.h b/cipher/bithelp.h
index 601ecac..418bdf5 100644
--- a/cipher/bithelp.h
+++ b/cipher/bithelp.h
@@ -26,14 +26,14 @@
 /****************
  * Rotate the 32 bit unsigned integer X by N bits left/right
  */
-static inline u32 rol( u32 x, int n)
+static inline u32 rol(u32 x, int n)
 {
-	return ( (x << n) | (x >> (32-n)) );
+	return ( (x << (n&(32-1))) | (x >> ((32-n)&(32-1))) );
 }
 
 static inline u32 ror(u32 x, int n)
 {
-	return ( (x >> n) | (x << (32-n)) );
+	return ( (x >> (n&(32-1))) | (x << ((32-n)&(32-1))) );
 }
 
 /* Byte swap for 32-bit and 64-bit integers.  If available, use compiler

-----------------------------------------------------------------------

Summary of changes:
 cipher/bithelp.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits




More information about the Gcrypt-devel mailing list