- Merged fixes 1394 and 1395 from trunk to PolarSSL 1.2 branch

diff --git a/library/gcm.c b/library/gcm.c
index 3faaa5d..c91598c 100644
--- a/library/gcm.c
+++ b/library/gcm.c
@@ -148,7 +148,7 @@
 
         if( i != 15 )
         {
-            rem = zl & 0xf;
+            rem = (unsigned char) zl & 0xf;
             zl = ( zh << 60 ) | ( zl >> 4 );
             zh = ( zh >> 4 );
             zh ^= (uint64_t) last4[rem] << 48;
@@ -157,7 +157,7 @@
 
         }
 
-        rem = zl & 0xf;
+        rem = (unsigned char) zl & 0xf;
         zl = ( zh << 60 ) | ( zl >> 4 );
         zh = ( zh >> 4 );
         zh ^= (uint64_t) last4[rem] << 48;