aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/sha2.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgcrypto/sha2.h')
-rw-r--r--contrib/pgcrypto/sha2.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/pgcrypto/sha2.h b/contrib/pgcrypto/sha2.h
index 95f8a2400d7..f6fde39c5b4 100644
--- a/contrib/pgcrypto/sha2.h
+++ b/contrib/pgcrypto/sha2.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.h,v 1.3 2006/05/30 12:56:45 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.h,v 1.4 2006/07/13 04:15:25 neilc Exp $ */
/* $OpenBSD: sha2.h,v 1.2 2004/04/28 23:11:57 millert Exp $ */
/*
@@ -49,7 +49,10 @@
#define SHA512_Update pg_SHA512_Update
#define SHA512_Final pg_SHA512_Final
-/*** SHA-256/384/512 Various Length Definitions ***********************/
+/*** SHA-224/256/384/512 Various Length Definitions ***********************/
+#define SHA224_BLOCK_LENGTH 64
+#define SHA224_DIGEST_LENGTH 28
+#define SHA224_DIGEST_STRING_LENGTH (SHA224_DIGEST_LENGTH * 2 + 1)
#define SHA256_BLOCK_LENGTH 64
#define SHA256_DIGEST_LENGTH 32
#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
@@ -75,8 +78,13 @@ typedef struct _SHA512_CTX
uint8 buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
+typedef SHA256_CTX SHA224_CTX;
typedef SHA512_CTX SHA384_CTX;
+void SHA224_Init(SHA224_CTX *);
+void SHA224_Update(SHA224_CTX *, const uint8 *, size_t);
+void SHA224_Final(uint8[SHA224_DIGEST_LENGTH], SHA224_CTX *);
+
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX *, const uint8 *, size_t);
void SHA256_Final(uint8[SHA256_DIGEST_LENGTH], SHA256_CTX *);