gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/gl


From: gsasl-commit
Subject: CVS gsasl/lib/gl
Date: Sun, 23 Oct 2005 16:49:14 +0200

Update of /home/cvs/gsasl/lib/gl
In directory dopio:/tmp/cvs-serv20709/lib/gl

Modified Files:
        md5.c md5.h 
Log Message:
Update.

--- /home/cvs/gsasl/lib/gl/md5.c        2005/10/12 00:36:50     1.2
+++ /home/cvs/gsasl/lib/gl/md5.c        2005/10/23 14:49:14     1.3
@@ -116,12 +116,12 @@
     ++ctx->total[1];
 
   pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
-  memcpy (&ctx->buffer[bytes], fillbuf, pad);
+  memcpy (&((char*)ctx->buffer)[bytes], fillbuf, pad);
 
   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
-  *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
-  *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
-                                                       (ctx->total[0] >> 29));
+  ctx->buffer[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3);
+  ctx->buffer[(bytes + pad) / 4 + 1] = SWAP ((ctx->total[1] << 3) |
+                                            (ctx->total[0] >> 29));
 
   /* Process last bytes.  */
   md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
@@ -225,7 +225,7 @@
       size_t left_over = ctx->buflen;
       size_t add = 128 - left_over > len ? len : 128 - left_over;
 
-      memcpy (&ctx->buffer[left_over], buffer, add);
+      memcpy (&((char*)ctx->buffer)[left_over], buffer, add);
       ctx->buflen += add;
 
       if (ctx->buflen > 64)
@@ -234,7 +234,7 @@
 
          ctx->buflen &= 63;
          /* The regions in the following copy operation cannot overlap.  */
-         memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
+         memcpy (ctx->buffer, &((char*)ctx->buffer)[(left_over + add) & ~63],
                  ctx->buflen);
        }
 
@@ -275,13 +275,13 @@
     {
       size_t left_over = ctx->buflen;
 
-      memcpy (&ctx->buffer[left_over], buffer, len);
+      memcpy (&((char*)ctx->buffer)[left_over], buffer, len);
       left_over += len;
       if (left_over >= 64)
        {
          md5_process_block (ctx->buffer, 64, ctx);
          left_over -= 64;
-         memcpy (ctx->buffer, &ctx->buffer[64], left_over);
+         memcpy (ctx->buffer, &ctx->buffer[16], left_over);
        }
       ctx->buflen = left_over;
     }
--- /home/cvs/gsasl/lib/gl/md5.h        2005/10/12 00:36:50     1.2
+++ /home/cvs/gsasl/lib/gl/md5.h        2005/10/23 14:49:14     1.3
@@ -70,7 +70,7 @@
 
   uint32_t total[2];
   uint32_t buflen;
-  char buffer[128] __attribute__ ((__aligned__ (__alignof__ (uint32_t))));
+  uint32_t buffer[32];
 };
 
 /*





reply via email to

[Prev in Thread] Current Thread [Next in Thread]