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: Wed, 30 Nov 2005 16:22:49 +0100

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

Modified Files:
        gc-gnulib.c gc-libgcrypt.c gc.h md5.c stdint_.h 
Log Message:
Sync gnulib.

--- /home/cvs/gsasl/lib/gl/gc-gnulib.c  2005/10/23 12:18:21     1.8
+++ /home/cvs/gsasl/lib/gl/gc-gnulib.c  2005/11/30 15:22:49     1.9
@@ -38,6 +38,9 @@
 #include <errno.h>
 
 /* Hashes. */
+#ifdef GC_USE_MD2
+# include "md2.h"
+#endif
 #ifdef GC_USE_MD4
 # include "md4.h"
 #endif
@@ -189,6 +192,8 @@
   Gc_rc rc = GC_OK;
 
   ctx = calloc (sizeof (*ctx), 1);
+  if (!ctx)
+    return GC_MALLOC_ERROR;
 
   ctx->alg = alg;
   ctx->mode = mode;
@@ -543,12 +548,15 @@
   Gc_hash alg;
   Gc_hash_mode mode;
   char hash[MAX_DIGEST_SIZE];
-#ifdef GC_USE_MD5
-  struct md5_ctx md5Context;
+#ifdef GC_USE_MD2
+  struct md2_ctx md2Context;
 #endif
 #ifdef GC_USE_MD4
   struct md4_ctx md4Context;
 #endif
+#ifdef GC_USE_MD5
+  struct md5_ctx md5Context;
+#endif
 #ifdef GC_USE_SHA1
   struct sha1_ctx sha1Context;
 #endif
@@ -567,6 +575,12 @@
 
   switch (hash)
     {
+#ifdef GC_USE_MD2
+    case GC_MD2:
+      md2_init_ctx (&ctx->md2Context);
+      break;
+#endif
+
 #ifdef GC_USE_MD4
     case GC_MD4:
       md4_init_ctx (&ctx->md4Context);
@@ -605,7 +619,7 @@
   else
     free (ctx);
 
-  return GC_OK;
+  return rc;
 }
 
 Gc_rc
@@ -613,7 +627,6 @@
 {
   _gc_hash_ctx *in = handle;
   _gc_hash_ctx *out;
-  Gc_rc rc = GC_OK;
 
   *outhandle = out = calloc (sizeof (*out), 1);
   if (!out)
@@ -631,6 +644,10 @@
 
   switch (hash)
     {
+    case GC_MD2:
+      len = GC_MD2_DIGEST_SIZE;
+      break;
+
     case GC_MD4:
       len = GC_MD4_DIGEST_SIZE;
       break;
@@ -639,6 +656,10 @@
       len = GC_MD5_DIGEST_SIZE;
       break;
 
+    case GC_RMD160:
+      len = GC_RMD160_DIGEST_SIZE;
+      break;
+
     case GC_SHA1:
       len = GC_SHA1_DIGEST_SIZE;
       break;
@@ -654,10 +675,15 @@
 gc_hash_write (gc_hash_handle handle, size_t len, const char *data)
 {
   _gc_hash_ctx *ctx = handle;
-  Gc_rc rc = GC_OK;
 
   switch (ctx->alg)
     {
+#ifdef GC_USE_MD2
+    case GC_MD2:
+      md2_process_bytes (data, len, &ctx->md2Context);
+      break;
+#endif
+
 #ifdef GC_USE_MD4
     case GC_MD4:
       md4_process_bytes (data, len, &ctx->md4Context);
@@ -686,10 +712,16 @@
 {
   _gc_hash_ctx *ctx = handle;
   const char *ret = NULL;
-  Gc_rc rc;
 
   switch (ctx->alg)
     {
+#ifdef GC_USE_MD2
+    case GC_MD2:
+      md2_finish_ctx (&ctx->md2Context, ctx->hash);
+      ret = ctx->hash;
+      break;
+#endif
+
 #ifdef GC_USE_MD4
     case GC_MD4:
       md4_finish_ctx (&ctx->md4Context, ctx->hash);
@@ -731,6 +763,12 @@
 {
   switch (hash)
     {
+#ifdef GC_USE_MD2
+    case GC_MD2:
+      md2_buffer (in, inlen, resbuf);
+      break;
+#endif
+
 #ifdef GC_USE_MD4
     case GC_MD4:
       md4_buffer (in, inlen, resbuf);
@@ -756,6 +794,15 @@
   return GC_OK;
 }
 
+#ifdef GC_USE_MD2
+Gc_rc
+gc_md2 (const void *in, size_t inlen, void *resbuf)
+{
+  md2_buffer (in, inlen, resbuf);
+  return GC_OK;
+}
+#endif
+
 #ifdef GC_USE_MD4
 Gc_rc
 gc_md4 (const void *in, size_t inlen, void *resbuf)
--- /home/cvs/gsasl/lib/gl/gc-libgcrypt.c       2005/10/23 12:18:21     1.6
+++ /home/cvs/gsasl/lib/gl/gc-libgcrypt.c       2005/11/30 15:22:49     1.7
@@ -27,8 +27,14 @@
 /* Get prototype. */
 #include "gc.h"
 
+#include <stdlib.h>
+#include <string.h>
+
 /* Get libgcrypt API. */
 #include <gcrypt.h>
+#ifdef GC_USE_MD2
+# include "md2.h"
+#endif
 
 #include <assert.h>
 
@@ -218,14 +224,37 @@
 
 /* Hashes. */
 
+typedef struct _gc_hash_ctx {
+  Gc_hash alg;
+  Gc_hash_mode mode;
+  gcry_md_hd_t gch;
+#ifdef GC_USE_MD2
+  char hash[GC_MD2_DIGEST_SIZE];
+  struct md2_ctx md2Context;
+#endif
+} _gc_hash_ctx;
+
 Gc_rc
 gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
 {
+  _gc_hash_ctx *ctx;
   int gcryalg, gcrymode;
   gcry_error_t err;
+  Gc_rc rc = GC_OK;
+
+  ctx = calloc (sizeof (*ctx), 1);
+  if (!ctx)
+    return GC_MALLOC_ERROR;
+
+  ctx->alg = hash;
+  ctx->mode = mode;
 
   switch (hash)
     {
+    case GC_MD2:
+      gcryalg = GCRY_MD_NONE;
+      break;
+
     case GC_MD4:
       gcryalg = GCRY_MD_MD4;
       break;
@@ -243,7 +272,7 @@
       break;
 
     default:
-      return GC_INVALID_HASH;
+      rc = GC_INVALID_HASH;
     }
 
   switch (mode)
@@ -257,24 +286,43 @@
       break;
 
     default:
-      return GC_INVALID_HASH;
+      rc = GC_INVALID_HASH;
     }
 
-  err = gcry_md_open ((gcry_md_hd_t *) outhandle, gcryalg, gcrymode);
-  if (gcry_err_code (err))
-    return GC_INVALID_HASH;
+  if (rc == GC_OK && gcryalg != GCRY_MD_NONE)
+    {
+      err = gcry_md_open (&ctx->gch, gcryalg, gcrymode);
+      if (gcry_err_code (err))
+       rc = GC_INVALID_HASH;
+    }
 
-  return GC_OK;
+  if (rc == GC_OK)
+    *outhandle = ctx;
+  else
+    free (ctx);
+
+  return rc;
 }
 
 Gc_rc
 gc_hash_clone (gc_hash_handle handle, gc_hash_handle * outhandle)
 {
+  _gc_hash_ctx *in = handle;
+  _gc_hash_ctx *out;
   int err;
 
-  err = gcry_md_copy ((gcry_md_hd_t *) outhandle, (gcry_md_hd_t) handle);
+  *outhandle = out = calloc (sizeof (*out), 1);
+  if (!out)
+    return GC_MALLOC_ERROR;
+
+  memcpy (out, in, sizeof (*out));
+
+  err = gcry_md_copy (&out->gch, in->gch);
   if (err)
-    return GC_INVALID_HASH;
+    {
+      free (out);
+      return GC_INVALID_HASH;
+    }
 
   return GC_OK;
 }
@@ -282,52 +330,78 @@
 size_t
 gc_hash_digest_length (Gc_hash hash)
 {
-  int gcryalg;
+  size_t len;
 
   switch (hash)
     {
+    case GC_MD2:
+      len = GC_MD2_DIGEST_SIZE;
+      break;
+
     case GC_MD4:
-      gcryalg = GCRY_MD_MD4;
+      len = GC_MD4_DIGEST_SIZE;
       break;
 
     case GC_MD5:
-      gcryalg = GCRY_MD_MD5;
+      len = GC_MD5_DIGEST_SIZE;
       break;
 
-    case GC_SHA1:
-      gcryalg = GCRY_MD_SHA1;
+    case GC_RMD160:
+      len = GC_RMD160_DIGEST_SIZE;
       break;
 
-    case GC_RMD160:
-      gcryalg = GCRY_MD_RMD160;
+    case GC_SHA1:
+      len = GC_SHA1_DIGEST_SIZE;
       break;
 
     default:
       return 0;
     }
 
-  return gcry_md_get_algo_dlen (gcryalg);
+  return len;
 }
 
 void
 gc_hash_hmac_setkey (gc_hash_handle handle, size_t len, const char *key)
 {
-  gcry_md_setkey ((gcry_md_hd_t) handle, key, len);
+  _gc_hash_ctx *ctx = handle;
+#ifdef GC_USE_MD2
+  if (ctx->alg != GC_MD2)
+#endif
+    gcry_md_setkey (ctx->gch, key, len);
 }
 
 void
 gc_hash_write (gc_hash_handle handle, size_t len, const char *data)
 {
-  gcry_md_write ((gcry_md_hd_t) handle, data, len);
+  _gc_hash_ctx *ctx = handle;
+
+#ifdef GC_USE_MD2
+  if (ctx->alg == GC_MD2)
+    md2_process_bytes (data, len, &ctx->md2Context);
+  else
+#endif
+    gcry_md_write (ctx->gch, data, len);
 }
 
 const char *
 gc_hash_read (gc_hash_handle handle)
 {
+  _gc_hash_ctx *ctx = handle;
   const char *digest;
 
-  gcry_md_final ((gcry_md_hd_t) handle);
-  digest = gcry_md_read ((gcry_md_hd_t) handle, 0);
+#ifdef GC_USE_MD2
+  if (ctx->alg == GC_MD2)
+    {
+      md2_finish_ctx (&ctx->md2Context, ctx->hash);
+      digest = ctx->hash;
+    }
+  else
+#endif
+    {
+      gcry_md_final (ctx->gch);
+      digest = gcry_md_read (ctx->gch, 0);
+    }
 
   return digest;
 }
@@ -335,7 +409,14 @@
 void
 gc_hash_close (gc_hash_handle handle)
 {
-  gcry_md_close ((gcry_md_hd_t) handle);
+  _gc_hash_ctx *ctx = handle;
+
+#ifdef GC_USE_MD2
+  if (ctx->alg != GC_MD2)
+#endif
+    gcry_md_close (ctx->gch);
+
+  free (ctx);
 }
 
 Gc_rc
@@ -345,6 +426,13 @@
 
   switch (hash)
     {
+#ifdef GC_USE_MD2
+    case GC_MD2:
+      md2_buffer (in, inlen, resbuf);
+      return GC_OK;
+      break;
+#endif
+
 #ifdef GC_USE_MD4
     case GC_MD4:
       gcryalg = GCRY_MD_MD4;
@@ -380,6 +468,15 @@
 
 /* One-call interface. */
 
+#ifdef GC_USE_MD2
+Gc_rc
+gc_md2 (const void *in, size_t inlen, void *resbuf)
+{
+  md2_buffer (in, inlen, resbuf);
+  return GC_OK;
+}
+#endif
+
 #ifdef GC_USE_MD4
 Gc_rc
 gc_md4 (const void *in, size_t inlen, void *resbuf)
--- /home/cvs/gsasl/lib/gl/gc.h 2005/10/23 12:18:21     1.5
+++ /home/cvs/gsasl/lib/gl/gc.h 2005/11/30 15:22:49     1.6
@@ -57,8 +57,10 @@
 
 typedef void *gc_hash_handle;
 
+#define GC_MD2_DIGEST_SIZE 16
 #define GC_MD4_DIGEST_SIZE 16
 #define GC_MD5_DIGEST_SIZE 16
+#define GC_RMD160_DIGEST_SIZE 20
 #define GC_SHA1_DIGEST_SIZE 20
 
 /* Cipher types. */
@@ -141,6 +143,8 @@
 gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *out);
 
 /* One-call interface. */
+extern Gc_rc gc_md2 (const void *in, size_t inlen, void *resbuf);
+extern Gc_rc gc_md4 (const void *in, size_t inlen, void *resbuf);
 extern Gc_rc gc_md5 (const void *in, size_t inlen, void *resbuf);
 extern Gc_rc gc_sha1 (const void *in, size_t inlen, void *resbuf);
 extern Gc_rc gc_hmac_md5 (const void *key, size_t keylen,
--- /home/cvs/gsasl/lib/gl/md5.c        2005/10/23 14:49:14     1.3
+++ /home/cvs/gsasl/lib/gl/md5.c        2005/11/30 15:22:49     1.4
@@ -108,23 +108,21 @@
 {
   /* Take yet unprocessed bytes into account.  */
   uint32_t bytes = ctx->buflen;
-  size_t pad;
+  size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4;
 
   /* Now count remaining bytes.  */
   ctx->total[0] += bytes;
   if (ctx->total[0] < bytes)
     ++ctx->total[1];
 
-  pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
-  memcpy (&((char*)ctx->buffer)[bytes], fillbuf, pad);
-
   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
-  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));
+  ctx->buffer[size - 2] = SWAP (ctx->total[0] << 3);
+  ctx->buffer[size - 1] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
+
+  memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes);
 
   /* Process last bytes.  */
-  md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
+  md5_process_block (ctx->buffer, size * 4, ctx);
 
   return md5_read_ctx (ctx, resbuf);
 }
@@ -146,8 +144,8 @@
   while (1)
     {
       /* We read the file in blocks of BLOCKSIZE bytes.  One call of the
-        computation function processes the whole buffer so that with the
-        next round of the loop another block can be read.  */
+         computation function processes the whole buffer so that with the
+         next round of the loop another block can be read.  */
       size_t n;
       sum = 0;
 
@@ -164,8 +162,8 @@
          if (n == 0)
            {
              /* Check for the error flag IFF N == 0, so that we don't
-                exit the loop after a partial read due to e.g., EAGAIN
-                or EWOULDBLOCK.  */
+                exit the loop after a partial read due to e.g., EAGAIN
+                or EWOULDBLOCK.  */
              if (ferror (stream))
                return 1;
              goto process_partial_block;
@@ -179,12 +177,12 @@
        }
 
       /* Process buffer with BLOCKSIZE bytes.  Note that
-                       BLOCKSIZE % 64 == 0
+         BLOCKSIZE % 64 == 0
        */
       md5_process_block (buffer, BLOCKSIZE, &ctx);
     }
 
- process_partial_block:;
+process_partial_block:
 
   /* Process any remaining bytes.  */
   if (sum > 0)
@@ -225,7 +223,7 @@
       size_t left_over = ctx->buflen;
       size_t add = 128 - left_over > len ? len : 128 - left_over;
 
-      memcpy (&((char*)ctx->buffer)[left_over], buffer, add);
+      memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
       ctx->buflen += add;
 
       if (ctx->buflen > 64)
@@ -234,7 +232,8 @@
 
          ctx->buflen &= 63;
          /* The regions in the following copy operation cannot overlap.  */
-         memcpy (ctx->buffer, &((char*)ctx->buffer)[(left_over + add) & ~63],
+         memcpy (ctx->buffer,
+                 &((char *) ctx->buffer)[(left_over + add) & ~63],
                  ctx->buflen);
        }
 
@@ -275,7 +274,7 @@
     {
       size_t left_over = ctx->buflen;
 
-      memcpy (&((char*)ctx->buffer)[left_over], buffer, len);
+      memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
       left_over += len;
       if (left_over >= 64)
        {
@@ -330,11 +329,11 @@
       uint32_t D_save = D;
 
       /* First round: using the given function, the context and a constant
-        the next context is computed.  Because the algorithms processing
-        unit is a 32-bit word and it is determined to work on words in
-        little endian byte order we perhaps have to change the byte order
-        before the computation.  To reduce the work for the next steps
-        we store the swapped words in the array CORRECT_WORDS.  */
+         the next context is computed.  Because the algorithms processing
+         unit is a 32-bit word and it is determined to work on words in
+         little endian byte order we perhaps have to change the byte order
+         before the computation.  To reduce the work for the next steps
+         we store the swapped words in the array CORRECT_WORDS.  */
 
 #define OP(a, b, c, d, s, T)                                           \
       do                                                               \
@@ -347,40 +346,40 @@
       while (0)
 
       /* It is unfortunate that C does not provide an operator for
-        cyclic rotation.  Hope the C compiler is smart enough.  */
+         cyclic rotation.  Hope the C compiler is smart enough.  */
 #define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
 
       /* Before we start, one word to the strange constants.
-        They are defined in RFC 1321 as
+         They are defined in RFC 1321 as
 
-        T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
+         T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
 
-        Here is an equivalent invocation using Perl:
+         Here is an equivalent invocation using Perl:
 
-        perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin 
$_))}'
+         perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin 
$_))}'
        */
 
       /* Round 1.  */
-      OP (A, B, C, D,  7, 0xd76aa478);
+      OP (A, B, C, D, 7, 0xd76aa478);
       OP (D, A, B, C, 12, 0xe8c7b756);
       OP (C, D, A, B, 17, 0x242070db);
       OP (B, C, D, A, 22, 0xc1bdceee);
-      OP (A, B, C, D,  7, 0xf57c0faf);
+      OP (A, B, C, D, 7, 0xf57c0faf);
       OP (D, A, B, C, 12, 0x4787c62a);
       OP (C, D, A, B, 17, 0xa8304613);
       OP (B, C, D, A, 22, 0xfd469501);
-      OP (A, B, C, D,  7, 0x698098d8);
+      OP (A, B, C, D, 7, 0x698098d8);
       OP (D, A, B, C, 12, 0x8b44f7af);
       OP (C, D, A, B, 17, 0xffff5bb1);
       OP (B, C, D, A, 22, 0x895cd7be);
-      OP (A, B, C, D,  7, 0x6b901122);
+      OP (A, B, C, D, 7, 0x6b901122);
       OP (D, A, B, C, 12, 0xfd987193);
       OP (C, D, A, B, 17, 0xa679438e);
       OP (B, C, D, A, 22, 0x49b40821);
 
       /* For the second to fourth round we have the possibly swapped words
-        in CORRECT_WORDS.  Redefine the macro to take an additional first
-        argument specifying the function to use.  */
+         in CORRECT_WORDS.  Redefine the macro to take an additional first
+         argument specifying the function to use.  */
 #undef OP
 #define OP(f, a, b, c, d, k, s, T)                                     \
       do                                                               \
@@ -392,58 +391,58 @@
       while (0)
 
       /* Round 2.  */
-      OP (FG, A, B, C, D,  1,  5, 0xf61e2562);
-      OP (FG, D, A, B, C,  6,  9, 0xc040b340);
+      OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
+      OP (FG, D, A, B, C, 6, 9, 0xc040b340);
       OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
-      OP (FG, B, C, D, A,  0, 20, 0xe9b6c7aa);
-      OP (FG, A, B, C, D,  5,  5, 0xd62f105d);
-      OP (FG, D, A, B, C, 10,  9, 0x02441453);
+      OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
+      OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
+      OP (FG, D, A, B, C, 10, 9, 0x02441453);
       OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
-      OP (FG, B, C, D, A,  4, 20, 0xe7d3fbc8);
-      OP (FG, A, B, C, D,  9,  5, 0x21e1cde6);
-      OP (FG, D, A, B, C, 14,  9, 0xc33707d6);
-      OP (FG, C, D, A, B,  3, 14, 0xf4d50d87);
-      OP (FG, B, C, D, A,  8, 20, 0x455a14ed);
-      OP (FG, A, B, C, D, 13,  5, 0xa9e3e905);
-      OP (FG, D, A, B, C,  2,  9, 0xfcefa3f8);
-      OP (FG, C, D, A, B,  7, 14, 0x676f02d9);
+      OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
+      OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
+      OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
+      OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
+      OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
+      OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
+      OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
+      OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
       OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
 
       /* Round 3.  */
-      OP (FH, A, B, C, D,  5,  4, 0xfffa3942);
-      OP (FH, D, A, B, C,  8, 11, 0x8771f681);
+      OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
+      OP (FH, D, A, B, C, 8, 11, 0x8771f681);
       OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
       OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
-      OP (FH, A, B, C, D,  1,  4, 0xa4beea44);
-      OP (FH, D, A, B, C,  4, 11, 0x4bdecfa9);
-      OP (FH, C, D, A, B,  7, 16, 0xf6bb4b60);
+      OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
+      OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
+      OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
       OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
-      OP (FH, A, B, C, D, 13,  4, 0x289b7ec6);
-      OP (FH, D, A, B, C,  0, 11, 0xeaa127fa);
-      OP (FH, C, D, A, B,  3, 16, 0xd4ef3085);
-      OP (FH, B, C, D, A,  6, 23, 0x04881d05);
-      OP (FH, A, B, C, D,  9,  4, 0xd9d4d039);
+      OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
+      OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
+      OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
+      OP (FH, B, C, D, A, 6, 23, 0x04881d05);
+      OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
       OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
       OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
-      OP (FH, B, C, D, A,  2, 23, 0xc4ac5665);
+      OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
 
       /* Round 4.  */
-      OP (FI, A, B, C, D,  0,  6, 0xf4292244);
-      OP (FI, D, A, B, C,  7, 10, 0x432aff97);
+      OP (FI, A, B, C, D, 0, 6, 0xf4292244);
+      OP (FI, D, A, B, C, 7, 10, 0x432aff97);
       OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
-      OP (FI, B, C, D, A,  5, 21, 0xfc93a039);
-      OP (FI, A, B, C, D, 12,  6, 0x655b59c3);
-      OP (FI, D, A, B, C,  3, 10, 0x8f0ccc92);
+      OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
+      OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
+      OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
       OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
-      OP (FI, B, C, D, A,  1, 21, 0x85845dd1);
-      OP (FI, A, B, C, D,  8,  6, 0x6fa87e4f);
+      OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
+      OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
       OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
-      OP (FI, C, D, A, B,  6, 15, 0xa3014314);
+      OP (FI, C, D, A, B, 6, 15, 0xa3014314);
       OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
-      OP (FI, A, B, C, D,  4,  6, 0xf7537e82);
+      OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
       OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
-      OP (FI, C, D, A, B,  2, 15, 0x2ad7d2bb);
-      OP (FI, B, C, D, A,  9, 21, 0xeb86d391);
+      OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
+      OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
 
       /* Add the starting values of the context.  */
       A += A_save;
--- /home/cvs/gsasl/lib/gl/stdint_.h    2005/10/12 01:24:26     1.1
+++ /home/cvs/gsasl/lib/gl/stdint_.h    2005/11/30 15:22:49     1.2
@@ -133,11 +133,19 @@
 /* 7.18.1.5. Greatest-width integer types */
 
 #ifdef _STDINT_H_HAVE_INT64
+# ifndef intmax_t
 typedef int64_t  intmax_t;
+# endif
+# ifndef uintmax_t
 typedef uint64_t uintmax_t;
+# endif
 #else
+# ifndef intmax_t
 typedef int32_t  intmax_t;
+# endif
+# ifndef uintmax_t
 typedef uint32_t uintmax_t;
+# endif
 #endif
 
 /* 7.18.2. Limits of specified-width integer types */
@@ -230,7 +238,9 @@
 #define SIG_ATOMIC_MIN 0
 #define SIG_ATOMIC_MAX 127
 
-#define SIZE_MAX (~(size_t)0)
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
 
 /* wchar_t limits already defined in <stddef.h>.  */
 /* wint_t limits already defined in <wchar.h>.  */





reply via email to

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