summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2009-04-15 00:55:52 +0000
committerdjm <djm@openbsd.org>2009-04-15 00:55:52 +0000
commit84dba1d79e688e85c833bba63c6dbf7d851f1fde (patch)
treef0cc3c7663ba5cd38731937f8376ec167c4962ed /lib/libc
parentbuild release sets before kernels (so that bsd.rd can know about at least (diff)
downloadwireguard-openbsd-84dba1d79e688e85c833bba63c6dbf7d851f1fde.tar.xz
wireguard-openbsd-84dba1d79e688e85c833bba63c6dbf7d851f1fde.zip
allow building without SHA384 and SHA512 (i.e. SHA256 only) with
-DSHA256_ONLY in order to save space; ok deraadt@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/hash/sha2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/hash/sha2.c b/lib/libc/hash/sha2.c
index 3494d5c6ed6..c6d2d46b17b 100644
--- a/lib/libc/hash/sha2.c
+++ b/lib/libc/hash/sha2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha2.c,v 1.12 2008/09/06 12:00:19 djm Exp $ */
+/* $OpenBSD: sha2.c,v 1.13 2009/04/15 00:55:52 djm Exp $ */
/*
* FILE: sha2.c
@@ -201,6 +201,7 @@ const static u_int32_t sha256_initial_hash_value[8] = {
0x5be0cd19UL
};
+#ifndef SHA256_ONLY
/* Hash constant words K for SHA-384 and SHA-512: */
const static u_int64_t K512[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
@@ -268,7 +269,7 @@ const static u_int64_t sha512_initial_hash_value[8] = {
0x1f83d9abfb41bd6bULL,
0x5be0cd19137e2179ULL
};
-
+#endif /* SHA256_ONLY */
/*** SHA-256: *********************************************************/
void
@@ -550,6 +551,7 @@ SHA256Final(u_int8_t digest[SHA256_DIGEST_LENGTH], SHA2_CTX *context)
}
+#ifndef SHA256_ONLY
/*** SHA-512: *********************************************************/
void
SHA512Init(SHA2_CTX *context)
@@ -868,3 +870,4 @@ SHA384Final(u_int8_t digest[SHA384_DIGEST_LENGTH], SHA2_CTX *context)
/* Zero out state data */
memset(context, 0, sizeof(*context));
}
+#endif /* SHA256_ONLY */