Do only one call to GetVersionEx in the common case.
[pspp] / lib / gc-libgcrypt.c
index bec7b76f5a4ba5dd9d24979f52aeb74198ce4031..8ba42fbd5374fe2dc7103796aa003f813042009c 100644 (file)
@@ -1,5 +1,6 @@
 /* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC.
- * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008  Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
+ * Software Foundation, Inc.
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -294,6 +295,10 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
       gcryalg = GCRY_MD_SHA512;
       break;
 
+    case GC_SHA224:
+      gcryalg = GCRY_MD_SHA224;
+      break;
+
     case GC_RMD160:
       gcryalg = GCRY_MD_RMD160;
       break;
@@ -393,6 +398,10 @@ gc_hash_digest_length (Gc_hash hash)
       len = GC_SHA512_DIGEST_SIZE;
       break;
 
+    case GC_SHA224:
+      len = GC_SHA224_DIGEST_SIZE;
+      break;
+
     default:
       return 0;
     }
@@ -508,6 +517,12 @@ gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *resbuf)
       break;
 #endif
 
+#ifdef GNULIB_GC_SHA224
+    case GC_SHA224:
+      gcryalg = GCRY_MD_SHA224;
+      break;
+#endif
+
 #ifdef GNULIB_GC_RMD160
     case GC_RMD160:
       gcryalg = GCRY_MD_RMD160;