libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libgras_la_LIBADD =
-am__objects_1 = snprintf.lo xbt_str.lo xbt_strbuff.lo ex.lo \
+am__objects_1 = snprintf.lo xbt_str.lo xbt_strbuff.lo xbt_sha.lo ex.lo \
xbt_virtu.lo xbt_os_time.lo asserts.lo log.lo \
xbt_log_appender_file.lo xbt_log_layout_simple.lo \
xbt_log_layout_format.lo mallocator.lo dynar.lo dict.lo \
$(libgras_la_LDFLAGS) $(LDFLAGS) -o $@
libsimgrid_la_LIBADD =
am__libsimgrid_la_SOURCES_DIST = xbt/snprintf.c xbt/xbt_str.c \
- xbt/xbt_strbuff.c xbt/ex.c xbt_modinter.h gras_modinter.h \
- xbt/xbt_virtu.c xbt/xbt_os_time.c xbt/asserts.c xbt/log.c \
- xbt/xbt_log_appender_file.c xbt/xbt_log_layout_simple.c \
- xbt/xbt_log_layout_format.c xbt/mallocator.c xbt/dynar.c \
- xbt/dict.c xbt/dict_elm.c xbt/dict_cursor.c xbt/dict_multi.c \
- xbt/heap.c xbt/fifo.c xbt/swag.c xbt/graph.c xbt/set.c \
- xbt/xbt_matrix.c xbt/xbt_queue.c xbt/xbt_peer.c xbt/xbt_main.c \
- xbt/config.c xbt/cunit.c xbt/graphxml_parse.c surf/maxmin.c \
+ xbt/xbt_strbuff.c xbt/xbt_sha.c xbt/ex.c xbt_modinter.h \
+ gras_modinter.h xbt/xbt_virtu.c xbt/xbt_os_time.c \
+ xbt/asserts.c xbt/log.c xbt/xbt_log_appender_file.c \
+ xbt/xbt_log_layout_simple.c xbt/xbt_log_layout_format.c \
+ xbt/mallocator.c xbt/dynar.c xbt/dict.c xbt/dict_elm.c \
+ xbt/dict_cursor.c xbt/dict_multi.c xbt/heap.c xbt/fifo.c \
+ xbt/swag.c xbt/graph.c xbt/set.c xbt/xbt_matrix.c \
+ xbt/xbt_queue.c xbt/xbt_peer.c xbt/xbt_main.c xbt/config.c \
+ xbt/cunit.c xbt/graphxml_parse.c surf/maxmin.c \
surf/fair_bottleneck.c surf/lagrange.c surf/trace_mgr.c \
surf/random_mgr.c surf/surf.c surf/surfxml_parse.c surf/cpu.c \
surf/network.c surf/network_constant.c surf/workstation.c \
@builddir@/ex_unit.c @builddir@/dynar_unit.c \
@builddir@/dict_unit.c @builddir@/set_unit.c \
@builddir@/swag_unit.c @builddir@/xbt_str_unit.c \
- @builddir@/config_unit.c @builddir@/simgrid_units_main.c
+ @builddir@/xbt_sha_unit.c @builddir@/config_unit.c \
+ @builddir@/simgrid_units_main.c
@GRAMINE_MODE_FALSE@am__objects_21 = cunit_unit.$(OBJEXT) \
@GRAMINE_MODE_FALSE@ ex_unit.$(OBJEXT) dynar_unit.$(OBJEXT) \
@GRAMINE_MODE_FALSE@ dict_unit.$(OBJEXT) set_unit.$(OBJEXT) \
@GRAMINE_MODE_FALSE@ swag_unit.$(OBJEXT) xbt_str_unit.$(OBJEXT) \
+@GRAMINE_MODE_FALSE@ xbt_sha_unit.$(OBJEXT) \
@GRAMINE_MODE_FALSE@ config_unit.$(OBJEXT)
@GRAMINE_MODE_FALSE@am_testall_OBJECTS = $(am__objects_21) \
@GRAMINE_MODE_FALSE@ simgrid_units_main.$(OBJEXT)
################################################
XBT_SRC = \
\
- xbt/snprintf.c xbt/xbt_str.c xbt/xbt_strbuff.c \
+ xbt/snprintf.c xbt/xbt_str.c xbt/xbt_strbuff.c xbt/xbt_sha.c \
xbt/ex.c \
\
xbt_modinter.h gras_modinter.h \
@HAVE_JAVA_TRUE@jar_DATA = simgrid.jar
@GRAMINE_MODE_FALSE@TEST_CFILES = xbt/cunit.c xbt/ex.c \
@GRAMINE_MODE_FALSE@ xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
-@GRAMINE_MODE_FALSE@ xbt/xbt_str.c \
+@GRAMINE_MODE_FALSE@ xbt/xbt_str.c xbt/xbt_sha.c \
@GRAMINE_MODE_FALSE@ xbt/config.c
-@GRAMINE_MODE_FALSE@TEST_UNITS = @builddir@/cunit_unit.c @builddir@/ex_unit.c \
-@GRAMINE_MODE_FALSE@ @builddir@/dynar_unit.c @builddir@/dict_unit.c @builddir@/set_unit.c @builddir@/swag_unit.c \
-@GRAMINE_MODE_FALSE@ @builddir@/xbt_str_unit.c \
+@GRAMINE_MODE_FALSE@TEST_UNITS = @builddir@/cunit_unit.c @builddir@/ex_unit.c \
+@GRAMINE_MODE_FALSE@ @builddir@/dynar_unit.c @builddir@/dict_unit.c @builddir@/set_unit.c @builddir@/swag_unit.c \
+@GRAMINE_MODE_FALSE@ @builddir@/xbt_str_unit.c @builddir@/xbt_sha_unit.c\
@GRAMINE_MODE_FALSE@ @builddir@/config_unit.c
@GRAMINE_MODE_FALSE@BUILT_SOURCES = ../include/surf/simgrid_dtd.h surf/simgrid_dtd.c \
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_stubs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_synchro.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sg_time.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sha.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_sha_unit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_str_unit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbt_strbuff.Plo@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_strbuff.lo `test -f 'xbt/xbt_strbuff.c' || echo '$(srcdir)/'`xbt/xbt_strbuff.c
+xbt_sha.lo: xbt/xbt_sha.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_sha.lo -MD -MP -MF $(DEPDIR)/xbt_sha.Tpo -c -o xbt_sha.lo `test -f 'xbt/xbt_sha.c' || echo '$(srcdir)/'`xbt/xbt_sha.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_sha.Tpo $(DEPDIR)/xbt_sha.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xbt/xbt_sha.c' object='xbt_sha.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_sha.lo `test -f 'xbt/xbt_sha.c' || echo '$(srcdir)/'`xbt/xbt_sha.c
+
ex.lo: xbt/ex.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ex.lo -MD -MP -MF $(DEPDIR)/ex.Tpo -c -o ex.lo `test -f 'xbt/ex.c' || echo '$(srcdir)/'`xbt/ex.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ex.Tpo $(DEPDIR)/ex.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_str_unit.obj `if test -f '@builddir@/xbt_str_unit.c'; then $(CYGPATH_W) '@builddir@/xbt_str_unit.c'; else $(CYGPATH_W) '$(srcdir)/@builddir@/xbt_str_unit.c'; fi`
+xbt_sha_unit.o: @builddir@/xbt_sha_unit.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_sha_unit.o -MD -MP -MF $(DEPDIR)/xbt_sha_unit.Tpo -c -o xbt_sha_unit.o `test -f '@builddir@/xbt_sha_unit.c' || echo '$(srcdir)/'`@builddir@/xbt_sha_unit.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_sha_unit.Tpo $(DEPDIR)/xbt_sha_unit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='@builddir@/xbt_sha_unit.c' object='xbt_sha_unit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_sha_unit.o `test -f '@builddir@/xbt_sha_unit.c' || echo '$(srcdir)/'`@builddir@/xbt_sha_unit.c
+
+xbt_sha_unit.obj: @builddir@/xbt_sha_unit.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xbt_sha_unit.obj -MD -MP -MF $(DEPDIR)/xbt_sha_unit.Tpo -c -o xbt_sha_unit.obj `if test -f '@builddir@/xbt_sha_unit.c'; then $(CYGPATH_W) '@builddir@/xbt_sha_unit.c'; else $(CYGPATH_W) '$(srcdir)/@builddir@/xbt_sha_unit.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/xbt_sha_unit.Tpo $(DEPDIR)/xbt_sha_unit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='@builddir@/xbt_sha_unit.c' object='xbt_sha_unit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xbt_sha_unit.obj `if test -f '@builddir@/xbt_sha_unit.c'; then $(CYGPATH_W) '@builddir@/xbt_sha_unit.c'; else $(CYGPATH_W) '$(srcdir)/@builddir@/xbt_sha_unit.c'; fi`
+
config_unit.o: @builddir@/config_unit.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config_unit.o -MD -MP -MF $(DEPDIR)/config_unit.Tpo -c -o config_unit.o `test -f '@builddir@/config_unit.c' || echo '$(srcdir)/'`@builddir@/config_unit.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/config_unit.Tpo $(DEPDIR)/config_unit.Po
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@ @top_srcdir@/tools/sg_unit_extractor.pl $^
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@@builddir@/xbt_str_unit.c: xbt/xbt_str.c
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@ @top_srcdir@/tools/sg_unit_extractor.pl $^
+@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@@builddir@/xbt_sha_unit.c: xbt/xbt_sha.c
+@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@ @top_srcdir@/tools/sg_unit_extractor.pl $^
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@@builddir@/dynar_unit.c: xbt/dynar.c
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@ @top_srcdir@/tools/sg_unit_extractor.pl $^
@GRAMINE_MODE_FALSE@@MAINTAINER_MODE_TRUE@@builddir@/dict_unit.c: xbt/dict.c
--- /dev/null
+/*******************************/
+/* GENERATED FILE, DO NOT EDIT */
+/*******************************/
+
+#include <stdio.h>
+#include "xbt.h"
+/*******************************/
+/* GENERATED FILE, DO NOT EDIT */
+/*******************************/
+
+# 164 "xbt/xbt_sha.c"
+#include "xbt/hash.h"
+#include "portable.h" /* hexa_str */
+
+static char* mycmp(const char *p1, const char *p2,size_t n) {
+ int i;
+
+ for (i=0; i<n; i++) {
+ if (p1[i] != p2[i]) {
+ return bprintf("Differs on %d -- Ox%x",i,p1[i]);
+ }
+ }
+ return xbt_strdup("");
+}
+
+static void test_sha(const char *clear,const char *hashed) {
+ char hash[41];
+ xbt_sha(clear,hash);
+
+ xbt_test_add1("==== Test with '%s'",clear);
+ xbt_test_assert3(!memcmp(hash, hashed, 40), "Wrong sha: %40s!=%40s (%s)",
+ hash,hashed,mycmp(hash,hashed,40));
+}
+
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(hash,"Tests of various hash functions ");
+
+
+XBT_TEST_UNIT("sha",test_crypto_sha,"Test of the sha algorithm") {
+ /* Empty string as test vector */
+ test_sha("", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
+
+ /* Some pangram as test vector */
+ test_sha("The quick brown fox jumps over the lazy dog", "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12");
+ test_sha("Woven silk pyjamas exchanged for blue quartz","da3aff337c810c6470db4dbf0f205c8afc31c442");
+ test_sha("Pack my box with five dozen liquor jugs", "373ba8be29d4d95708bf7cd43038f4e409dcb439");
+
+}
+/*******************************/
+/* GENERATED FILE, DO NOT EDIT */
+/*******************************/
+