-# $OpenBSD: Makefile,v 1.12 2013/11/04 02:14:56 deraadt Exp $
+# $OpenBSD: Makefile,v 1.13 2014/01/08 04:35:34 deraadt Exp $
.include <bsd.own.mk>
LIB= stubs
NOPROFILE=Yes
NOMAN= 1
-CFLAGS+=-D__DBINTERFACE_PRIVATE -DSHA256_ONLY -UYP -I${LIBCSRCDIR}/include \
+CFLAGS+=-D__DBINTERFACE_PRIVATE -DSHA2_SMALL -UYP -I${LIBCSRCDIR}/include \
-DNO_LOG_BAD_DNS_RESPONSES -I${LIBCSRCDIR}/locale \
-I${LIBCSRCDIR}/gdtoa -I${LIBCSRCDIR}/arch/${MACHINE_CPU}/gdtoa \
-I${LIBCSRCDIR}/stdio -DFLOATING_POINT
-/* $OpenBSD: sha2.c,v 1.15 2013/12/22 22:55:51 tedu Exp $ */
+/* $OpenBSD: sha2.c,v 1.16 2014/01/08 04:35:34 deraadt Exp $ */
/*
* FILE: sha2.c
0x5be0cd19UL
};
-#ifndef SHA256_ONLY
/* Hash constant words K for SHA-384 and SHA-512: */
const static u_int64_t K512[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
};
-/* Initial hash value H for SHA-384 */
-const static u_int64_t sha384_initial_hash_value[8] = {
- 0xcbbb9d5dc1059ed8ULL,
- 0x629a292a367cd507ULL,
- 0x9159015a3070dd17ULL,
- 0x152fecd8f70e5939ULL,
- 0x67332667ffc00b31ULL,
- 0x8eb44a8768581511ULL,
- 0xdb0c2e0d64f98fa7ULL,
- 0x47b5481dbefa4fa4ULL
-};
-
/* Initial hash value H for SHA-512 */
const static u_int64_t sha512_initial_hash_value[8] = {
0x6a09e667f3bcc908ULL,
0x5be0cd19137e2179ULL
};
+#if !defined(SHA2_SMALL)
+/* Initial hash value H for SHA-384 */
+const static u_int64_t sha384_initial_hash_value[8] = {
+ 0xcbbb9d5dc1059ed8ULL,
+ 0x629a292a367cd507ULL,
+ 0x9159015a3070dd17ULL,
+ 0x152fecd8f70e5939ULL,
+ 0x67332667ffc00b31ULL,
+ 0x8eb44a8768581511ULL,
+ 0xdb0c2e0d64f98fa7ULL,
+ 0x47b5481dbefa4fa4ULL
+};
+
/*** SHA-224: *********************************************************/
void
SHA224Init(SHA2_CTX *context)
memset(context, 0, sizeof(*context));
}
}
-#endif /* SHA256_ONLY */
+#endif /* !defined(SHA2_SMALL) */
/*** SHA-256: *********************************************************/
void
}
-#ifndef SHA256_ONLY
/*** SHA-512: *********************************************************/
void
SHA512Init(SHA2_CTX *context)
}
}
+#if !defined(SHA2_SMALL)
/*** SHA-384: *********************************************************/
void
/* Zero out state data */
memset(context, 0, sizeof(*context));
}
-#endif /* SHA256_ONLY */
+#endif /* !defined(SHA2_SMALL) */