Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc/hash/sha2 no need for the local defs of he e...
details: https://anonhg.NetBSD.org/src/rev/817430edc71c
branches: trunk
changeset: 787298:817430edc71c
user: christos <christos%NetBSD.org@localhost>
date: Sun Jun 09 19:46:56 2013 +0000
description:
no need for the local defs of he enc functions; compat_defs.h provides them.
diffstat:
common/lib/libc/hash/sha2/sha2.c | 31 +++++--------------------------
1 files changed, 5 insertions(+), 26 deletions(-)
diffs (59 lines):
diff -r f45573cd7687 -r 817430edc71c common/lib/libc/hash/sha2/sha2.c
--- a/common/lib/libc/hash/sha2/sha2.c Sun Jun 09 18:54:05 2013 +0000
+++ b/common/lib/libc/hash/sha2/sha2.c Sun Jun 09 19:46:56 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sha2.c,v 1.23 2013/06/09 02:58:58 christos Exp $ */
+/* $NetBSD: sha2.c,v 1.24 2013/06/09 19:46:56 christos Exp $ */
/* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */
/*
@@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.23 2013/06/09 02:58:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sha2.c,v 1.24 2013/06/09 19:46:56 christos Exp $");
#include <sys/param.h> /* XXX: to pull <machine/macros.h> for vax memset(9) */
#include <lib/libkern/libkern.h>
@@ -51,7 +51,7 @@
#else
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: sha2.c,v 1.23 2013/06/09 02:58:58 christos Exp $");
+__RCSID("$NetBSD: sha2.c,v 1.24 2013/06/09 19:46:56 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -62,29 +62,8 @@
#include <sys/types.h>
#include <sys/sha2.h>
-#if HAVE_NBTOOL_CONFIG_H
-# if HAVE_SYS_ENDIAN_H
-# include <sys/endian.h>
-# else
-# undef be32dec
-# undef be64dec
-
-static __inline uint32_t __unused
-be32dec(const void *buf)
-{
- const uint8_t *p = __CAST(const uint8_t *, buf);
-
- return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
-}
-
-static __inline uint64_t __unused
-be64dec(const void *buf)
-{
- const uint8_t *p = (const uint8_t *)buf;
-
- return ((__CAST(uint64_t, be32dec(p)) << 32) | be32dec(p + 4));
-}
-# endif
+#if HAVE_SYS_ENDIAN_H
+# include <sys/endian.h>
#endif
/*** SHA-256/384/512 Various Length Definitions ***********************/
Home |
Main Index |
Thread Index |
Old Index