The test case name SHA 1 is misleading, as there exists a SHA-1 algorithm
On Fri, Nov 14, 2014 at 8:46 AM, Sebastian Huber
sebastian.hu...@embedded-brains.de wrote:
---
cpukit/Makefile.am| 2 -
cpukit/libmd/Makefile.am | 13 +-
cpukit/libmd/preinstall.am| 30
cpukit/libmd/sha256.h | 50 ++
cpukit/libmd/sha256c.c| 297 +++
cpukit/libmd/sha512.h | 50 ++
cpukit/libmd/sha512c.c| 320
++
cpukit/preinstall.am | 8 -
testsuites/libtests/Makefile.am | 1 +
testsuites/libtests/configure.ac | 1 +
testsuites/libtests/sha01/Makefile.am | 19 ++
testsuites/libtests/sha01/init.c | 191
testsuites/libtests/sha01/sha01.doc | 17 ++
testsuites/libtests/sha01/sha01.scn | 16 ++
14 files changed, 1003 insertions(+), 12 deletions(-)
create mode 100644 cpukit/libmd/sha256.h
create mode 100644 cpukit/libmd/sha256c.c
create mode 100644 cpukit/libmd/sha512.h
create mode 100644 cpukit/libmd/sha512c.c
create mode 100644 testsuites/libtests/sha01/Makefile.am
create mode 100644 testsuites/libtests/sha01/init.c
create mode 100644 testsuites/libtests/sha01/sha01.doc
create mode 100644 testsuites/libtests/sha01/sha01.scn
diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 8f99983..51cec69 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -47,8 +47,6 @@ include_sysdir = $(includedir)/sys
include_sys_HEADERS =
include_HEADERS += include/memory.h
-include_HEADERS += libmd/md4.h
-include_HEADERS += libmd/md5.h
include_sys_HEADERS += libcsupport/include/sys/ioccom.h
include_sys_HEADERS += libcsupport/include/sys/event.h
diff --git a/cpukit/libmd/Makefile.am b/cpukit/libmd/Makefile.am
index f1eb021..95b12da 100644
--- a/cpukit/libmd/Makefile.am
+++ b/cpukit/libmd/Makefile.am
@@ -1,9 +1,18 @@
include $(top_srcdir)/automake/compile.am
if NEWLIB
+include_HEADERS =
+include_HEADERS += md4.h
+include_HEADERS += md5.h
+include_HEADERS += sha256.h
+include_HEADERS += sha512.h
+
noinst_LIBRARIES = libmd.a
-libmd_a_SOURCES = md5.h md5.c
-libmd_a_SOURCES += md4.h md4.c
+libmd_a_SOURCES =
+libmd_a_SOURCES += md4.c
+libmd_a_SOURCES += md5.c
+libmd_a_SOURCES += sha256c.c
+libmd_a_SOURCES += sha512c.c
libmd_a_CPPFLAGS = $(AM_CPPFLAGS)
endif
diff --git a/cpukit/libmd/preinstall.am b/cpukit/libmd/preinstall.am
index dba6cc4..9edfb3d 100644
--- a/cpukit/libmd/preinstall.am
+++ b/cpukit/libmd/preinstall.am
@@ -5,3 +5,33 @@ $(srcdir)/preinstall.am: Makefile.am
$(AMPOLISH3) $(srcdir)/Makefile.am $(srcdir)/preinstall.am
endif
+PREINSTALL_DIRS =
+DISTCLEANFILES = $(PREINSTALL_DIRS)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES = $(PREINSTALL_FILES)
+
+$(PROJECT_INCLUDE)/$(dirstamp):
+ @$(MKDIR_P) $(PROJECT_INCLUDE)
+ @: $(PROJECT_INCLUDE)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
+
+if NEWLIB
+$(PROJECT_INCLUDE)/md4.h: md4.h $(PROJECT_INCLUDE)/$(dirstamp)
+ $(INSTALL_DATA) $ $(PROJECT_INCLUDE)/md4.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/md4.h
+
+$(PROJECT_INCLUDE)/md5.h: md5.h $(PROJECT_INCLUDE)/$(dirstamp)
+ $(INSTALL_DATA) $ $(PROJECT_INCLUDE)/md5.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/md5.h
+
+$(PROJECT_INCLUDE)/sha256.h: sha256.h $(PROJECT_INCLUDE)/$(dirstamp)
+ $(INSTALL_DATA) $ $(PROJECT_INCLUDE)/sha256.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/sha256.h
+
+$(PROJECT_INCLUDE)/sha512.h: sha512.h $(PROJECT_INCLUDE)/$(dirstamp)
+ $(INSTALL_DATA) $ $(PROJECT_INCLUDE)/sha512.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/sha512.h
+endif
diff --git a/cpukit/libmd/sha256.h b/cpukit/libmd/sha256.h
new file mode 100644
index 000..1b6a4f4
--- /dev/null
+++ b/cpukit/libmd/sha256.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright 2005 Colin Percival
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES