summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authormottelet <stephane.mottelet@utc.fr>2020-07-07 10:30:17 +0200
committerClément David <clement.david@esi-group.com>2021-04-02 10:03:28 +0200
commit556b75cc2dd90f669823bfc065f2cb3698e270ce (patch)
tree4107fddd3e9092365c5eb992f6513abff011fae1 /scilab/modules
parented33e3e3c6ab6795758a31cd6fa6750982f24053 (diff)
downloadscilab-556b75cc2dd90f669823bfc065f2cb3698e270ce.zip
scilab-556b75cc2dd90f669823bfc065f2cb3698e270ce.tar.gz
[core] allow scilab to use more secure hash functions
http://bugzilla.scilab.org/show_bug.cgi?id=4648 Introducing hash() function, see proposed help page at http://bugzilla.scilab.org/attachment.cgi?id=5157 Change-Id: I825a4361ae81530e1257f1d9187c76ceee285729
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/core/Makefile.am15
-rw-r--r--scilab/modules/core/Makefile.in165
-rw-r--r--scilab/modules/core/includes/core_gw.hxx1
-rw-r--r--scilab/modules/core/includes/md5.h106
-rw-r--r--scilab/modules/core/license.txt35
-rw-r--r--scilab/modules/core/sci_gateway/cpp/core_gw.cpp1
-rw-r--r--scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj20
-rw-r--r--scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters36
-rw-r--r--scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp26
-rw-r--r--scilab/modules/core/sci_gateway/cpp/sci_hash.cpp195
-rw-r--r--scilab/modules/core/src/c/core.vcxproj10
-rw-r--r--scilab/modules/core/src/c/core.vcxproj.filters6
-rw-r--r--scilab/modules/core/src/c/md5.c451
-rw-r--r--scilab/modules/core/src/cpp/hash/LICENSE.txt10
-rw-r--r--scilab/modules/core/src/cpp/hash/crc32.cpp425
-rw-r--r--scilab/modules/core/src/cpp/hash/crc32.hxx69
-rw-r--r--scilab/modules/core/src/cpp/hash/hash.hxx36
-rw-r--r--scilab/modules/core/src/cpp/hash/md5.cpp375
-rw-r--r--scilab/modules/core/src/cpp/hash/md5.hxx78
-rw-r--r--scilab/modules/core/src/cpp/hash/readme.md51
-rw-r--r--scilab/modules/core/src/cpp/hash/sha1.cpp320
-rw-r--r--scilab/modules/core/src/cpp/hash/sha1.hxx78
-rw-r--r--scilab/modules/core/src/cpp/hash/sha256.cpp405
-rw-r--r--scilab/modules/core/src/cpp/hash/sha256.hxx78
-rw-r--r--scilab/modules/core/src/cpp/hash/sha3.cpp283
-rw-r--r--scilab/modules/core/src/cpp/hash/sha3.hxx81
-rw-r--r--scilab/modules/core/src/cpp/md5_file.cpp45
-rw-r--r--scilab/modules/core/tests/unit_tests/hash.tst83
-rw-r--r--scilab/modules/fileio/help/en_US/hash.xml106
-rw-r--r--scilab/modules/fileio/help/ru_RU/hash.xml117
-rw-r--r--scilab/modules/io/sci_gateway/cpp/sci_genlib.cpp3
31 files changed, 3102 insertions, 608 deletions
diff --git a/scilab/modules/core/Makefile.am b/scilab/modules/core/Makefile.am
index a7bb22f..d22227f 100644
--- a/scilab/modules/core/Makefile.am
+++ b/scilab/modules/core/Makefile.am
@@ -14,7 +14,6 @@
14CORE_C_SOURCES = \ 14CORE_C_SOURCES = \
15 src/c/csignal.c \ 15 src/c/csignal.c \
16 src/c/resizesignal.c \ 16 src/c/resizesignal.c \
17 src/c/md5.c \
18 src/c/getmodules.c \ 17 src/c/getmodules.c \
19 src/c/getmemory.c \ 18 src/c/getmemory.c \
20 src/c/isanan.c \ 19 src/c/isanan.c \
@@ -55,10 +54,18 @@ CORE_CPP_SOURCES = \
55 src/cpp/getmacrosname.cpp \ 54 src/cpp/getmacrosname.cpp \
56 src/cpp/getfunctionsname.cpp \ 55 src/cpp/getfunctionsname.cpp \
57 src/cpp/InitScilab.cpp \ 56 src/cpp/InitScilab.cpp \
57 src/cpp/md5_file.cpp \
58 src/cpp/parsecommand.cpp \ 58 src/cpp/parsecommand.cpp \
59 src/cpp/pause.cpp \ 59 src/cpp/pause.cpp \
60 src/cpp/setformat.cpp 60 src/cpp/setformat.cpp
61 61
62HASH_CPP_SOURCES = \
63 src/cpp/hash/md5.cpp \
64 src/cpp/hash/crc32.cpp \
65 src/cpp/hash/sha1.cpp \
66 src/cpp/hash/sha256.cpp \
67 src/cpp/hash/sha3.cpp
68
62CORE_FORTRAN_SOURCES = \ 69CORE_FORTRAN_SOURCES = \
63 src/fortran/clunit.f \ 70 src/fortran/clunit.f \
64 src/fortran/folhp.f \ 71 src/fortran/folhp.f \
@@ -128,7 +135,8 @@ GATEWAY_CPP_SOURCES = \
128 sci_gateway/cpp/sci_isfield.cpp \ 135 sci_gateway/cpp/sci_isfield.cpp \
129 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \ 136 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \
130 sci_gateway/cpp/sci_fieldnames.cpp \ 137 sci_gateway/cpp/sci_fieldnames.cpp \
131 sci_gateway/cpp/sci_checkNamedArguments.cpp 138 sci_gateway/cpp/sci_checkNamedArguments.cpp \
139 sci_gateway/cpp/sci_hash.cpp
132 140
133if ENABLE_DEBUG 141if ENABLE_DEBUG
134GATEWAY_CPP_SOURCES += \ 142GATEWAY_CPP_SOURCES += \
@@ -145,6 +153,7 @@ libscicore_la_CPPFLAGS = \
145 -I$(srcdir)/includes/ \ 153 -I$(srcdir)/includes/ \
146 -I$(srcdir)/src/c/ \ 154 -I$(srcdir)/src/c/ \
147 -I$(srcdir)/src/cpp/ \ 155 -I$(srcdir)/src/cpp/ \
156 -I$(srcdir)/src/cpp/hash \
148 -I$(top_srcdir)/modules/ast/includes/ast/ \ 157 -I$(top_srcdir)/modules/ast/includes/ast/ \
149 -I$(top_srcdir)/modules/ast/includes/exps/ \ 158 -I$(top_srcdir)/modules/ast/includes/exps/ \
150 -I$(top_srcdir)/modules/ast/includes/operations/ \ 159 -I$(top_srcdir)/modules/ast/includes/operations/ \
@@ -203,7 +212,7 @@ libscicore_la_LDFLAGS = $(AM_LDFLAGS)
203CHECK_SRC= $(CORE_C_SOURCES) $(GATEWAY_C_SOURCES) 212CHECK_SRC= $(CORE_C_SOURCES) $(GATEWAY_C_SOURCES)
204INCLUDE_FLAGS = $(libscicore_la_CPPFLAGS) 213INCLUDE_FLAGS = $(libscicore_la_CPPFLAGS)
205 214
206libscicore_algo_la_SOURCES = $(CORE_C_SOURCES) $(CORE_CPP_SOURCES) $(CORE_FORTRAN_SOURCES) 215libscicore_algo_la_SOURCES = $(CORE_C_SOURCES) $(CORE_CPP_SOURCES) $(HASH_CPP_SOURCES) $(CORE_FORTRAN_SOURCES)
207libscicore_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) 216libscicore_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)
208libscicore_algo_la_CPPFLAGS = $(libscicore_la_CPPFLAGS) 217libscicore_algo_la_CPPFLAGS = $(libscicore_la_CPPFLAGS)
209 218
diff --git a/scilab/modules/core/Makefile.in b/scilab/modules/core/Makefile.in
index aba7ac2..0eb9e4b 100644
--- a/scilab/modules/core/Makefile.in
+++ b/scilab/modules/core/Makefile.in
@@ -1,7 +1,7 @@
1# Makefile.in generated by automake 1.16.1 from Makefile.am. 1# Makefile.in generated by automake 1.16.3 from Makefile.am.
2# @configure_input@ 2# @configure_input@
3 3
4# Copyright (C) 1994-2018 Free Software Foundation, Inc. 4# Copyright (C) 1994-2020 Free Software Foundation, Inc.
5 5
6# This Makefile.in is free software; the Free Software Foundation 6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -201,7 +201,6 @@ libscicore_algo_la_LIBADD =
201am__dirstamp = $(am__leading_dot)dirstamp 201am__dirstamp = $(am__leading_dot)dirstamp
202am__objects_1 = src/c/libscicore_algo_la-csignal.lo \ 202am__objects_1 = src/c/libscicore_algo_la-csignal.lo \
203 src/c/libscicore_algo_la-resizesignal.lo \ 203 src/c/libscicore_algo_la-resizesignal.lo \
204 src/c/libscicore_algo_la-md5.lo \
205 src/c/libscicore_algo_la-getmodules.lo \ 204 src/c/libscicore_algo_la-getmodules.lo \
206 src/c/libscicore_algo_la-getmemory.lo \ 205 src/c/libscicore_algo_la-getmemory.lo \
207 src/c/libscicore_algo_la-isanan.lo \ 206 src/c/libscicore_algo_la-isanan.lo \
@@ -240,16 +239,22 @@ am__objects_2 = src/cpp/libscicore_algo_la-demangle.lo \
240 src/cpp/libscicore_algo_la-getmacrosname.lo \ 239 src/cpp/libscicore_algo_la-getmacrosname.lo \
241 src/cpp/libscicore_algo_la-getfunctionsname.lo \ 240 src/cpp/libscicore_algo_la-getfunctionsname.lo \
242 src/cpp/libscicore_algo_la-InitScilab.lo \ 241 src/cpp/libscicore_algo_la-InitScilab.lo \
242 src/cpp/libscicore_algo_la-md5_file.lo \
243 src/cpp/libscicore_algo_la-parsecommand.lo \ 243 src/cpp/libscicore_algo_la-parsecommand.lo \
244 src/cpp/libscicore_algo_la-pause.lo \ 244 src/cpp/libscicore_algo_la-pause.lo \
245 src/cpp/libscicore_algo_la-setformat.lo 245 src/cpp/libscicore_algo_la-setformat.lo
246am__objects_3 = src/fortran/clunit.lo src/fortran/folhp.lo \ 246am__objects_3 = src/cpp/hash/libscicore_algo_la-md5.lo \
247 src/cpp/hash/libscicore_algo_la-crc32.lo \
248 src/cpp/hash/libscicore_algo_la-sha1.lo \
249 src/cpp/hash/libscicore_algo_la-sha256.lo \
250 src/cpp/hash/libscicore_algo_la-sha3.lo
251am__objects_4 = src/fortran/clunit.lo src/fortran/folhp.lo \
247 src/fortran/xerbla.lo src/fortran/expsum.lo \ 252 src/fortran/xerbla.lo src/fortran/expsum.lo \
248 src/fortran/readinter.lo src/fortran/rewindinter.lo \ 253 src/fortran/readinter.lo src/fortran/rewindinter.lo \
249 src/fortran/backspaceinter.lo src/fortran/write_inter.lo \ 254 src/fortran/backspaceinter.lo src/fortran/write_inter.lo \
250 src/fortran/read_inter.lo 255 src/fortran/read_inter.lo
251am_libscicore_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ 256am_libscicore_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
252 $(am__objects_3) 257 $(am__objects_3) $(am__objects_4)
253libscicore_algo_la_OBJECTS = $(am_libscicore_algo_la_OBJECTS) 258libscicore_algo_la_OBJECTS = $(am_libscicore_algo_la_OBJECTS)
254AM_V_lt = $(am__v_lt_@AM_V@) 259AM_V_lt = $(am__v_lt_@AM_V@)
255am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) 260am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -297,6 +302,7 @@ am__libscicore_la_SOURCES_DIST = sci_gateway/c/sci_getdebuginfo.c \
297 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \ 302 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \
298 sci_gateway/cpp/sci_fieldnames.cpp \ 303 sci_gateway/cpp/sci_fieldnames.cpp \
299 sci_gateway/cpp/sci_checkNamedArguments.cpp \ 304 sci_gateway/cpp/sci_checkNamedArguments.cpp \
305 sci_gateway/cpp/sci_hash.cpp \
300 sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp \ 306 sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp \
301 sci_gateway/cpp/sci_inspectorGetItem.cpp \ 307 sci_gateway/cpp/sci_inspectorGetItem.cpp \
302 sci_gateway/cpp/sci_inspectorGetItemCount.cpp \ 308 sci_gateway/cpp/sci_inspectorGetItemCount.cpp \
@@ -304,15 +310,15 @@ am__libscicore_la_SOURCES_DIST = sci_gateway/c/sci_getdebuginfo.c \
304 sci_gateway/cpp/sci_inspectorShowItem.cpp \ 310 sci_gateway/cpp/sci_inspectorShowItem.cpp \
305 sci_gateway/cpp/sci_inspectorShowUnreferencedItem.cpp \ 311 sci_gateway/cpp/sci_inspectorShowUnreferencedItem.cpp \
306 sci_gateway/cpp/sci_inspectorGetFunctionList.cpp 312 sci_gateway/cpp/sci_inspectorGetFunctionList.cpp
307am__objects_4 = sci_gateway/c/libscicore_la-sci_getdebuginfo.lo 313am__objects_5 = sci_gateway/c/libscicore_la-sci_getdebuginfo.lo
308@ENABLE_DEBUG_TRUE@am__objects_5 = sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo \ 314@ENABLE_DEBUG_TRUE@am__objects_6 = sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo \
309@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetItem.lo \ 315@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetItem.lo \
310@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetItemCount.lo \ 316@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetItemCount.lo \
311@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetUnreferencedItem.lo \ 317@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetUnreferencedItem.lo \
312@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorShowItem.lo \ 318@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorShowItem.lo \
313@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorShowUnreferencedItem.lo \ 319@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorShowUnreferencedItem.lo \
314@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetFunctionList.lo 320@ENABLE_DEBUG_TRUE@ sci_gateway/cpp/libscicore_la-sci_inspectorGetFunctionList.lo
315am__objects_6 = sci_gateway/cpp/libscicore_la-core_gw.lo \ 321am__objects_7 = sci_gateway/cpp/libscicore_la-core_gw.lo \
316 sci_gateway/cpp/libscicore_la-sci_getmodules.lo \ 322 sci_gateway/cpp/libscicore_la-sci_getmodules.lo \
317 sci_gateway/cpp/libscicore_la-sci_clear.lo \ 323 sci_gateway/cpp/libscicore_la-sci_clear.lo \
318 sci_gateway/cpp/libscicore_la-sci_clearfun.lo \ 324 sci_gateway/cpp/libscicore_la-sci_clearfun.lo \
@@ -367,8 +373,8 @@ am__objects_6 = sci_gateway/cpp/libscicore_la-core_gw.lo \
367 sci_gateway/cpp/libscicore_la-sci_oldEmptyBehaviour.lo \ 373 sci_gateway/cpp/libscicore_la-sci_oldEmptyBehaviour.lo \
368 sci_gateway/cpp/libscicore_la-sci_fieldnames.lo \ 374 sci_gateway/cpp/libscicore_la-sci_fieldnames.lo \
369 sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo \ 375 sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo \
370 $(am__objects_5) 376 sci_gateway/cpp/libscicore_la-sci_hash.lo $(am__objects_6)
371am_libscicore_la_OBJECTS = $(am__objects_4) $(am__objects_6) 377am_libscicore_la_OBJECTS = $(am__objects_5) $(am__objects_7)
372libscicore_la_OBJECTS = $(am_libscicore_la_OBJECTS) 378libscicore_la_OBJECTS = $(am_libscicore_la_OBJECTS)
373libscicore_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ 379libscicore_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
374 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ 380 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
@@ -419,6 +425,7 @@ am__depfiles_remade = \
419 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo \ 425 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo \
420 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo \ 426 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo \
421 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo \ 427 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo \
428 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Plo \
422 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo \ 429 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo \
423 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo \ 430 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo \
424 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo \ 431 sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo \
@@ -473,7 +480,6 @@ am__depfiles_remade = \
473 src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo \ 480 src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo \
474 src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo \ 481 src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo \
475 src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo \ 482 src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo \
476 src/c/$(DEPDIR)/libscicore_algo_la-md5.Plo \
477 src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo \ 483 src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo \
478 src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo \ 484 src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo \
479 src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo \ 485 src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo \
@@ -492,13 +498,19 @@ am__depfiles_remade = \
492 src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo \ 498 src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo \
493 src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo \ 499 src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo \
494 src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo \ 500 src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo \
501 src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Plo \
495 src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo \ 502 src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo \
496 src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo \ 503 src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo \
497 src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo \ 504 src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo \
498 src/cpp/$(DEPDIR)/libscicore_algo_la-setformat.Plo \ 505 src/cpp/$(DEPDIR)/libscicore_algo_la-setformat.Plo \
499 src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo \ 506 src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo \
500 src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo \ 507 src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo \
501 src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo 508 src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo \
509 src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Plo \
510 src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Plo \
511 src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Plo \
512 src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Plo \
513 src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Plo
502am__mv = mv -f 514am__mv = mv -f
503COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 515COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
504 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 516 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -727,8 +739,8 @@ MKDIR_P = @MKDIR_P@
727MPI_ENABLE = @MPI_ENABLE@ 739MPI_ENABLE = @MPI_ENABLE@
728MSGCAT = @MSGCAT@ 740MSGCAT = @MSGCAT@
729MSGFMT = @MSGFMT@ 741MSGFMT = @MSGFMT@
730MSGFMT_015 = @MSGFMT_015@
731MSGMERGE = @MSGMERGE@ 742MSGMERGE = @MSGMERGE@
743MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
732NM = @NM@ 744NM = @NM@
733NMEDIT = @NMEDIT@ 745NMEDIT = @NMEDIT@
734OBJDUMP = @OBJDUMP@ 746OBJDUMP = @OBJDUMP@
@@ -880,7 +892,6 @@ yacc_present = @yacc_present@
880CORE_C_SOURCES = \ 892CORE_C_SOURCES = \
881 src/c/csignal.c \ 893 src/c/csignal.c \
882 src/c/resizesignal.c \ 894 src/c/resizesignal.c \
883 src/c/md5.c \
884 src/c/getmodules.c \ 895 src/c/getmodules.c \
885 src/c/getmemory.c \ 896 src/c/getmemory.c \
886 src/c/isanan.c \ 897 src/c/isanan.c \
@@ -921,10 +932,18 @@ CORE_CPP_SOURCES = \
921 src/cpp/getmacrosname.cpp \ 932 src/cpp/getmacrosname.cpp \
922 src/cpp/getfunctionsname.cpp \ 933 src/cpp/getfunctionsname.cpp \
923 src/cpp/InitScilab.cpp \ 934 src/cpp/InitScilab.cpp \
935 src/cpp/md5_file.cpp \
924 src/cpp/parsecommand.cpp \ 936 src/cpp/parsecommand.cpp \
925 src/cpp/pause.cpp \ 937 src/cpp/pause.cpp \
926 src/cpp/setformat.cpp 938 src/cpp/setformat.cpp
927 939
940HASH_CPP_SOURCES = \
941 src/cpp/hash/md5.cpp \
942 src/cpp/hash/crc32.cpp \
943 src/cpp/hash/sha1.cpp \
944 src/cpp/hash/sha256.cpp \
945 src/cpp/hash/sha3.cpp
946
928CORE_FORTRAN_SOURCES = \ 947CORE_FORTRAN_SOURCES = \
929 src/fortran/clunit.f \ 948 src/fortran/clunit.f \
930 src/fortran/folhp.f \ 949 src/fortran/folhp.f \
@@ -975,9 +994,11 @@ GATEWAY_CPP_SOURCES = sci_gateway/cpp/core_gw.cpp \
975 sci_gateway/cpp/sci_mlist.cpp sci_gateway/cpp/sci_isfield.cpp \ 994 sci_gateway/cpp/sci_mlist.cpp sci_gateway/cpp/sci_isfield.cpp \
976 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \ 995 sci_gateway/cpp/sci_oldEmptyBehaviour.cpp \
977 sci_gateway/cpp/sci_fieldnames.cpp \ 996 sci_gateway/cpp/sci_fieldnames.cpp \
978 sci_gateway/cpp/sci_checkNamedArguments.cpp $(am__append_1) 997 sci_gateway/cpp/sci_checkNamedArguments.cpp \
998 sci_gateway/cpp/sci_hash.cpp $(am__append_1)
979libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \ 999libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
980 -I$(srcdir)/src/cpp/ -I$(top_srcdir)/modules/ast/includes/ast/ \ 1000 -I$(srcdir)/src/cpp/ -I$(srcdir)/src/cpp/hash \
1001 -I$(top_srcdir)/modules/ast/includes/ast/ \
981 -I$(top_srcdir)/modules/ast/includes/exps/ \ 1002 -I$(top_srcdir)/modules/ast/includes/exps/ \
982 -I$(top_srcdir)/modules/ast/includes/operations/ \ 1003 -I$(top_srcdir)/modules/ast/includes/operations/ \
983 -I$(top_srcdir)/modules/ast/includes/parse/ \ 1004 -I$(top_srcdir)/modules/ast/includes/parse/ \
@@ -1020,7 +1041,7 @@ libscicore_la_LDFLAGS = $(AM_LDFLAGS)
1020# For the code check (splint) 1041# For the code check (splint)
1021CHECK_SRC = $(CORE_C_SOURCES) $(GATEWAY_C_SOURCES) 1042CHECK_SRC = $(CORE_C_SOURCES) $(GATEWAY_C_SOURCES)
1022INCLUDE_FLAGS = $(libscicore_la_CPPFLAGS) 1043INCLUDE_FLAGS = $(libscicore_la_CPPFLAGS)
1023libscicore_algo_la_SOURCES = $(CORE_C_SOURCES) $(CORE_CPP_SOURCES) $(CORE_FORTRAN_SOURCES) 1044libscicore_algo_la_SOURCES = $(CORE_C_SOURCES) $(CORE_CPP_SOURCES) $(HASH_CPP_SOURCES) $(CORE_FORTRAN_SOURCES)
1024libscicore_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) 1045libscicore_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)
1025libscicore_algo_la_CPPFLAGS = $(libscicore_la_CPPFLAGS) 1046libscicore_algo_la_CPPFLAGS = $(libscicore_la_CPPFLAGS)
1026 1047
@@ -1232,8 +1253,6 @@ src/c/libscicore_algo_la-csignal.lo: src/c/$(am__dirstamp) \
1232 src/c/$(DEPDIR)/$(am__dirstamp) 1253 src/c/$(DEPDIR)/$(am__dirstamp)
1233src/c/libscicore_algo_la-resizesignal.lo: src/c/$(am__dirstamp) \ 1254src/c/libscicore_algo_la-resizesignal.lo: src/c/$(am__dirstamp) \
1234 src/c/$(DEPDIR)/$(am__dirstamp) 1255 src/c/$(DEPDIR)/$(am__dirstamp)
1235src/c/libscicore_algo_la-md5.lo: src/c/$(am__dirstamp) \
1236 src/c/$(DEPDIR)/$(am__dirstamp)
1237src/c/libscicore_algo_la-getmodules.lo: src/c/$(am__dirstamp) \ 1256src/c/libscicore_algo_la-getmodules.lo: src/c/$(am__dirstamp) \
1238 src/c/$(DEPDIR)/$(am__dirstamp) 1257 src/c/$(DEPDIR)/$(am__dirstamp)
1239src/c/libscicore_algo_la-getmemory.lo: src/c/$(am__dirstamp) \ 1258src/c/libscicore_algo_la-getmemory.lo: src/c/$(am__dirstamp) \
@@ -1324,12 +1343,32 @@ src/cpp/libscicore_algo_la-getfunctionsname.lo: \
1324 src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp) 1343 src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
1325src/cpp/libscicore_algo_la-InitScilab.lo: src/cpp/$(am__dirstamp) \ 1344src/cpp/libscicore_algo_la-InitScilab.lo: src/cpp/$(am__dirstamp) \
1326 src/cpp/$(DEPDIR)/$(am__dirstamp) 1345 src/cpp/$(DEPDIR)/$(am__dirstamp)
1346src/cpp/libscicore_algo_la-md5_file.lo: src/cpp/$(am__dirstamp) \
1347 src/cpp/$(DEPDIR)/$(am__dirstamp)
1327src/cpp/libscicore_algo_la-parsecommand.lo: src/cpp/$(am__dirstamp) \ 1348src/cpp/libscicore_algo_la-parsecommand.lo: src/cpp/$(am__dirstamp) \
1328 src/cpp/$(DEPDIR)/$(am__dirstamp) 1349 src/cpp/$(DEPDIR)/$(am__dirstamp)
1329src/cpp/libscicore_algo_la-pause.lo: src/cpp/$(am__dirstamp) \ 1350src/cpp/libscicore_algo_la-pause.lo: src/cpp/$(am__dirstamp) \
1330 src/cpp/$(DEPDIR)/$(am__dirstamp) 1351 src/cpp/$(DEPDIR)/$(am__dirstamp)
1331src/cpp/libscicore_algo_la-setformat.lo: src/cpp/$(am__dirstamp) \ 1352src/cpp/libscicore_algo_la-setformat.lo: src/cpp/$(am__dirstamp) \
1332 src/cpp/$(DEPDIR)/$(am__dirstamp) 1353 src/cpp/$(DEPDIR)/$(am__dirstamp)
1354src/cpp/hash/$(am__dirstamp):
1355 @$(MKDIR_P) src/cpp/hash
1356 @: > src/cpp/hash/$(am__dirstamp)
1357src/cpp/hash/$(DEPDIR)/$(am__dirstamp):
1358 @$(MKDIR_P) src/cpp/hash/$(DEPDIR)
1359 @: > src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1360src/cpp/hash/libscicore_algo_la-md5.lo: src/cpp/hash/$(am__dirstamp) \
1361 src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1362src/cpp/hash/libscicore_algo_la-crc32.lo: \
1363 src/cpp/hash/$(am__dirstamp) \
1364 src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1365src/cpp/hash/libscicore_algo_la-sha1.lo: src/cpp/hash/$(am__dirstamp) \
1366 src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1367src/cpp/hash/libscicore_algo_la-sha256.lo: \
1368 src/cpp/hash/$(am__dirstamp) \
1369 src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1370src/cpp/hash/libscicore_algo_la-sha3.lo: src/cpp/hash/$(am__dirstamp) \
1371 src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
1333src/fortran/$(am__dirstamp): 1372src/fortran/$(am__dirstamp):
1334 @$(MKDIR_P) src/fortran 1373 @$(MKDIR_P) src/fortran
1335 @: > src/fortran/$(am__dirstamp) 1374 @: > src/fortran/$(am__dirstamp)
@@ -1537,6 +1576,9 @@ sci_gateway/cpp/libscicore_la-sci_fieldnames.lo: \
1537sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo: \ 1576sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo: \
1538 sci_gateway/cpp/$(am__dirstamp) \ 1577 sci_gateway/cpp/$(am__dirstamp) \
1539 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp) 1578 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
1579sci_gateway/cpp/libscicore_la-sci_hash.lo: \
1580 sci_gateway/cpp/$(am__dirstamp) \
1581 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
1540sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo: \ 1582sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo: \
1541 sci_gateway/cpp/$(am__dirstamp) \ 1583 sci_gateway/cpp/$(am__dirstamp) \
1542 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp) 1584 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1574,6 +1616,8 @@ mostlyclean-compile:
1574 -rm -f src/c/hashtable/*.lo 1616 -rm -f src/c/hashtable/*.lo
1575 -rm -f src/cpp/*.$(OBJEXT) 1617 -rm -f src/cpp/*.$(OBJEXT)
1576 -rm -f src/cpp/*.lo 1618 -rm -f src/cpp/*.lo
1619 -rm -f src/cpp/hash/*.$(OBJEXT)
1620 -rm -f src/cpp/hash/*.lo
1577 -rm -f src/fortran/*.$(OBJEXT) 1621 -rm -f src/fortran/*.$(OBJEXT)
1578 -rm -f src/fortran/*.lo 1622 -rm -f src/fortran/*.lo
1579 1623
@@ -1607,6 +1651,7 @@ distclean-compile:
1607@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo@am__quote@ # am--include-marker 1651@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo@am__quote@ # am--include-marker
1608@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo@am__quote@ # am--include-marker 1652@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo@am__quote@ # am--include-marker
1609@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo@am__quote@ # am--include-marker 1653@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo@am__quote@ # am--include-marker
1654@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Plo@am__quote@ # am--include-marker
1610@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo@am__quote@ # am--include-marker 1655@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo@am__quote@ # am--include-marker
1611@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo@am__quote@ # am--include-marker 1656@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo@am__quote@ # am--include-marker
1612@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo@am__quote@ # am--include-marker 1657@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo@am__quote@ # am--include-marker
@@ -1661,7 +1706,6 @@ distclean-compile:
1661@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo@am__quote@ # am--include-marker 1706@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo@am__quote@ # am--include-marker
1662@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo@am__quote@ # am--include-marker 1707@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo@am__quote@ # am--include-marker
1663@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo@am__quote@ # am--include-marker 1708@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo@am__quote@ # am--include-marker
1664@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-md5.Plo@am__quote@ # am--include-marker
1665@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo@am__quote@ # am--include-marker 1709@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo@am__quote@ # am--include-marker
1666@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo@am__quote@ # am--include-marker 1710@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo@am__quote@ # am--include-marker
1667@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo@am__quote@ # am--include-marker 1711@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo@am__quote@ # am--include-marker
@@ -1680,6 +1724,7 @@ distclean-compile:
1680@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo@am__quote@ # am--include-marker 1724@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo@am__quote@ # am--include-marker
1681@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo@am__quote@ # am--include-marker 1725@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo@am__quote@ # am--include-marker
1682@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo@am__quote@ # am--include-marker 1726@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo@am__quote@ # am--include-marker
1727@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Plo@am__quote@ # am--include-marker
1683@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo@am__quote@ # am--include-marker 1728@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo@am__quote@ # am--include-marker
1684@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo@am__quote@ # am--include-marker 1729@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo@am__quote@ # am--include-marker
1685@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo@am__quote@ # am--include-marker 1730@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo@am__quote@ # am--include-marker
@@ -1687,6 +1732,11 @@ distclean-compile:
1687@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo@am__quote@ # am--include-marker 1732@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo@am__quote@ # am--include-marker
1688@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo@am__quote@ # am--include-marker 1733@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo@am__quote@ # am--include-marker
1689@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo@am__quote@ # am--include-marker 1734@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo@am__quote@ # am--include-marker
1735@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Plo@am__quote@ # am--include-marker
1736@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Plo@am__quote@ # am--include-marker
1737@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Plo@am__quote@ # am--include-marker
1738@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Plo@am__quote@ # am--include-marker
1739@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Plo@am__quote@ # am--include-marker
1690 1740
1691$(am__depfiles_remade): 1741$(am__depfiles_remade):
1692 @$(MKDIR_P) $(@D) 1742 @$(MKDIR_P) $(@D)
@@ -1732,13 +1782,6 @@ src/c/libscicore_algo_la-resizesignal.lo: src/c/resizesignal.c
1732@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1782@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1733@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscicore_algo_la-resizesignal.lo `test -f 'src/c/resizesignal.c' || echo '$(srcdir)/'`src/c/resizesignal.c 1783@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscicore_algo_la-resizesignal.lo `test -f 'src/c/resizesignal.c' || echo '$(srcdir)/'`src/c/resizesignal.c
1734 1784
1735src/c/libscicore_algo_la-md5.lo: src/c/md5.c
1736@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscicore_algo_la-md5.lo -MD -MP -MF src/c/$(DEPDIR)/libscicore_algo_la-md5.Tpo -c -o src/c/libscicore_algo_la-md5.lo `test -f 'src/c/md5.c' || echo '$(srcdir)/'`src/c/md5.c
1737@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscicore_algo_la-md5.Tpo src/c/$(DEPDIR)/libscicore_algo_la-md5.Plo
1738@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/md5.c' object='src/c/libscicore_algo_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
1739@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1740@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscicore_algo_la-md5.lo `test -f 'src/c/md5.c' || echo '$(srcdir)/'`src/c/md5.c
1741
1742src/c/libscicore_algo_la-getmodules.lo: src/c/getmodules.c 1785src/c/libscicore_algo_la-getmodules.lo: src/c/getmodules.c
1743@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscicore_algo_la-getmodules.lo -MD -MP -MF src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Tpo -c -o src/c/libscicore_algo_la-getmodules.lo `test -f 'src/c/getmodules.c' || echo '$(srcdir)/'`src/c/getmodules.c 1786@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscicore_algo_la-getmodules.lo -MD -MP -MF src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Tpo -c -o src/c/libscicore_algo_la-getmodules.lo `test -f 'src/c/getmodules.c' || echo '$(srcdir)/'`src/c/getmodules.c
1744@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Tpo src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Plo 1787@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Tpo src/c/$(DEPDIR)/libscicore_algo_la-getmodules.Plo
@@ -2036,6 +2079,13 @@ src/cpp/libscicore_algo_la-InitScilab.lo: src/cpp/InitScilab.cpp
2036@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2079@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2037@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscicore_algo_la-InitScilab.lo `test -f 'src/cpp/InitScilab.cpp' || echo '$(srcdir)/'`src/cpp/InitScilab.cpp 2080@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscicore_algo_la-InitScilab.lo `test -f 'src/cpp/InitScilab.cpp' || echo '$(srcdir)/'`src/cpp/InitScilab.cpp
2038 2081
2082src/cpp/libscicore_algo_la-md5_file.lo: src/cpp/md5_file.cpp
2083@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscicore_algo_la-md5_file.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Tpo -c -o src/cpp/libscicore_algo_la-md5_file.lo `test -f 'src/cpp/md5_file.cpp' || echo '$(srcdir)/'`src/cpp/md5_file.cpp
2084@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Tpo src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Plo
2085@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/md5_file.cpp' object='src/cpp/libscicore_algo_la-md5_file.lo' libtool=yes @AMDEPBACKSLASH@
2086@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2087@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscicore_algo_la-md5_file.lo `test -f 'src/cpp/md5_file.cpp' || echo '$(srcdir)/'`src/cpp/md5_file.cpp
2088
2039src/cpp/libscicore_algo_la-parsecommand.lo: src/cpp/parsecommand.cpp 2089src/cpp/libscicore_algo_la-parsecommand.lo: src/cpp/parsecommand.cpp
2040@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscicore_algo_la-parsecommand.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Tpo -c -o src/cpp/libscicore_algo_la-parsecommand.lo `test -f 'src/cpp/parsecommand.cpp' || echo '$(srcdir)/'`src/cpp/parsecommand.cpp 2090@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscicore_algo_la-parsecommand.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Tpo -c -o src/cpp/libscicore_algo_la-parsecommand.lo `test -f 'src/cpp/parsecommand.cpp' || echo '$(srcdir)/'`src/cpp/parsecommand.cpp
2041@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Tpo src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo 2091@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Tpo src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo
@@ -2057,6 +2107,41 @@ src/cpp/libscicore_algo_la-setformat.lo: src/cpp/setformat.cpp
2057@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2107@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2058@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscicore_algo_la-setformat.lo `test -f 'src/cpp/setformat.cpp' || echo '$(srcdir)/'`src/cpp/setformat.cpp 2108@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscicore_algo_la-setformat.lo `test -f 'src/cpp/setformat.cpp' || echo '$(srcdir)/'`src/cpp/setformat.cpp
2059 2109
2110src/cpp/hash/libscicore_algo_la-md5.lo: src/cpp/hash/md5.cpp
2111@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/hash/libscicore_algo_la-md5.lo -MD -MP -MF src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Tpo -c -o src/cpp/hash/libscicore_algo_la-md5.lo `test -f 'src/cpp/hash/md5.cpp' || echo '$(srcdir)/'`src/cpp/hash/md5.cpp
2112@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Tpo src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Plo
2113@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/hash/md5.cpp' object='src/cpp/hash/libscicore_algo_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
2114@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2115@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/hash/libscicore_algo_la-md5.lo `test -f 'src/cpp/hash/md5.cpp' || echo '$(srcdir)/'`src/cpp/hash/md5.cpp
2116
2117src/cpp/hash/libscicore_algo_la-crc32.lo: src/cpp/hash/crc32.cpp
2118@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/hash/libscicore_algo_la-crc32.lo -MD -MP -MF src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Tpo -c -o src/cpp/hash/libscicore_algo_la-crc32.lo `test -f 'src/cpp/hash/crc32.cpp' || echo '$(srcdir)/'`src/cpp/hash/crc32.cpp
2119@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Tpo src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Plo
2120@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/hash/crc32.cpp' object='src/cpp/hash/libscicore_algo_la-crc32.lo' libtool=yes @AMDEPBACKSLASH@
2121@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2122@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/hash/libscicore_algo_la-crc32.lo `test -f 'src/cpp/hash/crc32.cpp' || echo '$(srcdir)/'`src/cpp/hash/crc32.cpp
2123
2124src/cpp/hash/libscicore_algo_la-sha1.lo: src/cpp/hash/sha1.cpp
2125@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/hash/libscicore_algo_la-sha1.lo -MD -MP -MF src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Tpo -c -o src/cpp/hash/libscicore_algo_la-sha1.lo `test -f 'src/cpp/hash/sha1.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha1.cpp
2126@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Tpo src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Plo
2127@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/hash/sha1.cpp' object='src/cpp/hash/libscicore_algo_la-sha1.lo' libtool=yes @AMDEPBACKSLASH@
2128@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2129@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/hash/libscicore_algo_la-sha1.lo `test -f 'src/cpp/hash/sha1.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha1.cpp
2130
2131src/cpp/hash/libscicore_algo_la-sha256.lo: src/cpp/hash/sha256.cpp
2132@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/hash/libscicore_algo_la-sha256.lo -MD -MP -MF src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Tpo -c -o src/cpp/hash/libscicore_algo_la-sha256.lo `test -f 'src/cpp/hash/sha256.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha256.cpp
2133@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Tpo src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Plo
2134@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/hash/sha256.cpp' object='src/cpp/hash/libscicore_algo_la-sha256.lo' libtool=yes @AMDEPBACKSLASH@
2135@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2136@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/hash/libscicore_algo_la-sha256.lo `test -f 'src/cpp/hash/sha256.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha256.cpp
2137
2138src/cpp/hash/libscicore_algo_la-sha3.lo: src/cpp/hash/sha3.cpp
2139@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/hash/libscicore_algo_la-sha3.lo -MD -MP -MF src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Tpo -c -o src/cpp/hash/libscicore_algo_la-sha3.lo `test -f 'src/cpp/hash/sha3.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha3.cpp
2140@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Tpo src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Plo
2141@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/cpp/hash/sha3.cpp' object='src/cpp/hash/libscicore_algo_la-sha3.lo' libtool=yes @AMDEPBACKSLASH@
2142@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2143@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/hash/libscicore_algo_la-sha3.lo `test -f 'src/cpp/hash/sha3.cpp' || echo '$(srcdir)/'`src/cpp/hash/sha3.cpp
2144
2060sci_gateway/cpp/libscicore_la-core_gw.lo: sci_gateway/cpp/core_gw.cpp 2145sci_gateway/cpp/libscicore_la-core_gw.lo: sci_gateway/cpp/core_gw.cpp
2061@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-core_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Tpo -c -o sci_gateway/cpp/libscicore_la-core_gw.lo `test -f 'sci_gateway/cpp/core_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/core_gw.cpp 2146@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-core_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Tpo -c -o sci_gateway/cpp/libscicore_la-core_gw.lo `test -f 'sci_gateway/cpp/core_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/core_gw.cpp
2062@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Plo 2147@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-core_gw.Plo
@@ -2442,6 +2527,13 @@ sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo: sci_gateway/cpp/sci_ch
2442@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2527@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2443@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo `test -f 'sci_gateway/cpp/sci_checkNamedArguments.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_checkNamedArguments.cpp 2528@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicore_la-sci_checkNamedArguments.lo `test -f 'sci_gateway/cpp/sci_checkNamedArguments.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_checkNamedArguments.cpp
2444 2529
2530sci_gateway/cpp/libscicore_la-sci_hash.lo: sci_gateway/cpp/sci_hash.cpp
2531@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-sci_hash.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Tpo -c -o sci_gateway/cpp/libscicore_la-sci_hash.lo `test -f 'sci_gateway/cpp/sci_hash.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_hash.cpp
2532@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Plo
2533@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sci_gateway/cpp/sci_hash.cpp' object='sci_gateway/cpp/libscicore_la-sci_hash.lo' libtool=yes @AMDEPBACKSLASH@
2534@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
2535@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicore_la-sci_hash.lo `test -f 'sci_gateway/cpp/sci_hash.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_hash.cpp
2536
2445sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo: sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp 2537sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo: sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp
2446@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Tpo -c -o sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo `test -f 'sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp 2538@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Tpo -c -o sci_gateway/cpp/libscicore_la-sci_inspectorDeleteUnreferencedItems.lo `test -f 'sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp
2447@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo 2539@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Tpo sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo
@@ -2510,6 +2602,7 @@ clean-libtool:
2510 -rm -rf src/c/.libs src/c/_libs 2602 -rm -rf src/c/.libs src/c/_libs
2511 -rm -rf src/c/hashtable/.libs src/c/hashtable/_libs 2603 -rm -rf src/c/hashtable/.libs src/c/hashtable/_libs
2512 -rm -rf src/cpp/.libs src/cpp/_libs 2604 -rm -rf src/cpp/.libs src/cpp/_libs
2605 -rm -rf src/cpp/hash/.libs src/cpp/hash/_libs
2513 -rm -rf src/fortran/.libs src/fortran/_libs 2606 -rm -rf src/fortran/.libs src/fortran/_libs
2514install-libscicore_la_etcDATA: $(libscicore_la_etc_DATA) 2607install-libscicore_la_etcDATA: $(libscicore_la_etc_DATA)
2515 @$(NORMAL_INSTALL) 2608 @$(NORMAL_INSTALL)
@@ -2725,6 +2818,8 @@ distclean-generic:
2725 -rm -f src/c/hashtable/$(am__dirstamp) 2818 -rm -f src/c/hashtable/$(am__dirstamp)
2726 -rm -f src/cpp/$(DEPDIR)/$(am__dirstamp) 2819 -rm -f src/cpp/$(DEPDIR)/$(am__dirstamp)
2727 -rm -f src/cpp/$(am__dirstamp) 2820 -rm -f src/cpp/$(am__dirstamp)
2821 -rm -f src/cpp/hash/$(DEPDIR)/$(am__dirstamp)
2822 -rm -f src/cpp/hash/$(am__dirstamp)
2728 -rm -f src/fortran/$(DEPDIR)/$(am__dirstamp) 2823 -rm -f src/fortran/$(DEPDIR)/$(am__dirstamp)
2729 -rm -f src/fortran/$(am__dirstamp) 2824 -rm -f src/fortran/$(am__dirstamp)
2730 2825
@@ -2764,6 +2859,7 @@ distclean: distclean-am
2764 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo 2859 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo
2765 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo 2860 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo
2766 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo 2861 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo
2862 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Plo
2767 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo 2863 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo
2768 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo 2864 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo
2769 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo 2865 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo
@@ -2818,7 +2914,6 @@ distclean: distclean-am
2818 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo 2914 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo
2819 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo 2915 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo
2820 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo 2916 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo
2821 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-md5.Plo
2822 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo 2917 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo
2823 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo 2918 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo
2824 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo 2919 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo
@@ -2837,6 +2932,7 @@ distclean: distclean-am
2837 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo 2932 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo
2838 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo 2933 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo
2839 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo 2934 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo
2935 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Plo
2840 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo 2936 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo
2841 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo 2937 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo
2842 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo 2938 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo
@@ -2844,6 +2940,11 @@ distclean: distclean-am
2844 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo 2940 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo
2845 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo 2941 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo
2846 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo 2942 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo
2943 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Plo
2944 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Plo
2945 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Plo
2946 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Plo
2947 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Plo
2847 -rm -f Makefile 2948 -rm -f Makefile
2848distclean-am: clean-am distclean-compile distclean-generic \ 2949distclean-am: clean-am distclean-compile distclean-generic \
2849 distclean-local distclean-tags 2950 distclean-local distclean-tags
@@ -2918,6 +3019,7 @@ maintainer-clean: maintainer-clean-am
2918 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo 3019 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getscilabmode.Plo
2919 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo 3020 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_getversion.Plo
2920 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo 3021 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_global.Plo
3022 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_hash.Plo
2921 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo 3023 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_ieee.Plo
2922 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo 3024 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_insert.Plo
2923 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo 3025 -rm -f sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_inspectorDeleteUnreferencedItems.Plo
@@ -2972,7 +3074,6 @@ maintainer-clean: maintainer-clean-am
2972 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo 3074 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-isanan.Plo
2973 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo 3075 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-islittleendian.Plo
2974 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo 3076 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-loadversion.Plo
2975 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-md5.Plo
2976 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo 3077 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-resizesignal.Plo
2977 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo 3078 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-returnanan.Plo
2978 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo 3079 -rm -f src/c/$(DEPDIR)/libscicore_algo_la-saveCWDInPreferences.Plo
@@ -2991,6 +3092,7 @@ maintainer-clean: maintainer-clean-am
2991 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo 3092 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo
2992 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo 3093 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo
2993 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo 3094 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-getvariablesname.Plo
3095 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-md5_file.Plo
2994 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo 3096 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-parsecommand.Plo
2995 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo 3097 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-pause.Plo
2996 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo 3098 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-runner.Plo
@@ -2998,6 +3100,11 @@ maintainer-clean: maintainer-clean-am
2998 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo 3100 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-storeCommand.Plo
2999 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo 3101 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-tasks.Plo
3000 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo 3102 -rm -f src/cpp/$(DEPDIR)/libscicore_algo_la-with_module.Plo
3103 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-crc32.Plo
3104 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-md5.Plo
3105 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha1.Plo
3106 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha256.Plo
3107 -rm -f src/cpp/hash/$(DEPDIR)/libscicore_algo_la-sha3.Plo
3001 -rm -f Makefile 3108 -rm -f Makefile
3002maintainer-clean-am: distclean-am maintainer-clean-generic 3109maintainer-clean-am: distclean-am maintainer-clean-generic
3003 3110
diff --git a/scilab/modules/core/includes/core_gw.hxx b/scilab/modules/core/includes/core_gw.hxx
index 9dfac6f..209d24e 100644
--- a/scilab/modules/core/includes/core_gw.hxx
+++ b/scilab/modules/core/includes/core_gw.hxx
@@ -51,6 +51,7 @@ CPP_GATEWAY_PROTOTYPE(sci_lasterror);
51CPP_GATEWAY_PROTOTYPE(sci_getversion); 51CPP_GATEWAY_PROTOTYPE(sci_getversion);
52CPP_GATEWAY_PROTOTYPE(sci_warning); 52CPP_GATEWAY_PROTOTYPE(sci_warning);
53CPP_GATEWAY_PROTOTYPE(sci_getmd5); 53CPP_GATEWAY_PROTOTYPE(sci_getmd5);
54CPP_GATEWAY_PROTOTYPE(sci_hash);
54CPP_GATEWAY_PROTOTYPE(sci_error); 55CPP_GATEWAY_PROTOTYPE(sci_error);
55CPP_GATEWAY_PROTOTYPE(sci_pause); 56CPP_GATEWAY_PROTOTYPE(sci_pause);
56CPP_GATEWAY_PROTOTYPE(sci_abort); 57CPP_GATEWAY_PROTOTYPE(sci_abort);
diff --git a/scilab/modules/core/includes/md5.h b/scilab/modules/core/includes/md5.h
index f92851a..018b921 100644
--- a/scilab/modules/core/includes/md5.h
+++ b/scilab/modules/core/includes/md5.h
@@ -1,96 +1,26 @@
1/* 1/*
2 Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 3 * Copyright (C) 2021 - ESI Group - Clément DAVID
4 This software is provided 'as-is', without any express or implied 4 *
5 warranty. In no event will the authors be held liable for any damages 5 * This file is hereby licensed under the terms of the GNU GPL v2.0,
6 arising from the use of this software. 6 * pursuant to article 5.3.4 of the CeCILL v.2.1.
7 7 * This file was originally licensed under the terms of the CeCILL v2.1,
8 Permission is granted to anyone to use this software for any purpose, 8 * and continues to be available under such terms.
9 including commercial applications, and to alter it and redistribute it 9 * For more information, see the COPYING file which you should have received
10 freely, subject to the following restrictions: 10 * along with this program.
11 11 *
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 L. Peter Deutsch
21 ghost@aladdin.com
22
23 */ 12 */
24/*
25 Independent implementation of MD5 (RFC 1321).
26
27 This code implements the MD5 Algorithm defined in RFC 1321, whose
28 text is available at
29 http://www.ietf.org/rfc/rfc1321.txt
30 The code is derived from the text of the RFC, including the test suite
31 (section A.5) but excluding the rest of Appendix A. It does not include
32 any code or documentation that is identified in the RFC as being
33 copyrighted.
34 13
35 The original and principal author of md5.h is L. Peter Deutsch 14#ifndef __MD5_H__
36 <ghost@aladdin.com>. Other authors are noted in the change history 15#define __MD5_H__
37 that follows (in reverse chronological order):
38 16
39 2002-04-13 lpd Removed support for non-ANSI compilers; removed 17#include "dynlib_core.h"
40 references to Ghostscript; clarified derivation from RFC 1321;
41 now handles byte order either statically or dynamically.
42 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
43 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
44 added conditionalization for C++ compilation from Martin
45 Purschke <purschke@bnl.gov>.
46 1999-05-03 lpd Original version.
47 */
48
49#ifndef md5_INCLUDED
50# define md5_INCLUDED
51 18
52#include <stdio.h> 19#include <stdio.h>
53/*
54 * This package supports both compile-time and run-time determination of CPU
55 * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
56 * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
57 * defined as non-zero, the code will be compiled to run only on big-endian
58 * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
59 * run on either big- or little-endian CPUs, but will run slightly less
60 * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
61 */
62
63typedef unsigned char md5_byte_t; /* 8-bit byte */
64typedef unsigned int md5_word_t; /* 32-bit word */
65
66/* Define the state of the MD5 Algorithm. */
67typedef struct md5_state_s
68{
69 md5_word_t count[2]; /* message length in bits, lsw first */
70 md5_word_t abcd[4]; /* digest buffer */
71 md5_byte_t buf[64]; /* accumulate block */
72} md5_state_t;
73
74#ifdef __cplusplus
75extern "C"
76{
77#endif
78
79/* Initialize the algorithm. */
80void md5_init(md5_state_t *pms);
81 20
82/* Append a string to the message. */ 21/*
83void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); 22** Compute md5 of a file
84 23*/
85/* Finish the message and return the digest. */ 24CORE_IMPEXP char* md5_file(FILE* f);
86void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
87
88char *md5_file(FILE *fp);
89
90char *md5_str(char *p);
91
92#ifdef __cplusplus
93} /* end extern "C" */
94#endif
95 25
96#endif /* md5_INCLUDED */ 26#endif /* !__BANNER_HXX__ */
diff --git a/scilab/modules/core/license.txt b/scilab/modules/core/license.txt
index f142fe0..ec73bab 100644
--- a/scilab/modules/core/license.txt
+++ b/scilab/modules/core/license.txt
@@ -25,28 +25,29 @@ Copyright: Albert Cahalan
25License: 25License:
26LGPL 26LGPL
27 27
28md5: 28hash sub-directory:
29==== 29===================
30 30
31Files: 31Files:
32src/c/md5.c 32src/cpp/hash/crc32.cpp
33includes/md5.h 33src/cpp/hash/crc32.hxx
34 34src/cpp/hash/hash.hxx
35Copyright: L. Peter Deutsch 35src/cpp/hash/LICENSE.txt
36src/cpp/hash/md5.cpp
37src/cpp/hash/md5.hxx
38src/cpp/hash/readme.md
39src/cpp/hash/sha1.cpp
40src/cpp/hash/sha1.hxx
41src/cpp/hash/sha256.cpp
42src/cpp/hash/sha256.hxx
43src/cpp/hash/sha3.cpp
44src/cpp/hash/sha3.hxx
45
46Copyright: Stephan Brumme
36 47
37License: 48License:
49zlib
38 50
39 Permission is granted to anyone to use this software for any purpose,
40 including commercial applications, and to alter it and redistribute it
41 freely, subject to the following restrictions:
42
43 1. The origin of this software must not be misrepresented; you must not
44 claim that you wrote the original software. If you use this software
45 in a product, an acknowledgment in the product documentation would be
46 appreciated but is not required.
47 2. Altered source versions must be plainly marked as such, and must not be
48 misrepresented as being the original software.
49 3. This notice may not be removed or altered from any source distribution.
50 51
51 52
52backtrace: 53backtrace:
diff --git a/scilab/modules/core/sci_gateway/cpp/core_gw.cpp b/scilab/modules/core/sci_gateway/cpp/core_gw.cpp
index 7c2ae09..ee92aea 100644
--- a/scilab/modules/core/sci_gateway/cpp/core_gw.cpp
+++ b/scilab/modules/core/sci_gateway/cpp/core_gw.cpp
@@ -44,6 +44,7 @@ int CoreModule::Load()
44 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lasterror", &sci_lasterror, MODULE_NAME)); 44 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lasterror", &sci_lasterror, MODULE_NAME));
45 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"warning", &sci_warning, MODULE_NAME)); 45 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"warning", &sci_warning, MODULE_NAME));
46 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getmd5", &sci_getmd5, MODULE_NAME)); 46 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getmd5", &sci_getmd5, MODULE_NAME));
47 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"hash", &sci_hash, MODULE_NAME));
47 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"error", &sci_error, MODULE_NAME)); 48 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"error", &sci_error, MODULE_NAME));
48 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"pause", &sci_pause, MODULE_NAME)); 49 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"pause", &sci_pause, MODULE_NAME));
49 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"abort", &sci_abort, MODULE_NAME)); 50 symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"abort", &sci_abort, MODULE_NAME));
diff --git a/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj b/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj
index a423d25..9470c79 100644
--- a/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj
+++ b/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj
@@ -81,7 +81,7 @@
81 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 81 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
82 <ClCompile> 82 <ClCompile>
83 <Optimization>Disabled</Optimization> 83 <Optimization>Disabled</Optimization>
84 <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 84 <AdditionalIncludeDirectories>../../includes;../../src/c;../../src/cpp/hash;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
85 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 85 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
86 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 86 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
87 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> 87 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -104,7 +104,7 @@
104 </Midl> 104 </Midl>
105 <ClCompile> 105 <ClCompile>
106 <Optimization>Disabled</Optimization> 106 <Optimization>Disabled</Optimization>
107 <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 107 <AdditionalIncludeDirectories>../../includes;../../src/c;../../src/cpp/hash;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
108 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 108 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
109 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 109 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
110 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> 110 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -125,7 +125,7 @@
125 <ClCompile> 125 <ClCompile>
126 <Optimization>MaxSpeed</Optimization> 126 <Optimization>MaxSpeed</Optimization>
127 <IntrinsicFunctions>true</IntrinsicFunctions> 127 <IntrinsicFunctions>true</IntrinsicFunctions>
128 <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 128 <AdditionalIncludeDirectories>../../includes;../../src/c;../../src/cpp/hash;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
129 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 129 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> 130 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
131 <FunctionLevelLinking>true</FunctionLevelLinking> 131 <FunctionLevelLinking>true</FunctionLevelLinking>
@@ -152,7 +152,7 @@
152 <ClCompile> 152 <ClCompile>
153 <Optimization>MaxSpeed</Optimization> 153 <Optimization>MaxSpeed</Optimization>
154 <IntrinsicFunctions>true</IntrinsicFunctions> 154 <IntrinsicFunctions>true</IntrinsicFunctions>
155 <AdditionalIncludeDirectories>../../includes;../../src/c;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 155 <AdditionalIncludeDirectories>../../includes;../../src/c;../../src/cpp/hash;../../../../libs/intl;../../../functions_manager/includes;../../../elementary_functions/includes;../../../api_scilab/includes;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../fileio/includes;../../../threads/includes;../../../console/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../jvm/src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
156 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 156 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CORE_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
157 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> 157 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
158 <FunctionLevelLinking>true</FunctionLevelLinking> 158 <FunctionLevelLinking>true</FunctionLevelLinking>
@@ -173,6 +173,11 @@
173 </Link> 173 </Link>
174 </ItemDefinitionGroup> 174 </ItemDefinitionGroup>
175 <ItemGroup> 175 <ItemGroup>
176 <ClCompile Include="..\..\src\cpp\hash\crc32.cpp" />
177 <ClCompile Include="..\..\src\cpp\hash\md5.cpp" />
178 <ClCompile Include="..\..\src\cpp\hash\sha1.cpp" />
179 <ClCompile Include="..\..\src\cpp\hash\sha256.cpp" />
180 <ClCompile Include="..\..\src\cpp\hash\sha3.cpp" />
176 <ClCompile Include="sci_analyzeroptions.cpp" /> 181 <ClCompile Include="sci_analyzeroptions.cpp" />
177 <ClCompile Include="sci_cell.cpp" /> 182 <ClCompile Include="sci_cell.cpp" />
178 <ClCompile Include="sci_checkNamedArguments.cpp" /> 183 <ClCompile Include="sci_checkNamedArguments.cpp" />
@@ -183,6 +188,7 @@
183 <ClCompile Include="sci_funcprot.cpp" /> 188 <ClCompile Include="sci_funcprot.cpp" />
184 <ClCompile Include="sci_funptr.cpp" /> 189 <ClCompile Include="sci_funptr.cpp" />
185 <ClCompile Include="sci_getmemory.cpp" /> 190 <ClCompile Include="sci_getmemory.cpp" />
191 <ClCompile Include="sci_hash.cpp" />
186 <ClCompile Include="sci_ieee.cpp" /> 192 <ClCompile Include="sci_ieee.cpp" />
187 <ClCompile Include="sci_insert.cpp" /> 193 <ClCompile Include="sci_insert.cpp" />
188 <ClCompile Include="sci_inspectorDeleteUnreferencedItems.cpp"> 194 <ClCompile Include="sci_inspectorDeleteUnreferencedItems.cpp">
@@ -263,6 +269,12 @@
263 <ClInclude Include="..\..\includes\core_gw.hxx" /> 269 <ClInclude Include="..\..\includes\core_gw.hxx" />
264 <ClInclude Include="..\..\includes\dynlib_core_gw.h" /> 270 <ClInclude Include="..\..\includes\dynlib_core_gw.h" />
265 <ClInclude Include="..\..\includes\runner.hxx" /> 271 <ClInclude Include="..\..\includes\runner.hxx" />
272 <ClInclude Include="..\..\src\cpp\hash\crc32.hxx" />
273 <ClInclude Include="..\..\src\cpp\hash\hash.hxx" />
274 <ClInclude Include="..\..\src\cpp\hash\md5.hxx" />
275 <ClInclude Include="..\..\src\cpp\hash\sha1.hxx" />
276 <ClInclude Include="..\..\src\cpp\hash\sha256.hxx" />
277 <ClInclude Include="..\..\src\cpp\hash\sha3.hxx" />
266 </ItemGroup> 278 </ItemGroup>
267 <ItemGroup> 279 <ItemGroup>
268 <Library Include="..\..\..\..\bin\blasplus.lib" /> 280 <Library Include="..\..\..\..\bin\blasplus.lib" />
diff --git a/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters b/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters
index b152ee0..a868e7b 100644
--- a/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters
+++ b/scilab/modules/core/sci_gateway/cpp/core_gw.vcxproj.filters
@@ -204,6 +204,24 @@
204 <ClCompile Include="sci_checkNamedArguments.cpp"> 204 <ClCompile Include="sci_checkNamedArguments.cpp">
205 <Filter>Source Files</Filter> 205 <Filter>Source Files</Filter>
206 </ClCompile> 206 </ClCompile>
207 <ClCompile Include="sci_hash.cpp">
208 <Filter>Source Files</Filter>
209 </ClCompile>
210 <ClCompile Include="..\..\src\cpp\hash\crc32.cpp">
211 <Filter>Source Files</Filter>
212 </ClCompile>
213 <ClCompile Include="..\..\src\cpp\hash\md5.cpp">
214 <Filter>Source Files</Filter>
215 </ClCompile>
216 <ClCompile Include="..\..\src\cpp\hash\sha1.cpp">
217 <Filter>Source Files</Filter>
218 </ClCompile>
219 <ClCompile Include="..\..\src\cpp\hash\sha3.cpp">
220 <Filter>Source Files</Filter>
221 </ClCompile>
222 <ClCompile Include="..\..\src\cpp\hash\sha256.cpp">
223 <Filter>Source Files</Filter>
224 </ClCompile>
207 </ItemGroup> 225 </ItemGroup>
208 <ItemGroup> 226 <ItemGroup>
209 <ClInclude Include="..\..\includes\banner.hxx"> 227 <ClInclude Include="..\..\includes\banner.hxx">
@@ -218,6 +236,24 @@
218 <ClInclude Include="..\..\includes\runner.hxx"> 236 <ClInclude Include="..\..\includes\runner.hxx">
219 <Filter>Header Files</Filter> 237 <Filter>Header Files</Filter>
220 </ClInclude> 238 </ClInclude>
239 <ClInclude Include="..\..\src\cpp\hash\crc32.hxx">
240 <Filter>Header Files</Filter>
241 </ClInclude>
242 <ClInclude Include="..\..\src\cpp\hash\hash.hxx">
243 <Filter>Header Files</Filter>
244 </ClInclude>
245 <ClInclude Include="..\..\src\cpp\hash\md5.hxx">
246 <Filter>Header Files</Filter>
247 </ClInclude>
248 <ClInclude Include="..\..\src\cpp\hash\sha1.hxx">
249 <Filter>Header Files</Filter>
250 </ClInclude>
251 <ClInclude Include="..\..\src\cpp\hash\sha3.hxx">
252 <Filter>Header Files</Filter>
253 </ClInclude>
254 <ClInclude Include="..\..\src\cpp\hash\sha256.hxx">
255 <Filter>Header Files</Filter>
256 </ClInclude>
221 </ItemGroup> 257 </ItemGroup>
222 <ItemGroup> 258 <ItemGroup>
223 <Library Include="..\..\..\..\bin\blasplus.lib" /> 259 <Library Include="..\..\..\..\bin\blasplus.lib" />
diff --git a/scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp b/scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp
index b0f5317..f0d594f 100644
--- a/scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp
+++ b/scilab/modules/core/sci_gateway/cpp/sci_getmd5.cpp
@@ -1,8 +1,8 @@
1/* 1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET 3 * Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
4 * 4 * Copyright (C) 2012 - 2016 - Scilab Enterprises
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2021 - Stéphane MOTTELET
6 * 6 *
7 * This file is hereby licensed under the terms of the GNU GPL v2.0, 7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1. 8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -17,11 +17,11 @@
17#include "types.hxx" 17#include "types.hxx"
18#include "function.hxx" 18#include "function.hxx"
19#include "string.hxx" 19#include "string.hxx"
20#include "md5.hxx"
20 21
21extern "C" 22extern "C"
22{ 23{
23#include "sci_malloc.h" 24#include "sci_malloc.h"
24#include "md5.h"
25#include "localization.h" 25#include "localization.h"
26#include "Scierror.h" 26#include "Scierror.h"
27#include "charEncoding.h" 27#include "charEncoding.h"
@@ -74,6 +74,8 @@ types::Function::ReturnValue sci_getmd5(types::typed_list &in, int _iRetCount, t
74 types::String *pIn = in[0]->getAs<types::String>(); 74 types::String *pIn = in[0]->getAs<types::String>();
75 types::String *pOutput = new types::String(pIn->getRows(), pIn->getCols()); 75 types::String *pOutput = new types::String(pIn->getRows(), pIn->getCols());
76 76
77 MD5 md5_digest;
78
77 for (int i = 0 ; i < pIn->getSize() ; ++i) 79 for (int i = 0 ; i < pIn->getSize() ; ++i)
78 { 80 {
79 wchar_t *wcsCurrentIn = pIn->get(i); 81 wchar_t *wcsCurrentIn = pIn->get(i);
@@ -82,15 +84,16 @@ types::Function::ReturnValue sci_getmd5(types::typed_list &in, int _iRetCount, t
82 if (bStringMode) 84 if (bStringMode)
83 { 85 {
84 pstPath = wide_string_to_UTF8(wcsCurrentIn); 86 pstPath = wide_string_to_UTF8(wcsCurrentIn);
85 char* pstMD5_ = md5_str(pstPath); 87 std::string pstMD5_ = md5_digest(pstPath);
86 pstMD5 = to_wide_string(pstMD5_); 88 pstMD5 = to_wide_string(pstMD5_.c_str());
87 FREE(pstPath); 89 FREE(pstPath);
88 FREE(pstMD5_);
89 } 90 }
90 else 91 else
91 { 92 {
92 FILE *fp = NULL; 93 FILE *fp = NULL;
93 wchar_t *real_path = NULL; 94 wchar_t *real_path = NULL;
95 char pStData[64];
96 size_t iLen = 0;
94 97
95 /* Replaces SCI, ~, HOME, TMPDIR by the real path */ 98 /* Replaces SCI, ~, HOME, TMPDIR by the real path */
96 real_path = expandPathVariableW(wcsCurrentIn); 99 real_path = expandPathVariableW(wcsCurrentIn);
@@ -110,10 +113,14 @@ types::Function::ReturnValue sci_getmd5(types::typed_list &in, int _iRetCount, t
110 113
111 if (fp) 114 if (fp)
112 { 115 {
113 char* pstrFile = md5_file(fp); 116 while (!feof(fp))
114 pstMD5 = to_wide_string(pstrFile); 117 {
118 iLen = fread(pStData, 1, sizeof(pStData), fp);
119 md5_digest.add(pStData, iLen);
120 }
121 std::string strHash = md5_digest.getHash();
122 pstMD5 = to_wide_string(strHash.c_str());
115 fclose(fp); 123 fclose(fp);
116 FREE(pstrFile);
117 } 124 }
118 else 125 else
119 { 126 {
@@ -127,6 +134,7 @@ types::Function::ReturnValue sci_getmd5(types::typed_list &in, int _iRetCount, t
127 FREE(pstPath); 134 FREE(pstPath);
128 FREE(real_path); 135 FREE(real_path);
129 } 136 }
137 md5_digest.reset();
130 138
131 pOutput->set(i, pstMD5); 139 pOutput->set(i, pstMD5);
132 FREE(pstMD5); 140 FREE(pstMD5);
diff --git a/scilab/modules/core/sci_gateway/cpp/sci_hash.cpp b/scilab/modules/core/sci_gateway/cpp/sci_hash.cpp
new file mode 100644
index 0000000..c42ac61
--- /dev/null
+++ b/scilab/modules/core/sci_gateway/cpp/sci_hash.cpp
@@ -0,0 +1,195 @@
1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2021 - Stéphane MOTTELET
4 *
5 * This file is hereby licensed under the terms of the GNU GPL v3.0,
6 * For more information, see the COPYING file which you should have received
7 * along with this program.
8 *
9 */
10
11#include <cwctype>
12#include "core_gw.hxx"
13#include "types.hxx"
14#include "function.hxx"
15#include "string.hxx"
16#include "double.hxx"
17#include "file.hxx"
18#include "filemanager.hxx"
19#include "crc32.hxx"
20#include "md5.hxx"
21#include "sha1.hxx"
22#include "sha256.hxx"
23#include "sha3.hxx"
24
25extern "C"
26{
27#include "Scierror.h"
28#include "sci_malloc.h"
29}
30
31types::Function::ReturnValue sci_hash(types::typed_list &in, int _iRetCount, types::typed_list &out)
32{
33 bool bStringMode = false;
34 char* pstInput = NULL;
35 int iSize = 0;
36 types::String* pIn = NULL;
37 types::String* pOutput = NULL;
38 types::Double* pDbl = NULL;
39 Hash* digest = NULL;
40
41 if (_iRetCount > 1)
42 {
43 Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), "hash", 1);
44 return types::Function::Error;
45 }
46
47 if (in.size() != 2)
48 {
49 Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "hash", 2);
50 return types::Function::Error;
51 }
52
53 if (in[0]->isString() == false && in[0]->isDouble() == false)
54 {
55 Scierror(999, _("%s: Wrong type of input argument #%d: String or File descriptor expected.\n"), "hash", 1);
56 return types::Function::Error;
57 }
58
59 if (in[1]->isString() == false || in[1]->getAs<types::String>()->isScalar() == false)
60 {
61 Scierror(999, _("%s: Wrong type of input argument #%d: a single string expected.\n"), "hash", 2);
62 return types::Function::Error;
63 }
64
65 std::wstring wstrAlgo(in[1]->getAs<types::String>()->get()[0]);
66 std::transform(wstrAlgo.begin(), wstrAlgo.end(), wstrAlgo.begin(),std::towlower);
67
68 if (wstrAlgo == L"crc32")
69 {
70 digest = new CRC32();
71 }
72 else if (wstrAlgo == L"md5")
73 {
74 digest = new MD5();
75 }
76 else if (wstrAlgo == L"sha1")
77 {
78 digest = new SHA1();
79 }
80 else if (wstrAlgo == L"sha2" || wstrAlgo == L"sha256")
81 {
82 digest = new SHA256();
83 }
84 else if (wstrAlgo == L"sha3-224")
85 {
86 digest = new SHA3(SHA3::Bits224);
87 }
88 else if (wstrAlgo == L"sha3-256")
89 {
90 digest = new SHA3(SHA3::Bits256);
91 }
92 else if (wstrAlgo == L"sha3-384")
93 {
94 digest = new SHA3(SHA3::Bits384);
95 }
96 else if (wstrAlgo == L"sha3-512")
97 {
98 digest = new SHA3(SHA3::Bits512);
99 }
100 else
101 {
102 Scierror(999, _("%s: algorithm %ls is unknown.\n"), "hash", wstrAlgo.c_str());
103 return types::Function::Error;
104 }
105
106 if (in[0]->isString())
107 {
108 pIn = in[0]->getAs<types::String>();
109 pOutput = new types::String(pIn->getRows(), pIn->getCols());
110 bStringMode = true;
111 iSize = pIn->getSize();
112 }
113 else
114 {
115 pDbl = in[0]->getAs<types::Double>();
116 pOutput = new types::String(pDbl->getRows(), pDbl->getCols());
117 iSize = pDbl->getSize();
118 }
119
120 for (int i = 0; i < iSize; ++i)
121 {
122 wchar_t *pwstHash = NULL;
123
124 if (bStringMode)
125 {
126 wchar_t *pwstInput = pIn->get(i);
127 pstInput = wide_string_to_UTF8(pwstInput);
128 digest->add(pstInput, strlen(pstInput));
129 FREE(pstInput);
130 }
131 else
132 {
133 FILE *fp = NULL;
134 char pStData[64];
135 size_t iLen = 0;
136 int iFile = (int) pDbl->get(i);
137 types::File* pF = NULL;
138
139 switch (iFile)
140 {
141 case 0: // stderr
142 case 5: // stdin
143 case 6: // stdout
144 break;
145 default :
146 pF = FileManager::getFile(iFile);
147 }
148
149 if (pF == NULL)
150 {
151 Scierror(999, _("%s: Wrong file descriptor: %d.\n"), "hash", iFile);
152 return types::Function::Error;
153 }
154 else if (pF->getFileMode()[0] != L'r')
155 {
156 Scierror(999, _("%s: File must be opened for reading.\n"), "hash", iFile);
157 fclose(pF->getFiledesc());
158 FileManager::deleteFile(iFile);
159 return types::Function::Error;
160 }
161
162 fp = pF->getFiledesc();
163 if (fp) // argument is a valid path to an existing file
164 {
165 while (!feof(fp))
166 {
167 iLen = fread(pStData, 1, sizeof(pStData), fp);
168 digest->add(pStData, iLen);
169 }
170 fclose(fp);
171 // after closing, don't forget to remove file from the list of opened files
172 FileManager::deleteFile(iFile);
173 }
174 }
175
176 std::string strHash = digest->getHash();
177 if (strHash.length() > 0)
178 {
179 pwstHash = to_wide_string(strHash.c_str());
180 pOutput->set(i, pwstHash);
181 FREE(pwstHash);
182 }
183 else
184 {
185 pOutput->set(i, L"");
186 }
187
188 digest->reset();
189 }
190
191 delete digest;
192 out.push_back(pOutput);
193 return types::Function::OK;
194}
195/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/core.vcxproj b/scilab/modules/core/src/c/core.vcxproj
index 809796c..991f745 100644
--- a/scilab/modules/core/src/c/core.vcxproj
+++ b/scilab/modules/core/src/c/core.vcxproj
@@ -1,4 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 2<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations"> 3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32"> 4 <ProjectConfiguration Include="Debug|Win32">
@@ -247,7 +247,13 @@ cd ..
247 <ClCompile Include="..\cpp\getfunctionsname.cpp" /> 247 <ClCompile Include="..\cpp\getfunctionsname.cpp" />
248 <ClCompile Include="..\cpp\getmacrosname.cpp" /> 248 <ClCompile Include="..\cpp\getmacrosname.cpp" />
249 <ClCompile Include="..\cpp\getvariablesname.cpp" /> 249 <ClCompile Include="..\cpp\getvariablesname.cpp" />
250 <ClCompile Include="..\cpp\hash\crc32.cpp" />
251 <ClCompile Include="..\cpp\hash\md5.cpp" />
252 <ClCompile Include="..\cpp\hash\sha1.cpp" />
253 <ClCompile Include="..\cpp\hash\sha256.cpp" />
254 <ClCompile Include="..\cpp\hash\sha3.cpp" />
250 <ClCompile Include="..\cpp\InitScilab.cpp" /> 255 <ClCompile Include="..\cpp\InitScilab.cpp" />
256 <ClCompile Include="..\cpp\md5_file.cpp" />
251 <ClCompile Include="..\cpp\parsecommand.cpp" /> 257 <ClCompile Include="..\cpp\parsecommand.cpp" />
252 <ClCompile Include="..\cpp\pause.cpp" /> 258 <ClCompile Include="..\cpp\pause.cpp" />
253 <ClCompile Include="..\cpp\runner.cpp" /> 259 <ClCompile Include="..\cpp\runner.cpp" />
@@ -279,7 +285,6 @@ cd ..
279 <ClCompile Include="isanan.c" /> 285 <ClCompile Include="isanan.c" />
280 <ClCompile Include="islittleendian.c" /> 286 <ClCompile Include="islittleendian.c" />
281 <ClCompile Include="loadversion.c" /> 287 <ClCompile Include="loadversion.c" />
282 <ClCompile Include="md5.c" />
283 <ClCompile Include="returnanan.c" /> 288 <ClCompile Include="returnanan.c" />
284 <ClCompile Include="saveCWDInPreferences.c" /> 289 <ClCompile Include="saveCWDInPreferences.c" />
285 <ClCompile Include="setPrecisionFPU.c" /> 290 <ClCompile Include="setPrecisionFPU.c" />
@@ -337,7 +342,6 @@ cd ..
337 <ClInclude Include="..\..\includes\islittleendian.h" /> 342 <ClInclude Include="..\..\includes\islittleendian.h" />
338 <ClInclude Include="..\..\includes\loadversion.h" /> 343 <ClInclude Include="..\..\includes\loadversion.h" />
339 <ClInclude Include="..\..\includes\machine.h" /> 344 <ClInclude Include="..\..\includes\machine.h" />
340 <ClInclude Include="..\..\includes\md5.h" />
341 <ClInclude Include="..\..\includes\parsecommand.h" /> 345 <ClInclude Include="..\..\includes\parsecommand.h" />
342 <ClInclude Include="..\..\includes\pause.h" /> 346 <ClInclude Include="..\..\includes\pause.h" />
343 <ClInclude Include="..\..\includes\sci_malloc.h" /> 347 <ClInclude Include="..\..\includes\sci_malloc.h" />
diff --git a/scilab/modules/core/src/c/core.vcxproj.filters b/scilab/modules/core/src/c/core.vcxproj.filters
index e6e7577..520ef10 100644
--- a/scilab/modules/core/src/c/core.vcxproj.filters
+++ b/scilab/modules/core/src/c/core.vcxproj.filters
@@ -62,9 +62,6 @@
62 <ClCompile Include="loadversion.c"> 62 <ClCompile Include="loadversion.c">
63 <Filter>Source Files</Filter> 63 <Filter>Source Files</Filter>
64 </ClCompile> 64 </ClCompile>
65 <ClCompile Include="md5.c">
66 <Filter>Source Files</Filter>
67 </ClCompile>
68 <ClCompile Include="returnanan.c"> 65 <ClCompile Include="returnanan.c">
69 <Filter>Source Files</Filter> 66 <Filter>Source Files</Filter>
70 </ClCompile> 67 </ClCompile>
@@ -146,6 +143,9 @@
146 <ClCompile Include="..\cpp\pause.cpp"> 143 <ClCompile Include="..\cpp\pause.cpp">
147 <Filter>Source Files</Filter> 144 <Filter>Source Files</Filter>
148 </ClCompile> 145 </ClCompile>
146 <ClCompile Include="..\cpp\hash\crc32.cpp">
147 <Filter>Source Files</Filter>
148 </ClCompile>
149 </ItemGroup> 149 </ItemGroup>
150 <ItemGroup> 150 <ItemGroup>
151 <None Include="..\..\core.iss" /> 151 <None Include="..\..\core.iss" />
diff --git a/scilab/modules/core/src/c/md5.c b/scilab/modules/core/src/c/md5.c
deleted file mode 100644
index 70d2367..0000000
--- a/scilab/modules/core/src/c/md5.c
+++ /dev/null
@@ -1,451 +0,0 @@
1/*--------------------------------------------------------------------------*/
2/*
3 Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20
21 L. Peter Deutsch
22 ghost@aladdin.com
23
24 Independent implementation of MD5 (RFC 1321).
25
26 This code implements the MD5 Algorithm defined in RFC 1321, whose
27 text is available at
28 http://www.ietf.org/rfc/rfc1321.txt
29 The code is derived from the text of the RFC, including the test suite
30 (section A.5) but excluding the rest of Appendix A. It does not include
31 any code or documentation that is identified in the RFC as being
32 copyrighted.
33
34 The original and principal author of md5.c is L. Peter Deutsch
35 <ghost@aladdin.com>. Other authors are noted in the change history
36 that follows (in reverse chronological order):
37
38 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
39 either statically or dynamically; added missing #include <string.h>
40 in library.
41 2002-03-11 lpd Corrected argument list for main(), and added int return
42 type, in test program and T value program.
43 2002-02-21 lpd Added missing #include <stdio.h> in test program.
44 2000-07-03 lpd Patched to eliminate warnings about "constant is
45 unsigned in ANSI C, signed in traditional"; made test program
46 self-checking.
47 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
48 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
49 1999-05-03 lpd Original version.
50
51 Added in Scilab A.C April 2006
52*/
53/*--------------------------------------------------------------------------*/
54#include "md5.h"
55#include <string.h>
56#include <stdio.h>
57
58#include "sci_malloc.h"
59/*--------------------------------------------------------------------------*/
60#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
61#ifdef ARCH_IS_BIG_ENDIAN
62# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
63#else
64# define BYTE_ORDER 0
65#endif
66
67#define T_MASK ((md5_word_t)~0)
68#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
69#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9)
70#define T3 0x242070db
71#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111)
72#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050)
73#define T6 0x4787c62a
74#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec)
75#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe)
76#define T9 0x698098d8
77#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850)
78#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e)
79#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841)
80#define T13 0x6b901122
81#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c)
82#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71)
83#define T16 0x49b40821
84#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d)
85#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf)
86#define T19 0x265e5a51
87#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855)
88#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2)
89#define T22 0x02441453
90#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e)
91#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437)
92#define T25 0x21e1cde6
93#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829)
94#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278)
95#define T28 0x455a14ed
96#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa)
97#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07)
98#define T31 0x676f02d9
99#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375)
100#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd)
101#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e)
102#define T35 0x6d9d6122
103#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3)
104#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb)
105#define T38 0x4bdecfa9
106#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f)
107#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f)
108#define T41 0x289b7ec6
109#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805)
110#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a)
111#define T44 0x04881d05
112#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6)
113#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a)
114#define T47 0x1fa27cf8
115#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a)
116#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb)
117#define T50 0x432aff97
118#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58)
119#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6)
120#define T53 0x655b59c3
121#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d)
122#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82)
123#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e)
124#define T57 0x6fa87e4f
125#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f)
126#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb)
127#define T60 0x4e0811a1
128#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d)
129#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca)
130#define T63 0x2ad7d2bb
131#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
132/*--------------------------------------------------------------------------*/
133static void md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
134{
135 md5_word_t
136 a = pms->abcd[0], b = pms->abcd[1],
137 c = pms->abcd[2], d = pms->abcd[3];
138 md5_word_t t;
139#if BYTE_ORDER > 0
140 /* Define storage only for big-endian CPUs. */
141 md5_word_t X[16];
142#else
143 /* Define storage for little-endian or both types of CPUs. */
144 md5_word_t xbuf[16];
145 const md5_word_t *X;
146#endif
147 {
148#if BYTE_ORDER == 0
149 /*
150 * Determine dynamically whether this is a big-endian or
151 * little-endian machine, since we can use a more efficient
152 * algorithm on the latter.
153 */
154 static const int w = 1;
155
156 if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
157#endif
158#if BYTE_ORDER <= 0 /* little-endian */
159 {
160 /*
161 * On little-endian machines, we can process properly aligned
162 * data without copying it.
163 */
164 if (!((data - (const md5_byte_t *)0) & 3))
165 {
166 /* data are properly aligned */
167 X = (const md5_word_t *)data;
168 }
169 else
170 {
171 /* not aligned */
172 memcpy(xbuf, data, 64);
173 X = xbuf;
174 }
175 }
176#endif
177#if BYTE_ORDER == 0
178 else /* dynamic big-endian */
179#endif
180#if BYTE_ORDER >= 0 /* big-endian */
181 {
182 /*
183 * On big-endian machines, we must arrange the bytes in the
184 * right order.
185 */
186 const md5_byte_t *xp = data;
187 int i;
188
189# if BYTE_ORDER == 0
190 X = xbuf; /* (dynamic only) */
191# else
192# define xbuf X /* (static only) */
193# endif
194 for (i = 0; i < 16; ++i, xp += 4)
195 {
196 xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
197 }
198 }
199#endif
200 }
201
202#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
203
204 /* Round 1. */
205 /* Let [abcd k s i] denote the operation
206 a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
207#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
208#define SET(a, b, c, d, k, s, Ti)\
209 t = a + F(b,c,d) + X[k] + Ti;\
210 a = ROTATE_LEFT(t, s) + b
211 /* Do the following 16 operations. */
212 SET(a, b, c, d, 0, 7, T1);
213 SET(d, a, b, c, 1, 12, T2);
214 SET(c, d, a, b, 2, 17, T3);
215 SET(b, c, d, a, 3, 22, T4);
216 SET(a, b, c, d, 4, 7, T5);
217 SET(d, a, b, c, 5, 12, T6);
218 SET(c, d, a, b, 6, 17, T7);
219 SET(b, c, d, a, 7, 22, T8);
220 SET(a, b, c, d, 8, 7, T9);
221 SET(d, a, b, c, 9, 12, T10);
222 SET(c, d, a, b, 10, 17, T11);
223 SET(b, c, d, a, 11, 22, T12);
224 SET(a, b, c, d, 12, 7, T13);
225 SET(d, a, b, c, 13, 12, T14);
226 SET(c, d, a, b, 14, 17, T15);
227 SET(b, c, d, a, 15, 22, T16);
228#undef SET
229
230 /* Round 2. */
231 /* Let [abcd k s i] denote the operation
232 a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
233#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
234#define SET(a, b, c, d, k, s, Ti)\
235 t = a + G(b,c,d) + X[k] + Ti;\
236 a = ROTATE_LEFT(t, s) + b
237 /* Do the following 16 operations. */
238 SET(a, b, c, d, 1, 5, T17);
239 SET(d, a, b, c, 6, 9, T18);
240 SET(c, d, a, b, 11, 14, T19);
241 SET(b, c, d, a, 0, 20, T20);
242 SET(a, b, c, d, 5, 5, T21);
243 SET(d, a, b, c, 10, 9, T22);
244 SET(c, d, a, b, 15, 14, T23);
245 SET(b, c, d, a, 4, 20, T24);
246 SET(a, b, c, d, 9, 5, T25);
247 SET(d, a, b, c, 14, 9, T26);
248 SET(c, d, a, b, 3, 14, T27);
249 SET(b, c, d, a, 8, 20, T28);
250 SET(a, b, c, d, 13, 5, T29);
251 SET(d, a, b, c, 2, 9, T30);
252 SET(c, d, a, b, 7, 14, T31);
253 SET(b, c, d, a, 12, 20, T32);
254#undef SET
255
256 /* Round 3. */
257 /* Let [abcd k s t] denote the operation
258 a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
259#define H(x, y, z) ((x) ^ (y) ^ (z))
260#define SET(a, b, c, d, k, s, Ti)\
261 t = a + H(b,c,d) + X[k] + Ti;\
262 a = ROTATE_LEFT(t, s) + b
263 /* Do the following 16 operations. */
264 SET(a, b, c, d, 5, 4, T33);
265 SET(d, a, b, c, 8, 11, T34);
266 SET(c, d, a, b, 11, 16, T35);
267 SET(b, c, d, a, 14, 23, T36);
268 SET(a, b, c, d, 1, 4, T37);
269 SET(d, a, b, c, 4, 11, T38);
270 SET(c, d, a, b, 7, 16, T39);
271 SET(b, c, d, a, 10, 23, T40);
272 SET(a, b, c, d, 13, 4, T41);
273 SET(d, a, b, c, 0, 11, T42);
274 SET(c, d, a, b, 3, 16, T43);
275 SET(b, c, d, a, 6, 23, T44);
276 SET(a, b, c, d, 9, 4, T45);
277 SET(d, a, b, c, 12, 11, T46);
278 SET(c, d, a, b, 15, 16, T47);
279 SET(b, c, d, a, 2, 23, T48);
280#undef SET
281
282 /* Round 4. */
283 /* Let [abcd k s t] denote the operation
284 a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
285#define I(x, y, z) ((y) ^ ((x) | ~(z)))
286#define SET(a, b, c, d, k, s, Ti)\
287 t = a + I(b,c,d) + X[k] + Ti;\
288 a = ROTATE_LEFT(t, s) + b
289 /* Do the following 16 operations. */
290 SET(a, b, c, d, 0, 6, T49);
291 SET(d, a, b, c, 7, 10, T50);
292 SET(c, d, a, b, 14, 15, T51);
293 SET(b, c, d, a, 5, 21, T52);
294 SET(a, b, c, d, 12, 6, T53);
295 SET(d, a, b, c, 3, 10, T54);
296 SET(c, d, a, b, 10, 15, T55);
297 SET(b, c, d, a, 1, 21, T56);
298 SET(a, b, c, d, 8, 6, T57);
299 SET(d, a, b, c, 15, 10, T58);
300 SET(c, d, a, b, 6, 15, T59);
301 SET(b, c, d, a, 13, 21, T60);
302 SET(a, b, c, d, 4, 6, T61);
303 SET(d, a, b, c, 11, 10, T62);
304 SET(c, d, a, b, 2, 15, T63);
305 SET(b, c, d, a, 9, 21, T64);
306#undef SET
307
308 /* Then perform the following additions. (That is increment each
309 of the four registers by the value it had before this block
310 was started.) */
311 pms->abcd[0] += a;
312 pms->abcd[1] += b;
313 pms->abcd[2] += c;
314 pms->abcd[3] += d;
315}
316/*--------------------------------------------------------------------------*/
317void md5_init(md5_state_t *pms)
318{
319 pms->count[0] = pms->count[1] = 0;
320 pms->abcd[0] = 0x67452301;
321 pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
322 pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
323 pms->abcd[3] = 0x10325476;
324}
325/*--------------------------------------------------------------------------*/
326void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
327{
328 const md5_byte_t *p = data;
329 int left = nbytes;
330 int offset = (pms->count[0] >> 3) & 63;
331 md5_word_t nbits = (md5_word_t)(nbytes << 3);
332
333 if (nbytes <= 0)
334 {
335 return;
336 }
337
338 /* Update the message length. */
339 pms->count[1] += nbytes >> 29;
340 pms->count[0] += nbits;
341 if (pms->count[0] < nbits)
342 {
343 pms->count[1]++;
344 }
345
346 /* Process an initial partial block. */
347 if (offset)
348 {
349 int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
350
351 memcpy(pms->buf + offset, p, copy);
352 if (offset + copy < 64)
353 {
354 return;
355 }
356 p += copy;
357 left -= copy;
358 md5_process(pms, pms->buf);
359 }
360
361 /* Process full blocks. */
362 for (; left >= 64; p += 64, left -= 64)
363 {
364 md5_process(pms, p);
365 }
366
367 /* Process a final partial block. */
368 if (left)
369 {
370 memcpy(pms->buf, p, left);
371 }
372}
373/*--------------------------------------------------------------------------*/
374void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
375{
376 static const md5_byte_t pad[64] =
377 {
378 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
382 };
383 md5_byte_t data[8];
384 int i;
385
386 /* Save the length before padding. */
387 for (i = 0; i < 8; ++i)
388 {
389 data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
390 }
391 /* Pad to 56 bytes mod 64. */
392 md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
393 /* Append the length. */
394 md5_append(pms, data, 8);
395 for (i = 0; i < 16; ++i)
396 {
397 digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
398 }
399}
400/*--------------------------------------------------------------------------*/
401/* Hash d'une chaine de caractres */
402/*--------------------------------------------------------------------------*/
403char *md5_str(char *p)
404{
405 md5_state_t state;
406 md5_byte_t digest[16];
407 char *hex_output = (char *)MALLOC(33);
408 int di;
409
410 /* hashage */
411 md5_init(&state);
412 md5_append(&state, (const md5_byte_t *)p, (int)strlen(p));
413 md5_finish(&state, digest);
414
415 /* output */
416 for (di = 0; di < 16; di++)
417 {
418 sprintf(hex_output + di * 2, "%02x", digest[di]);
419 }
420 return hex_output;
421}
422/*--------------------------------------------------------------------------*/
423/* Hash d'un fichier */
424/*--------------------------------------------------------------------------*/
425char *md5_file(FILE *fp)
426{
427 md5_state_t state;
428 md5_byte_t digest[16];
429 char data[64];
430 int di;
431 size_t ln;
432 char *hex_output = (char *)MALLOC(33);
433
434 /* hashage */
435 md5_init(&state);
436 while (!feof(fp))
437 {
438 ln = fread(data, 1, sizeof(data), fp);
439 md5_append(&state, (const md5_byte_t *)data, (int)ln);
440 }
441 md5_finish(&state, digest);
442
443 /* output */
444 for (di = 0; di < 16; di++)
445 {
446 sprintf(hex_output + di * 2, "%02x", digest[di]);
447 }
448 return hex_output;
449}
450/*--------------------------------------------------------------------------*/
451
diff --git a/scilab/modules/core/src/cpp/hash/LICENSE.txt b/scilab/modules/core/src/cpp/hash/LICENSE.txt
new file mode 100644
index 0000000..e540da6
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/LICENSE.txt
@@ -0,0 +1,10 @@
1zlib License
2
3Copyright (c) 2014,2015 Stephan Brumme
4
5This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
6Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
71. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
8 If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
92. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
103. This notice may not be removed or altered from any source distribution.
diff --git a/scilab/modules/core/src/cpp/hash/crc32.cpp b/scilab/modules/core/src/cpp/hash/crc32.cpp
new file mode 100644
index 0000000..cebbe53
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/crc32.cpp
@@ -0,0 +1,425 @@
1// //////////////////////////////////////////////////////////
2// crc32.cpp
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#include "crc32.hxx"
8
9/// same as reset()
10CRC32::CRC32()
11{
12 reset();
13}
14
15
16/// restart
17void CRC32::reset()
18{
19 m_hash = 0;
20}
21
22
23namespace
24{
25 /// look-up table
26 static const uint32_t crc32Lookup[8][256] =
27 {
28 // generated by:
29 //for (uint32_t i = 0; i <= 0xFF; i++)
30 //{
31 // uint32_t crc = i;
32 // for (unsigned int j = 0; j < 8; j++)
33 // crc = (crc >> 1) ^ ((crc & 1) * Polynomial);
34 // crc32Lookup[0][i] = crc;
35 //}
36 // slicing-by-8 algorithm (from Intel):
37 // http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf
38 // http://sourceforge.net/projects/slicing-by-8/
39 //for (unsigned int i = 0; i <= 0xFF; i++)
40 //{
41 // crc32Lookup[1][i] = (crc32Lookup[0][i] >> 8) ^ crc32Lookup[0][crc32Lookup[0][i] & 0xFF];
42 // crc32Lookup[2][i] = (crc32Lookup[1][i] >> 8) ^ crc32Lookup[0][crc32Lookup[1][i] & 0xFF];
43 // crc32Lookup[3][i] = (crc32Lookup[2][i] >> 8) ^ crc32Lookup[0][crc32Lookup[2][i] & 0xFF];
44
45 // crc32Lookup[4][i] = (crc32Lookup[3][i] >> 8) ^ crc32Lookup[0][crc32Lookup[3][i] & 0xFF];
46 // crc32Lookup[5][i] = (crc32Lookup[4][i] >> 8) ^ crc32Lookup[0][crc32Lookup[4][i] & 0xFF];
47 // crc32Lookup[6][i] = (crc32Lookup[5][i] >> 8) ^ crc32Lookup[0][crc32Lookup[5][i] & 0xFF];
48 // crc32Lookup[7][i] = (crc32Lookup[6][i] >> 8) ^ crc32Lookup[0][crc32Lookup[6][i] & 0xFF];
49 //}
50 { 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,
51 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,
52 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,
53 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,
54 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,
55 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,
56 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,
57 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D,
58 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433,
59 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01,
60 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,
61 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,
62 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,
63 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9,
64 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F,
65 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD,
66 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,
67 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,
68 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,
69 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,
70 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,
71 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79,
72 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F,
73 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,
74 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,
75 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,
76 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,
77 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,
78 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,
79 0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9,
80 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,
81 0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D },
82
83 { 0x00000000,0x191B3141,0x32366282,0x2B2D53C3,0x646CC504,0x7D77F445,0x565AA786,0x4F4196C7,
84 0xC8D98A08,0xD1C2BB49,0xFAEFE88A,0xE3F4D9CB,0xACB54F0C,0xB5AE7E4D,0x9E832D8E,0x87981CCF,
85 0x4AC21251,0x53D92310,0x78F470D3,0x61EF4192,0x2EAED755,0x37B5E614,0x1C98B5D7,0x05838496,
86 0x821B9859,0x9B00A918,0xB02DFADB,0xA936CB9A,0xE6775D5D,0xFF6C6C1C,0xD4413FDF,0xCD5A0E9E,
87 0x958424A2,0x8C9F15E3,0xA7B24620,0xBEA97761,0xF1E8E1A6,0xE8F3D0E7,0xC3DE8324,0xDAC5B265,
88 0x5D5DAEAA,0x44469FEB,0x6F6BCC28,0x7670FD69,0x39316BAE,0x202A5AEF,0x0B07092C,0x121C386D,
89 0xDF4636F3,0xC65D07B2,0xED705471,0xF46B6530,0xBB2AF3F7,0xA231C2B6,0x891C9175,0x9007A034,
90 0x179FBCFB,0x0E848DBA,0x25A9DE79,0x3CB2EF38,0x73F379FF,0x6AE848BE,0x41C51B7D,0x58DE2A3C,
91 0xF0794F05,0xE9627E44,0xC24F2D87,0xDB541CC6,0x94158A01,0x8D0EBB40,0xA623E883,0xBF38D9C2,
92 0x38A0C50D,0x21BBF44C,0x0A96A78F,0x138D96CE,0x5CCC0009,0x45D73148,0x6EFA628B,0x77E153CA,
93 0xBABB5D54,0xA3A06C15,0x888D3FD6,0x91960E97,0xDED79850,0xC7CCA911,0xECE1FAD2,0xF5FACB93,
94 0x7262D75C,0x6B79E61D,0x4054B5DE,0x594F849F,0x160E1258,0x0F152319,0x243870DA,0x3D23419B,
95 0x65FD6BA7,0x7CE65AE6,0x57CB0925,0x4ED03864,0x0191AEA3,0x188A9FE2,0x33A7CC21,0x2ABCFD60,
96 0xAD24E1AF,0xB43FD0EE,0x9F12832D,0x8609B26C,0xC94824AB,0xD05315EA,0xFB7E4629,0xE2657768,
97 0x2F3F79F6,0x362448B7,0x1D091B74,0x04122A35,0x4B53BCF2,0x52488DB3,0x7965DE70,0x607EEF31,
98 0xE7E6F3FE,0xFEFDC2BF,0xD5D0917C,0xCCCBA03D,0x838A36FA,0x9A9107BB,0xB1BC5478,0xA8A76539,
99 0x3B83984B,0x2298A90A,0x09B5FAC9,0x10AECB88,0x5FEF5D4F,0x46F46C0E,0x6DD93FCD,0x74C20E8C,
100 0xF35A1243,0xEA412302,0xC16C70C1,0xD8774180,0x9736D747,0x8E2DE606,0xA500B5C5,0xBC1B8484,
101 0x71418A1A,0x685ABB5B,0x4377E898,0x5A6CD9D9,0x152D4F1E,0x0C367E5F,0x271B2D9C,0x3E001CDD,
102 0xB9980012,0xA0833153,0x8BAE6290,0x92B553D1,0xDDF4C516,0xC4EFF457,0xEFC2A794,0xF6D996D5,
103 0xAE07BCE9,0xB71C8DA8,0x9C31DE6B,0x852AEF2A,0xCA6B79ED,0xD37048AC,0xF85D1B6F,0xE1462A2E,
104 0x66DE36E1,0x7FC507A0,0x54E85463,0x4DF36522,0x02B2F3E5,0x1BA9C2A4,0x30849167,0x299FA026,
105 0xE4C5AEB8,0xFDDE9FF9,0xD6F3CC3A,0xCFE8FD7B,0x80A96BBC,0x99B25AFD,0xB29F093E,0xAB84387F,
106 0x2C1C24B0,0x350715F1,0x1E2A4632,0x07317773,0x4870E1B4,0x516BD0F5,0x7A468336,0x635DB277,
107 0xCBFAD74E,0xD2E1E60F,0xF9CCB5CC,0xE0D7848D,0xAF96124A,0xB68D230B,0x9DA070C8,0x84BB4189,
108 0x03235D46,0x1A386C07,0x31153FC4,0x280E0E85,0x674F9842,0x7E54A903,0x5579FAC0,0x4C62CB81,
109 0x8138C51F,0x9823F45E,0xB30EA79D,0xAA1596DC,0xE554001B,0xFC4F315A,0xD7626299,0xCE7953D8,
110 0x49E14F17,0x50FA7E56,0x7BD72D95,0x62CC1CD4,0x2D8D8A13,0x3496BB52,0x1FBBE891,0x06A0D9D0,
111 0x5E7EF3EC,0x4765C2AD,0x6C48916E,0x7553A02F,0x3A1236E8,0x230907A9,0x0824546A,0x113F652B,
112 0x96A779E4,0x8FBC48A5,0xA4911B66,0xBD8A2A27,0xF2CBBCE0,0xEBD08DA1,0xC0FDDE62,0xD9E6EF23,
113 0x14BCE1BD,0x0DA7D0FC,0x268A833F,0x3F91B27E,0x70D024B9,0x69CB15F8,0x42E6463B,0x5BFD777A,
114 0xDC656BB5,0xC57E5AF4,0xEE530937,0xF7483876,0xB809AEB1,0xA1129FF0,0x8A3FCC33,0x9324FD72 },
115
116 { 0x00000000,0x01C26A37,0x0384D46E,0x0246BE59,0x0709A8DC,0x06CBC2EB,0x048D7CB2,0x054F1685,
117 0x0E1351B8,0x0FD13B8F,0x0D9785D6,0x0C55EFE1,0x091AF964,0x08D89353,0x0A9E2D0A,0x0B5C473D,
118 0x1C26A370,0x1DE4C947,0x1FA2771E,0x1E601D29,0x1B2F0BAC,0x1AED619B,0x18ABDFC2,0x1969B5F5,
119 0x1235F2C8,0x13F798FF,0x11B126A6,0x10734C91,0x153C5A14,0x14FE3023,0x16B88E7A,0x177AE44D,
120 0x384D46E0,0x398F2CD7,0x3BC9928E,0x3A0BF8B9,0x3F44EE3C,0x3E86840B,0x3CC03A52,0x3D025065,
121 0x365E1758,0x379C7D6F,0x35DAC336,0x3418A901,0x3157BF84,0x3095D5B3,0x32D36BEA,0x331101DD,
122 0x246BE590,0x25A98FA7,0x27EF31FE,0x262D5BC9,0x23624D4C,0x22A0277B,0x20E69922,0x2124F315,
123 0x2A78B428,0x2BBADE1F,0x29FC6046,0x283E0A71,0x2D711CF4,0x2CB376C3,0x2EF5C89A,0x2F37A2AD,
124 0x709A8DC0,0x7158E7F7,0x731E59AE,0x72DC3399,0x7793251C,0x76514F2B,0x7417F172,0x75D59B45,
125 0x7E89DC78,0x7F4BB64F,0x7D0D0816,0x7CCF6221,0x798074A4,0x78421E93,0x7A04A0CA,0x7BC6CAFD,
126 0x6CBC2EB0,0x6D7E4487,0x6F38FADE,0x6EFA90E9,0x6BB5866C,0x6A77EC5B,0x68315202,0x69F33835,
127 0x62AF7F08,0x636D153F,0x612BAB66,0x60E9C151,0x65A6D7D4,0x6464BDE3,0x662203BA,0x67E0698D,
128 0x48D7CB20,0x4915A117,0x4B531F4E,0x4A917579,0x4FDE63FC,0x4E1C09CB,0x4C5AB792,0x4D98DDA5,
129 0x46C49A98,0x4706F0AF,0x45404EF6,0x448224C1,0x41CD3244,0x400F5873,0x4249E62A,0x438B8C1D,
130 0x54F16850,0x55330267,0x5775BC3E,0x56B7D609,0x53F8C08C,0x523AAABB,0x507C14E2,0x51BE7ED5,
131 0x5AE239E8,0x5B2053DF,0x5966ED86,0x58A487B1,0x5DEB9134,0x5C29FB03,0x5E6F455A,0x5FAD2F6D,
132 0xE1351B80,0xE0F771B7,0xE2B1CFEE,0xE373A5D9,0xE63CB35C,0xE7FED96B,0xE5B86732,0xE47A0D05,
133 0xEF264A38,0xEEE4200F,0xECA29E56,0xED60F461,0xE82FE2E4,0xE9ED88D3,0xEBAB368A,0xEA695CBD,
134 0xFD13B8F0,0xFCD1D2C7,0xFE976C9E,0xFF5506A9,0xFA1A102C,0xFBD87A1B,0xF99EC442,0xF85CAE75,
135 0xF300E948,0xF2C2837F,0xF0843D26,0xF1465711,0xF4094194,0xF5CB2BA3,0xF78D95FA,0xF64FFFCD,
136 0xD9785D60,0xD8BA3757,0xDAFC890E,0xDB3EE339,0xDE71F5BC,0xDFB39F8B,0xDDF521D2,0xDC374BE5,
137 0xD76B0CD8,0xD6A966EF,0xD4EFD8B6,0xD52DB281,0xD062A404,0xD1A0CE33,0xD3E6706A,0xD2241A5D,
138 0xC55EFE10,0xC49C9427,0xC6DA2A7E,0xC7184049,0xC25756CC,0xC3953CFB,0xC1D382A2,0xC011E895,
139 0xCB4DAFA8,0xCA8FC59F,0xC8C97BC6,0xC90B11F1,0xCC440774,0xCD866D43,0xCFC0D31A,0xCE02B92D,
140 0x91AF9640,0x906DFC77,0x922B422E,0x93E92819,0x96A63E9C,0x976454AB,0x9522EAF2,0x94E080C5,
141 0x9FBCC7F8,0x9E7EADCF,0x9C381396,0x9DFA79A1,0x98B56F24,0x99770513,0x9B31BB4A,0x9AF3D17D,
142 0x8D893530,0x8C4B5F07,0x8E0DE15E,0x8FCF8B69,0x8A809DEC,0x8B42F7DB,0x89044982,0x88C623B5,
143 0x839A6488,0x82580EBF,0x801EB0E6,0x81DCDAD1,0x8493CC54,0x8551A663,0x8717183A,0x86D5720D,
144 0xA9E2D0A0,0xA820BA97,0xAA6604CE,0xABA46EF9,0xAEEB787C,0xAF29124B,0xAD6FAC12,0xACADC625,
145 0xA7F18118,0xA633EB2F,0xA4755576,0xA5B73F41,0xA0F829C4,0xA13A43F3,0xA37CFDAA,0xA2BE979D,
146 0xB5C473D0,0xB40619E7,0xB640A7BE,0xB782CD89,0xB2CDDB0C,0xB30FB13B,0xB1490F62,0xB08B6555,
147 0xBBD72268,0xBA15485F,0xB853F606,0xB9919C31,0xBCDE8AB4,0xBD1CE083,0xBF5A5EDA,0xBE9834ED },
148
149 { 0x00000000,0xB8BC6765,0xAA09C88B,0x12B5AFEE,0x8F629757,0x37DEF032,0x256B5FDC,0x9DD738B9,
150 0xC5B428EF,0x7D084F8A,0x6FBDE064,0xD7018701,0x4AD6BFB8,0xF26AD8DD,0xE0DF7733,0x58631056,
151 0x5019579F,0xE8A530FA,0xFA109F14,0x42ACF871,0xDF7BC0C8,0x67C7A7AD,0x75720843,0xCDCE6F26,
152 0x95AD7F70,0x2D111815,0x3FA4B7FB,0x8718D09E,0x1ACFE827,0xA2738F42,0xB0C620AC,0x087A47C9,
153 0xA032AF3E,0x188EC85B,0x0A3B67B5,0xB28700D0,0x2F503869,0x97EC5F0C,0x8559F0E2,0x3DE59787,
154 0x658687D1,0xDD3AE0B4,0xCF8F4F5A,0x7733283F,0xEAE41086,0x525877E3,0x40EDD80D,0xF851BF68,
155 0xF02BF8A1,0x48979FC4,0x5A22302A,0xE29E574F,0x7F496FF6,0xC7F50893,0xD540A77D,0x6DFCC018,
156 0x359FD04E,0x8D23B72B,0x9F9618C5,0x272A7FA0,0xBAFD4719,0x0241207C,0x10F48F92,0xA848E8F7,
157 0x9B14583D,0x23A83F58,0x311D90B6,0x89A1F7D3,0x1476CF6A,0xACCAA80F,0xBE7F07E1,0x06C36084,
158 0x5EA070D2,0xE61C17B7,0xF4A9B859,0x4C15DF3C,0xD1C2E785,0x697E80E0,0x7BCB2F0E,0xC377486B,
159 0xCB0D0FA2,0x73B168C7,0x6104C729,0xD9B8A04C,0x446F98F5,0xFCD3FF90,0xEE66507E,0x56DA371B,
160 0x0EB9274D,0xB6054028,0xA4B0EFC6,0x1C0C88A3,0x81DBB01A,0x3967D77F,0x2BD27891,0x936E1FF4,
161 0x3B26F703,0x839A9066,0x912F3F88,0x299358ED,0xB4446054,0x0CF80731,0x1E4DA8DF,0xA6F1CFBA,
162 0xFE92DFEC,0x462EB889,0x549B1767,0xEC277002,0x71F048BB,0xC94C2FDE,0xDBF98030,0x6345E755,
163 0x6B3FA09C,0xD383C7F9,0xC1366817,0x798A0F72,0xE45D37CB,0x5CE150AE,0x4E54FF40,0xF6E89825,
164 0xAE8B8873,0x1637EF16,0x048240F8,0xBC3E279D,0x21E91F24,0x99557841,0x8BE0D7AF,0x335CB0CA,
165 0xED59B63B,0x55E5D15E,0x47507EB0,0xFFEC19D5,0x623B216C,0xDA874609,0xC832E9E7,0x708E8E82,
166 0x28ED9ED4,0x9051F9B1,0x82E4565F,0x3A58313A,0xA78F0983,0x1F336EE6,0x0D86C108,0xB53AA66D,
167 0xBD40E1A4,0x05FC86C1,0x1749292F,0xAFF54E4A,0x322276F3,0x8A9E1196,0x982BBE78,0x2097D91D,
168 0x78F4C94B,0xC048AE2E,0xD2FD01C0,0x6A4166A5,0xF7965E1C,0x4F2A3979,0x5D9F9697,0xE523F1F2,
169 0x4D6B1905,0xF5D77E60,0xE762D18E,0x5FDEB6EB,0xC2098E52,0x7AB5E937,0x680046D9,0xD0BC21BC,
170 0x88DF31EA,0x3063568F,0x22D6F961,0x9A6A9E04,0x07BDA6BD,0xBF01C1D8,0xADB46E36,0x15080953,
171 0x1D724E9A,0xA5CE29FF,0xB77B8611,0x0FC7E174,0x9210D9CD,0x2AACBEA8,0x38191146,0x80A57623,
172 0xD8C66675,0x607A0110,0x72CFAEFE,0xCA73C99B,0x57A4F122,0xEF189647,0xFDAD39A9,0x45115ECC,
173 0x764DEE06,0xCEF18963,0xDC44268D,0x64F841E8,0xF92F7951,0x41931E34,0x5326B1DA,0xEB9AD6BF,
174 0xB3F9C6E9,0x0B45A18C,0x19F00E62,0xA14C6907,0x3C9B51BE,0x842736DB,0x96929935,0x2E2EFE50,
175 0x2654B999,0x9EE8DEFC,0x8C5D7112,0x34E11677,0xA9362ECE,0x118A49AB,0x033FE645,0xBB838120,
176 0xE3E09176,0x5B5CF613,0x49E959FD,0xF1553E98,0x6C820621,0xD43E6144,0xC68BCEAA,0x7E37A9CF,
177 0xD67F4138,0x6EC3265D,0x7C7689B3,0xC4CAEED6,0x591DD66F,0xE1A1B10A,0xF3141EE4,0x4BA87981,
178 0x13CB69D7,0xAB770EB2,0xB9C2A15C,0x017EC639,0x9CA9FE80,0x241599E5,0x36A0360B,0x8E1C516E,
179 0x866616A7,0x3EDA71C2,0x2C6FDE2C,0x94D3B949,0x090481F0,0xB1B8E695,0xA30D497B,0x1BB12E1E,
180 0x43D23E48,0xFB6E592D,0xE9DBF6C3,0x516791A6,0xCCB0A91F,0x740CCE7A,0x66B96194,0xDE0506F1 },
181
182 { 0x00000000,0x3D6029B0,0x7AC05360,0x47A07AD0,0xF580A6C0,0xC8E08F70,0x8F40F5A0,0xB220DC10,
183 0x30704BC1,0x0D106271,0x4AB018A1,0x77D03111,0xC5F0ED01,0xF890C4B1,0xBF30BE61,0x825097D1,
184 0x60E09782,0x5D80BE32,0x1A20C4E2,0x2740ED52,0x95603142,0xA80018F2,0xEFA06222,0xD2C04B92,
185 0x5090DC43,0x6DF0F5F3,0x2A508F23,0x1730A693,0xA5107A83,0x98705333,0xDFD029E3,0xE2B00053,
186 0xC1C12F04,0xFCA106B4,0xBB017C64,0x866155D4,0x344189C4,0x0921A074,0x4E81DAA4,0x73E1F314,
187 0xF1B164C5,0xCCD14D75,0x8B7137A5,0xB6111E15,0x0431C205,0x3951EBB5,0x7EF19165,0x4391B8D5,
188 0xA121B886,0x9C419136,0xDBE1EBE6,0xE681C256,0x54A11E46,0x69C137F6,0x2E614D26,0x13016496,
189 0x9151F347,0xAC31DAF7,0xEB91A027,0xD6F18997,0x64D15587,0x59B17C37,0x1E1106E7,0x23712F57,
190 0x58F35849,0x659371F9,0x22330B29,0x1F532299,0xAD73FE89,0x9013D739,0xD7B3ADE9,0xEAD38459,
191 0x68831388,0x55E33A38,0x124340E8,0x2F236958,0x9D03B548,0xA0639CF8,0xE7C3E628,0xDAA3CF98,
192 0x3813CFCB,0x0573E67B,0x42D39CAB,0x7FB3B51B,0xCD93690B,0xF0F340BB,0xB7533A6B,0x8A3313DB,
193 0x0863840A,0x3503ADBA,0x72A3D76A,0x4FC3FEDA,0xFDE322CA,0xC0830B7A,0x872371AA,0xBA43581A,
194 0x9932774D,0xA4525EFD,0xE3F2242D,0xDE920D9D,0x6CB2D18D,0x51D2F83D,0x167282ED,0x2B12AB5D,
195 0xA9423C8C,0x9422153C,0xD3826FEC,0xEEE2465C,0x5CC29A4C,0x61A2B3FC,0x2602C92C,0x1B62E09C,
196 0xF9D2E0CF,0xC4B2C97F,0x8312B3AF,0xBE729A1F,0x0C52460F,0x31326FBF,0x7692156F,0x4BF23CDF,
197 0xC9A2AB0E,0xF4C282BE,0xB362F86E,0x8E02D1DE,0x3C220DCE,0x0142247E,0x46E25EAE,0x7B82771E,
198 0xB1E6B092,0x8C869922,0xCB26E3F2,0xF646CA42,0x44661652,0x79063FE2,0x3EA64532,0x03C66C82,
199 0x8196FB53,0xBCF6D2E3,0xFB56A833,0xC6368183,0x74165D93,0x49767423,0x0ED60EF3,0x33B62743,
200 0xD1062710,0xEC660EA0,0xABC67470,0x96A65DC0,0x248681D0,0x19E6A860,0x5E46D2B0,0x6326FB00,
201 0xE1766CD1,0xDC164561,0x9BB63FB1,0xA6D61601,0x14F6CA11,0x2996E3A1,0x6E369971,0x5356B0C1,
202 0x70279F96,0x4D47B626,0x0AE7CCF6,0x3787E546,0x85A73956,0xB8C710E6,0xFF676A36,0xC2074386,
203 0x4057D457,0x7D37FDE7,0x3A978737,0x07F7AE87,0xB5D77297,0x88B75B27,0xCF1721F7,0xF2770847,
204 0x10C70814,0x2DA721A4,0x6A075B74,0x576772C4,0xE547AED4,0xD8278764,0x9F87FDB4,0xA2E7D404,
205 0x20B743D5,0x1DD76A65,0x5A7710B5,0x67173905,0xD537E515,0xE857CCA5,0xAFF7B675,0x92979FC5,
206 0xE915E8DB,0xD475C16B,0x93D5BBBB,0xAEB5920B,0x1C954E1B,0x21F567AB,0x66551D7B,0x5B3534CB,
207 0xD965A31A,0xE4058AAA,0xA3A5F07A,0x9EC5D9CA,0x2CE505DA,0x11852C6A,0x562556BA,0x6B457F0A,
208 0x89F57F59,0xB49556E9,0xF3352C39,0xCE550589,0x7C75D999,0x4115F029,0x06B58AF9,0x3BD5A349,
209 0xB9853498,0x84E51D28,0xC34567F8,0xFE254E48,0x4C059258,0x7165BBE8,0x36C5C138,0x0BA5E888,
210 0x28D4C7DF,0x15B4EE6F,0x521494BF,0x6F74BD0F,0xDD54611F,0xE03448AF,0xA794327F,0x9AF41BCF,
211 0x18A48C1E,0x25C4A5AE,0x6264DF7E,0x5F04F6CE,0xED242ADE,0xD044036E,0x97E479BE,0xAA84500E,
212 0x4834505D,0x755479ED,0x32F4033D,0x0F942A8D,0xBDB4F69D,0x80D4DF2D,0xC774A5FD,0xFA148C4D,
213 0x78441B9C,0x4524322C,0x028448FC,0x3FE4614C,0x8DC4BD5C,0xB0A494EC,0xF704EE3C,0xCA64C78C },
214
215 { 0x00000000,0xCB5CD3A5,0x4DC8A10B,0x869472AE,0x9B914216,0x50CD91B3,0xD659E31D,0x1D0530B8,
216 0xEC53826D,0x270F51C8,0xA19B2366,0x6AC7F0C3,0x77C2C07B,0xBC9E13DE,0x3A0A6170,0xF156B2D5,
217 0x03D6029B,0xC88AD13E,0x4E1EA390,0x85427035,0x9847408D,0x531B9328,0xD58FE186,0x1ED33223,
218 0xEF8580F6,0x24D95353,0xA24D21FD,0x6911F258,0x7414C2E0,0xBF481145,0x39DC63EB,0xF280B04E,
219 0x07AC0536,0xCCF0D693,0x4A64A43D,0x81387798,0x9C3D4720,0x57619485,0xD1F5E62B,0x1AA9358E,
220 0xEBFF875B,0x20A354FE,0xA6372650,0x6D6BF5F5,0x706EC54D,0xBB3216E8,0x3DA66446,0xF6FAB7E3,
221 0x047A07AD,0xCF26D408,0x49B2A6A6,0x82EE7503,0x9FEB45BB,0x54B7961E,0xD223E4B0,0x197F3715,
222 0xE82985C0,0x23755665,0xA5E124CB,0x6EBDF76E,0x73B8C7D6,0xB8E41473,0x3E7066DD,0xF52CB578,
223 0x0F580A6C,0xC404D9C9,0x4290AB67,0x89CC78C2,0x94C9487A,0x5F959BDF,0xD901E971,0x125D3AD4,
224 0xE30B8801,0x28575BA4,0xAEC3290A,0x659FFAAF,0x789ACA17,0xB3C619B2,0x35526B1C,0xFE0EB8B9,
225 0x0C8E08F7,0xC7D2DB52,0x4146A9FC,0x8A1A7A59,0x971F4AE1,0x5C439944,0xDAD7EBEA,0x118B384F,
226 0xE0DD8A9A,0x2B81593F,0xAD152B91,0x6649F834,0x7B4CC88C,0xB0101B29,0x36846987,0xFDD8BA22,
227 0x08F40F5A,0xC3A8DCFF,0x453CAE51,0x8E607DF4,0x93654D4C,0x58399EE9,0xDEADEC47,0x15F13FE2,
228 0xE4A78D37,0x2FFB5E92,0xA96F2C3C,0x6233FF99,0x7F36CF21,0xB46A1C84,0x32FE6E2A,0xF9A2BD8F,
229 0x0B220DC1,0xC07EDE64,0x46EAACCA,0x8DB67F6F,0x90B34FD7,0x5BEF9C72,0xDD7BEEDC,0x16273D79,
230 0xE7718FAC,0x2C2D5C09,0xAAB92EA7,0x61E5FD02,0x7CE0CDBA,0xB7BC1E1F,0x31286CB1,0xFA74BF14,
231 0x1EB014D8,0xD5ECC77D,0x5378B5D3,0x98246676,0x852156CE,0x4E7D856B,0xC8E9F7C5,0x03B52460,
232 0xF2E396B5,0x39BF4510,0xBF2B37BE,0x7477E41B,0x6972D4A3,0xA22E0706,0x24BA75A8,0xEFE6A60D,
233 0x1D661643,0xD63AC5E6,0x50AEB748,0x9BF264ED,0x86F75455,0x4DAB87F0,0xCB3FF55E,0x006326FB,
234 0xF135942E,0x3A69478B,0xBCFD3525,0x77A1E680,0x6AA4D638,0xA1F8059D,0x276C7733,0xEC30A496,
235 0x191C11EE,0xD240C24B,0x54D4B0E5,0x9F886340,0x828D53F8,0x49D1805D,0xCF45F2F3,0x04192156,
236 0xF54F9383,0x3E134026,0xB8873288,0x73DBE12D,0x6EDED195,0xA5820230,0x2316709E,0xE84AA33B,
237 0x1ACA1375,0xD196C0D0,0x5702B27E,0x9C5E61DB,0x815B5163,0x4A0782C6,0xCC93F068,0x07CF23CD,
238 0xF6999118,0x3DC542BD,0xBB513013,0x700DE3B6,0x6D08D30E,0xA65400AB,0x20C07205,0xEB9CA1A0,
239 0x11E81EB4,0xDAB4CD11,0x5C20BFBF,0x977C6C1A,0x8A795CA2,0x41258F07,0xC7B1FDA9,0x0CED2E0C,
240 0xFDBB9CD9,0x36E74F7C,0xB0733DD2,0x7B2FEE77,0x662ADECF,0xAD760D6A,0x2BE27FC4,0xE0BEAC61,
241 0x123E1C2F,0xD962CF8A,0x5FF6BD24,0x94AA6E81,0x89AF5E39,0x42F38D9C,0xC467FF32,0x0F3B2C97,
242 0xFE6D9E42,0x35314DE7,0xB3A53F49,0x78F9ECEC,0x65FCDC54,0xAEA00FF1,0x28347D5F,0xE368AEFA,
243 0x16441B82,0xDD18C827,0x5B8CBA89,0x90D0692C,0x8DD55994,0x46898A31,0xC01DF89F,0x0B412B3A,
244 0xFA1799EF,0x314B4A4A,0xB7DF38E4,0x7C83EB41,0x6186DBF9,0xAADA085C,0x2C4E7AF2,0xE712A957,
245 0x15921919,0xDECECABC,0x585AB812,0x93066BB7,0x8E035B0F,0x455F88AA,0xC3CBFA04,0x089729A1,
246 0xF9C19B74,0x329D48D1,0xB4093A7F,0x7F55E9DA,0x6250D962,0xA90C0AC7,0x2F987869,0xE4C4ABCC },
247
248 { 0x00000000,0xA6770BB4,0x979F1129,0x31E81A9D,0xF44F2413,0x52382FA7,0x63D0353A,0xC5A73E8E,
249 0x33EF4E67,0x959845D3,0xA4705F4E,0x020754FA,0xC7A06A74,0x61D761C0,0x503F7B5D,0xF64870E9,
250 0x67DE9CCE,0xC1A9977A,0xF0418DE7,0x56368653,0x9391B8DD,0x35E6B369,0x040EA9F4,0xA279A240,
251 0x5431D2A9,0xF246D91D,0xC3AEC380,0x65D9C834,0xA07EF6BA,0x0609FD0E,0x37E1E793,0x9196EC27,
252 0xCFBD399C,0x69CA3228,0x582228B5,0xFE552301,0x3BF21D8F,0x9D85163B,0xAC6D0CA6,0x0A1A0712,
253 0xFC5277FB,0x5A257C4F,0x6BCD66D2,0xCDBA6D66,0x081D53E8,0xAE6A585C,0x9F8242C1,0x39F54975,
254 0xA863A552,0x0E14AEE6,0x3FFCB47B,0x998BBFCF,0x5C2C8141,0xFA5B8AF5,0xCBB39068,0x6DC49BDC,
255 0x9B8CEB35,0x3DFBE081,0x0C13FA1C,0xAA64F1A8,0x6FC3CF26,0xC9B4C492,0xF85CDE0F,0x5E2BD5BB,
256 0x440B7579,0xE27C7ECD,0xD3946450,0x75E36FE4,0xB044516A,0x16335ADE,0x27DB4043,0x81AC4BF7,
257 0x77E43B1E,0xD19330AA,0xE07B2A37,0x460C2183,0x83AB1F0D,0x25DC14B9,0x14340E24,0xB2430590,
258 0x23D5E9B7,0x85A2E203,0xB44AF89E,0x123DF32A,0xD79ACDA4,0x71EDC610,0x4005DC8D,0xE672D739,
259 0x103AA7D0,0xB64DAC64,0x87A5B6F9,0x21D2BD4D,0xE47583C3,0x42028877,0x73EA92EA,0xD59D995E,
260 0x8BB64CE5,0x2DC14751,0x1C295DCC,0xBA5E5678,0x7FF968F6,0xD98E6342,0xE86679DF,0x4E11726B,
261 0xB8590282,0x1E2E0936,0x2FC613AB,0x89B1181F,0x4C162691,0xEA612D25,0xDB8937B8,0x7DFE3C0C,
262 0xEC68D02B,0x4A1FDB9F,0x7BF7C102,0xDD80CAB6,0x1827F438,0xBE50FF8C,0x8FB8E511,0x29CFEEA5,
263 0xDF879E4C,0x79F095F8,0x48188F65,0xEE6F84D1,0x2BC8BA5F,0x8DBFB1EB,0xBC57AB76,0x1A20A0C2,
264 0x8816EAF2,0x2E61E146,0x1F89FBDB,0xB9FEF06F,0x7C59CEE1,0xDA2EC555,0xEBC6DFC8,0x4DB1D47C,
265 0xBBF9A495,0x1D8EAF21,0x2C66B5BC,0x8A11BE08,0x4FB68086,0xE9C18B32,0xD82991AF,0x7E5E9A1B,
266 0xEFC8763C,0x49BF7D88,0x78576715,0xDE206CA1,0x1B87522F,0xBDF0599B,0x8C184306,0x2A6F48B2,
267 0xDC27385B,0x7A5033EF,0x4BB82972,0xEDCF22C6,0x28681C48,0x8E1F17FC,0xBFF70D61,0x198006D5,
268 0x47ABD36E,0xE1DCD8DA,0xD034C247,0x7643C9F3,0xB3E4F77D,0x1593FCC9,0x247BE654,0x820CEDE0,
269 0x74449D09,0xD23396BD,0xE3DB8C20,0x45AC8794,0x800BB91A,0x267CB2AE,0x1794A833,0xB1E3A387,
270 0x20754FA0,0x86024414,0xB7EA5E89,0x119D553D,0xD43A6BB3,0x724D6007,0x43A57A9A,0xE5D2712E,
271 0x139A01C7,0xB5ED0A73,0x840510EE,0x22721B5A,0xE7D525D4,0x41A22E60,0x704A34FD,0xD63D3F49,
272 0xCC1D9F8B,0x6A6A943F,0x5B828EA2,0xFDF58516,0x3852BB98,0x9E25B02C,0xAFCDAAB1,0x09BAA105,
273 0xFFF2D1EC,0x5985DA58,0x686DC0C5,0xCE1ACB71,0x0BBDF5FF,0xADCAFE4B,0x9C22E4D6,0x3A55EF62,
274 0xABC30345,0x0DB408F1,0x3C5C126C,0x9A2B19D8,0x5F8C2756,0xF9FB2CE2,0xC813367F,0x6E643DCB,
275 0x982C4D22,0x3E5B4696,0x0FB35C0B,0xA9C457BF,0x6C636931,0xCA146285,0xFBFC7818,0x5D8B73AC,
276 0x03A0A617,0xA5D7ADA3,0x943FB73E,0x3248BC8A,0xF7EF8204,0x519889B0,0x6070932D,0xC6079899,
277 0x304FE870,0x9638E3C4,0xA7D0F959,0x01A7F2ED,0xC400CC63,0x6277C7D7,0x539FDD4A,0xF5E8D6FE,
278 0x647E3AD9,0xC209316D,0xF3E12BF0,0x55962044,0x90311ECA,0x3646157E,0x07AE0FE3,0xA1D90457,
279 0x579174BE,0xF1E67F0A,0xC00E6597,0x66796E23,0xA3DE50AD,0x05A95B19,0x34414184,0x92364A30 },
280
281 { 0x00000000,0xCCAA009E,0x4225077D,0x8E8F07E3,0x844A0EFA,0x48E00E64,0xC66F0987,0x0AC50919,
282 0xD3E51BB5,0x1F4F1B2B,0x91C01CC8,0x5D6A1C56,0x57AF154F,0x9B0515D1,0x158A1232,0xD92012AC,
283 0x7CBB312B,0xB01131B5,0x3E9E3656,0xF23436C8,0xF8F13FD1,0x345B3F4F,0xBAD438AC,0x767E3832,
284 0xAF5E2A9E,0x63F42A00,0xED7B2DE3,0x21D12D7D,0x2B142464,0xE7BE24FA,0x69312319,0xA59B2387,
285 0xF9766256,0x35DC62C8,0xBB53652B,0x77F965B5,0x7D3C6CAC,0xB1966C32,0x3F196BD1,0xF3B36B4F,
286 0x2A9379E3,0xE639797D,0x68B67E9E,0xA41C7E00,0xAED97719,0x62737787,0xECFC7064,0x205670FA,
287 0x85CD537D,0x496753E3,0xC7E85400,0x0B42549E,0x01875D87,0xCD2D5D19,0x43A25AFA,0x8F085A64,
288 0x562848C8,0x9A824856,0x140D4FB5,0xD8A74F2B,0xD2624632,0x1EC846AC,0x9047414F,0x5CED41D1,
289 0x299DC2ED,0xE537C273,0x6BB8C590,0xA712C50E,0xADD7CC17,0x617DCC89,0xEFF2CB6A,0x2358CBF4,
290 0xFA78D958,0x36D2D9C6,0xB85DDE25,0x74F7DEBB,0x7E32D7A2,0xB298D73C,0x3C17D0DF,0xF0BDD041,
291 0x5526F3C6,0x998CF358,0x1703F4BB,0xDBA9F425,0xD16CFD3C,0x1DC6FDA2,0x9349FA41,0x5FE3FADF,
292 0x86C3E873,0x4A69E8ED,0xC4E6EF0E,0x084CEF90,0x0289E689,0xCE23E617,0x40ACE1F4,0x8C06E16A,
293 0xD0EBA0BB,0x1C41A025,0x92CEA7C6,0x5E64A758,0x54A1AE41,0x980BAEDF,0x1684A93C,0xDA2EA9A2,
294 0x030EBB0E,0xCFA4BB90,0x412BBC73,0x8D81BCED,0x8744B5F4,0x4BEEB56A,0xC561B289,0x09CBB217,
295 0xAC509190,0x60FA910E,0xEE7596ED,0x22DF9673,0x281A9F6A,0xE4B09FF4,0x6A3F9817,0xA6959889,
296 0x7FB58A25,0xB31F8ABB,0x3D908D58,0xF13A8DC6,0xFBFF84DF,0x37558441,0xB9DA83A2,0x7570833C,
297 0x533B85DA,0x9F918544,0x111E82A7,0xDDB48239,0xD7718B20,0x1BDB8BBE,0x95548C5D,0x59FE8CC3,
298 0x80DE9E6F,0x4C749EF1,0xC2FB9912,0x0E51998C,0x04949095,0xC83E900B,0x46B197E8,0x8A1B9776,
299 0x2F80B4F1,0xE32AB46F,0x6DA5B38C,0xA10FB312,0xABCABA0B,0x6760BA95,0xE9EFBD76,0x2545BDE8,
300 0xFC65AF44,0x30CFAFDA,0xBE40A839,0x72EAA8A7,0x782FA1BE,0xB485A120,0x3A0AA6C3,0xF6A0A65D,
301 0xAA4DE78C,0x66E7E712,0xE868E0F1,0x24C2E06F,0x2E07E976,0xE2ADE9E8,0x6C22EE0B,0xA088EE95,
302 0x79A8FC39,0xB502FCA7,0x3B8DFB44,0xF727FBDA,0xFDE2F2C3,0x3148F25D,0xBFC7F5BE,0x736DF520,
303 0xD6F6D6A7,0x1A5CD639,0x94D3D1DA,0x5879D144,0x52BCD85D,0x9E16D8C3,0x1099DF20,0xDC33DFBE,
304 0x0513CD12,0xC9B9CD8C,0x4736CA6F,0x8B9CCAF1,0x8159C3E8,0x4DF3C376,0xC37CC495,0x0FD6C40B,
305 0x7AA64737,0xB60C47A9,0x3883404A,0xF42940D4,0xFEEC49CD,0x32464953,0xBCC94EB0,0x70634E2E,
306 0xA9435C82,0x65E95C1C,0xEB665BFF,0x27CC5B61,0x2D095278,0xE1A352E6,0x6F2C5505,0xA386559B,
307 0x061D761C,0xCAB77682,0x44387161,0x889271FF,0x825778E6,0x4EFD7878,0xC0727F9B,0x0CD87F05,
308 0xD5F86DA9,0x19526D37,0x97DD6AD4,0x5B776A4A,0x51B26353,0x9D1863CD,0x1397642E,0xDF3D64B0,
309 0x83D02561,0x4F7A25FF,0xC1F5221C,0x0D5F2282,0x079A2B9B,0xCB302B05,0x45BF2CE6,0x89152C78,
310 0x50353ED4,0x9C9F3E4A,0x121039A9,0xDEBA3937,0xD47F302E,0x18D530B0,0x965A3753,0x5AF037CD,
311 0xFF6B144A,0x33C114D4,0xBD4E1337,0x71E413A9,0x7B211AB0,0xB78B1A2E,0x39041DCD,0xF5AE1D53,
312 0x2C8E0FFF,0xE0240F61,0x6EAB0882,0xA201081C,0xA8C40105,0x646E019B,0xEAE10678,0x264B06E6 }
313 };
314
315 inline uint32_t swap(uint32_t x)
316 {
317#if defined(__GNUC__) || defined(__clang__)
318 return __builtin_bswap32(x);
319#endif
320#ifdef MSC_VER
321 return _byteswap_ulong(x);
322#endif
323
324 return (x >> 24) |
325 ((x >> 8) & 0x0000FF00) |
326 ((x << 8) & 0x00FF0000) |
327 (x << 24);
328 }
329}
330
331
332/// add arbitrary number of bytes
333void CRC32::add(const void* data, size_t numBytes)
334{
335 uint32_t* current = (uint32_t*) data;
336 uint32_t crc = ~m_hash;
337
338 // process eight bytes at once
339 while (numBytes >= 8)
340 {
341#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN)
342 uint32_t one = *current++ ^ swap(crc);
343 uint32_t two = *current++;
344 crc = crc32Lookup[7][ one>>24 ] ^
345 crc32Lookup[6][(one>>16) & 0xFF] ^
346 crc32Lookup[5][(one>> 8) & 0xFF] ^
347 crc32Lookup[4][ one & 0xFF] ^
348 crc32Lookup[3][ two>>24 ] ^
349 crc32Lookup[2][(two>>16) & 0xFF] ^
350 crc32Lookup[1][(two>> 8) & 0xFF] ^
351 crc32Lookup[0][ two & 0xFF];
352#else
353 uint32_t one = *current++ ^ crc;
354 uint32_t two = *current++;
355 crc = crc32Lookup[7][ one & 0xFF] ^
356 crc32Lookup[6][(one>> 8) & 0xFF] ^
357 crc32Lookup[5][(one>>16) & 0xFF] ^
358 crc32Lookup[4][ one>>24 ] ^
359 crc32Lookup[3][ two & 0xFF] ^
360 crc32Lookup[2][(two>> 8) & 0xFF] ^
361 crc32Lookup[1][(two>>16) & 0xFF] ^
362 crc32Lookup[0][ two>>24 ];
363#endif
364 numBytes -= 8;
365 }
366
367 unsigned char* currentChar = (unsigned char*) current;
368 // remaining 1 to 7 bytes (standard CRC table-based algorithm)
369 while (numBytes--)
370 crc = (crc >> 8) ^ crc32Lookup[0][(crc & 0xFF) ^ *currentChar++];
371
372 m_hash = ~crc;
373}
374
375
376/// return latest hash as 8 hex characters
377std::string CRC32::getHash()
378{
379 // convert hash to string
380 static const char dec2hex[16+1] = "0123456789abcdef";
381
382 char hashBuffer[8+1];
383
384 hashBuffer[0] = dec2hex[ m_hash >> 28 ];
385 hashBuffer[1] = dec2hex[(m_hash >> 24) & 15];
386 hashBuffer[2] = dec2hex[(m_hash >> 20) & 15];
387 hashBuffer[3] = dec2hex[(m_hash >> 16) & 15];
388 hashBuffer[4] = dec2hex[(m_hash >> 12) & 15];
389 hashBuffer[5] = dec2hex[(m_hash >> 8) & 15];
390 hashBuffer[6] = dec2hex[(m_hash >> 4) & 15];
391 hashBuffer[7] = dec2hex[ m_hash & 15];
392 // zero-terminated string
393 hashBuffer[8] = 0;
394
395 // convert to std::string
396 return hashBuffer;
397}
398
399
400/// return latest hash as bytes
401void CRC32::getHash(unsigned char buffer[CRC32::HashBytes])
402{
403 buffer[0] = (m_hash >> 24) & 0xFF;
404 buffer[1] = (m_hash >> 16) & 0xFF;
405 buffer[2] = (m_hash >> 8) & 0xFF;
406 buffer[3] = m_hash & 0xFF;
407}
408
409
410/// compute CRC32 of a memory block
411std::string CRC32::operator()(const void* data, size_t numBytes)
412{
413 reset();
414 add(data, numBytes);
415 return getHash();
416}
417
418
419/// compute CRC32 of a string, excluding final zero
420std::string CRC32::operator()(const std::string& text)
421{
422 reset();
423 add(text.c_str(), text.size());
424 return getHash();
425}
diff --git a/scilab/modules/core/src/cpp/hash/crc32.hxx b/scilab/modules/core/src/cpp/hash/crc32.hxx
new file mode 100644
index 0000000..5e99cc7
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/crc32.hxx
@@ -0,0 +1,69 @@
1// //////////////////////////////////////////////////////////
2// crc32.hxx
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#pragma once
8
9#include "hash.hxx"
10#include <string>
11
12// define fixed size integer types
13#ifdef _MSC_VER
14// Windows
15typedef unsigned __int8 uint8_t;
16typedef unsigned __int32 uint32_t;
17#else
18// GCC
19#include <stdint.h>
20#endif
21
22
23/// compute CRC32 hash, based on Intel's Slicing-by-8 algorithm
24/** Usage:
25 CRC32 crc32;
26 std::string myHash = crc32("Hello World"); // std::string
27 std::string myHash2 = crc32("How are you", 11); // arbitrary data, 11 bytes
28
29 // or in a streaming fashion:
30
31 CRC32 crc32;
32 while (more data available)
33 crc32.add(pointer to fresh data, number of new bytes);
34 std::string myHash3 = crc32.getHash();
35
36 Note:
37 You can find code for the faster Slicing-by-16 algorithm on my website, too:
38 http://create.stephan-brumme.com/crc32/
39 Its unrolled version is about twice as fast but its look-up table doubled in size as well.
40 */
41class CRC32 : public Hash
42{
43public:
44 /// hash is 4 bytes long
45 enum { HashBytes = 4 };
46
47 /// same as reset()
48 CRC32();
49
50 /// compute CRC32 of a memory block
51 std::string operator()(const void* data, size_t numBytes);
52 /// compute CRC32 of a string, excluding final zero
53 std::string operator()(const std::string& text);
54
55 /// add arbitrary number of bytes
56 void add(const void* data, size_t numBytes);
57
58 /// return latest hash as 8 hex characters
59 std::string getHash();
60 /// return latest hash as bytes
61 void getHash(unsigned char buffer[HashBytes]);
62
63 /// restart
64 void reset();
65
66private:
67 /// hash
68 uint32_t m_hash;
69};
diff --git a/scilab/modules/core/src/cpp/hash/hash.hxx b/scilab/modules/core/src/cpp/hash/hash.hxx
new file mode 100644
index 0000000..8a7e31a
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/hash.hxx
@@ -0,0 +1,36 @@
1// //////////////////////////////////////////////////////////
2// hash.hxx
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#pragma once
8
9#ifndef _MSC_VER
10#ifdef __APPLE__
11#include <machine/endian.h>
12#else
13#include <endian.h>
14#endif
15#endif
16
17#include <string>
18
19/// abstract base class
20class Hash
21{
22public:
23 /// compute hash of a memory block
24 virtual std::string operator()(const void* data, size_t numBytes) = 0;
25 /// compute hash of a string, excluding final zero
26 virtual std::string operator()(const std::string& text) = 0;
27
28 /// add arbitrary number of bytes
29 virtual void add(const void* data, size_t numBytes) = 0;
30
31 /// return latest hash as hex characters
32 virtual std::string getHash() = 0;
33
34 /// restart
35 virtual void reset() = 0;
36};
diff --git a/scilab/modules/core/src/cpp/hash/md5.cpp b/scilab/modules/core/src/cpp/hash/md5.cpp
new file mode 100644
index 0000000..e38d7d6
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/md5.cpp
@@ -0,0 +1,375 @@
1// //////////////////////////////////////////////////////////
2// md5.cpp
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#include "md5.hxx"
8
9/// same as reset()
10MD5::MD5()
11{
12 reset();
13}
14
15
16/// restart
17void MD5::reset()
18{
19 m_numBytes = 0;
20 m_bufferSize = 0;
21
22 // according to RFC 1321
23 m_hash[0] = 0x67452301;
24 m_hash[1] = 0xefcdab89;
25 m_hash[2] = 0x98badcfe;
26 m_hash[3] = 0x10325476;
27}
28
29
30namespace
31{
32 // mix functions for processBlock()
33 inline uint32_t f1(uint32_t b, uint32_t c, uint32_t d)
34 {
35 return d ^ (b & (c ^ d)); // original: f = (b & c) | ((~b) & d);
36 }
37
38 inline uint32_t f2(uint32_t b, uint32_t c, uint32_t d)
39 {
40 return c ^ (d & (b ^ c)); // original: f = (b & d) | (c & (~d));
41 }
42
43 inline uint32_t f3(uint32_t b, uint32_t c, uint32_t d)
44 {
45 return b ^ c ^ d;
46 }
47
48 inline uint32_t f4(uint32_t b, uint32_t c, uint32_t d)
49 {
50 return c ^ (b | ~d);
51 }
52
53 inline uint32_t rotate(uint32_t a, uint32_t c)
54 {
55 return (a << c) | (a >> (32 - c));
56 }
57
58#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN)
59 inline uint32_t swap(uint32_t x)
60 {
61#if defined(__GNUC__) || defined(__clang__)
62 return __builtin_bswap32(x);
63#endif
64#ifdef MSC_VER
65 return _byteswap_ulong(x);
66#endif
67
68 return (x >> 24) |
69 ((x >> 8) & 0x0000FF00) |
70 ((x << 8) & 0x00FF0000) |
71 (x << 24);
72 }
73#endif
74}
75
76
77/// process 64 bytes
78void MD5::processBlock(const void* data)
79{
80 // get last hash
81 uint32_t a = m_hash[0];
82 uint32_t b = m_hash[1];
83 uint32_t c = m_hash[2];
84 uint32_t d = m_hash[3];
85
86 // data represented as 16x 32-bit words
87 const uint32_t* words = (uint32_t*) data;
88
89 // computations are little endian, swap data if necessary
90#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN)
91#define LITTLEENDIAN(x) swap(x)
92#else
93#define LITTLEENDIAN(x) (x)
94#endif
95
96 // first round
97 uint32_t word0 = LITTLEENDIAN(words[ 0]);
98 a = rotate(a + f1(b,c,d) + word0 + 0xd76aa478, 7) + b;
99 uint32_t word1 = LITTLEENDIAN(words[ 1]);
100 d = rotate(d + f1(a,b,c) + word1 + 0xe8c7b756, 12) + a;
101 uint32_t word2 = LITTLEENDIAN(words[ 2]);
102 c = rotate(c + f1(d,a,b) + word2 + 0x242070db, 17) + d;
103 uint32_t word3 = LITTLEENDIAN(words[ 3]);
104 b = rotate(b + f1(c,d,a) + word3 + 0xc1bdceee, 22) + c;
105
106 uint32_t word4 = LITTLEENDIAN(words[ 4]);
107 a = rotate(a + f1(b,c,d) + word4 + 0xf57c0faf, 7) + b;
108 uint32_t word5 = LITTLEENDIAN(words[ 5]);
109 d = rotate(d + f1(a,b,c) + word5 + 0x4787c62a, 12) + a;
110 uint32_t word6 = LITTLEENDIAN(words[ 6]);
111 c = rotate(c + f1(d,a,b) + word6 + 0xa8304613, 17) + d;
112 uint32_t word7 = LITTLEENDIAN(words[ 7]);
113 b = rotate(b + f1(c,d,a) + word7 + 0xfd469501, 22) + c;
114
115 uint32_t word8 = LITTLEENDIAN(words[ 8]);
116 a = rotate(a + f1(b,c,d) + word8 + 0x698098d8, 7) + b;
117 uint32_t word9 = LITTLEENDIAN(words[ 9]);
118 d = rotate(d + f1(a,b,c) + word9 + 0x8b44f7af, 12) + a;
119 uint32_t word10 = LITTLEENDIAN(words[10]);
120 c = rotate(c + f1(d,a,b) + word10 + 0xffff5bb1, 17) + d;
121 uint32_t word11 = LITTLEENDIAN(words[11]);
122 b = rotate(b + f1(c,d,a) + word11 + 0x895cd7be, 22) + c;
123
124 uint32_t word12 = LITTLEENDIAN(words[12]);
125 a = rotate(a + f1(b,c,d) + word12 + 0x6b901122, 7) + b;
126 uint32_t word13 = LITTLEENDIAN(words[13]);
127 d = rotate(d + f1(a,b,c) + word13 + 0xfd987193, 12) + a;
128 uint32_t word14 = LITTLEENDIAN(words[14]);
129 c = rotate(c + f1(d,a,b) + word14 + 0xa679438e, 17) + d;
130 uint32_t word15 = LITTLEENDIAN(words[15]);
131 b = rotate(b + f1(c,d,a) + word15 + 0x49b40821, 22) + c;
132
133 // second round
134 a = rotate(a + f2(b,c,d) + word1 + 0xf61e2562, 5) + b;
135 d = rotate(d + f2(a,b,c) + word6 + 0xc040b340, 9) + a;
136 c = rotate(c + f2(d,a,b) + word11 + 0x265e5a51, 14) + d;
137 b = rotate(b + f2(c,d,a) + word0 + 0xe9b6c7aa, 20) + c;
138
139 a = rotate(a + f2(b,c,d) + word5 + 0xd62f105d, 5) + b;
140 d = rotate(d + f2(a,b,c) + word10 + 0x02441453, 9) + a;
141 c = rotate(c + f2(d,a,b) + word15 + 0xd8a1e681, 14) + d;
142 b = rotate(b + f2(c,d,a) + word4 + 0xe7d3fbc8, 20) + c;
143
144 a = rotate(a + f2(b,c,d) + word9 + 0x21e1cde6, 5) + b;
145 d = rotate(d + f2(a,b,c) + word14 + 0xc33707d6, 9) + a;
146 c = rotate(c + f2(d,a,b) + word3 + 0xf4d50d87, 14) + d;
147 b = rotate(b + f2(c,d,a) + word8 + 0x455a14ed, 20) + c;
148
149 a = rotate(a + f2(b,c,d) + word13 + 0xa9e3e905, 5) + b;
150 d = rotate(d + f2(a,b,c) + word2 + 0xfcefa3f8, 9) + a;
151 c = rotate(c + f2(d,a,b) + word7 + 0x676f02d9, 14) + d;
152 b = rotate(b + f2(c,d,a) + word12 + 0x8d2a4c8a, 20) + c;
153
154 // third round
155 a = rotate(a + f3(b,c,d) + word5 + 0xfffa3942, 4) + b;
156 d = rotate(d + f3(a,b,c) + word8 + 0x8771f681, 11) + a;
157 c = rotate(c + f3(d,a,b) + word11 + 0x6d9d6122, 16) + d;
158 b = rotate(b + f3(c,d,a) + word14 + 0xfde5380c, 23) + c;
159
160 a = rotate(a + f3(b,c,d) + word1 + 0xa4beea44, 4) + b;
161 d = rotate(d + f3(a,b,c) + word4 + 0x4bdecfa9, 11) + a;
162 c = rotate(c + f3(d,a,b) + word7 + 0xf6bb4b60, 16) + d;
163 b = rotate(b + f3(c,d,a) + word10 + 0xbebfbc70, 23) + c;
164
165 a = rotate(a + f3(b,c,d) + word13 + 0x289b7ec6, 4) + b;
166 d = rotate(d + f3(a,b,c) + word0 + 0xeaa127fa, 11) + a;
167 c = rotate(c + f3(d,a,b) + word3 + 0xd4ef3085, 16) + d;
168 b = rotate(b + f3(c,d,a) + word6 + 0x04881d05, 23) + c;
169
170 a = rotate(a + f3(b,c,d) + word9 + 0xd9d4d039, 4) + b;
171 d = rotate(d + f3(a,b,c) + word12 + 0xe6db99e5, 11) + a;
172 c = rotate(c + f3(d,a,b) + word15 + 0x1fa27cf8, 16) + d;
173 b = rotate(b + f3(c,d,a) + word2 + 0xc4ac5665, 23) + c;
174
175 // fourth round
176 a = rotate(a + f4(b,c,d) + word0 + 0xf4292244, 6) + b;
177 d = rotate(d + f4(a,b,c) + word7 + 0x432aff97, 10) + a;
178 c = rotate(c + f4(d,a,b) + word14 + 0xab9423a7, 15) + d;
179 b = rotate(b + f4(c,d,a) + word5 + 0xfc93a039, 21) + c;
180
181 a = rotate(a + f4(b,c,d) + word12 + 0x655b59c3, 6) + b;
182 d = rotate(d + f4(a,b,c) + word3 + 0x8f0ccc92, 10) + a;
183 c = rotate(c + f4(d,a,b) + word10 + 0xffeff47d, 15) + d;
184 b = rotate(b + f4(c,d,a) + word1 + 0x85845dd1, 21) + c;
185
186 a = rotate(a + f4(b,c,d) + word8 + 0x6fa87e4f, 6) + b;
187 d = rotate(d + f4(a,b,c) + word15 + 0xfe2ce6e0, 10) + a;
188 c = rotate(c + f4(d,a,b) + word6 + 0xa3014314, 15) + d;
189 b = rotate(b + f4(c,d,a) + word13 + 0x4e0811a1, 21) + c;
190
191 a = rotate(a + f4(b,c,d) + word4 + 0xf7537e82, 6) + b;
192 d = rotate(d + f4(a,b,c) + word11 + 0xbd3af235, 10) + a;
193 c = rotate(c + f4(d,a,b) + word2 + 0x2ad7d2bb, 15) + d;
194 b = rotate(b + f4(c,d,a) + word9 + 0xeb86d391, 21) + c;
195
196 // update hash
197 m_hash[0] += a;
198 m_hash[1] += b;
199 m_hash[2] += c;
200 m_hash[3] += d;
201}
202
203
204/// add arbitrary number of bytes
205void MD5::add(const void* data, size_t numBytes)
206{
207 const uint8_t* current = (const uint8_t*) data;
208
209 if (m_bufferSize > 0)
210 {
211 while (numBytes > 0 && m_bufferSize < BlockSize)
212 {
213 m_buffer[m_bufferSize++] = *current++;
214 numBytes--;
215 }
216 }
217
218 // full buffer
219 if (m_bufferSize == BlockSize)
220 {
221 processBlock(m_buffer);
222 m_numBytes += BlockSize;
223 m_bufferSize = 0;
224 }
225
226 // no more data ?
227 if (numBytes == 0)
228 return;
229
230 // process full blocks
231 while (numBytes >= BlockSize)
232 {
233 processBlock(current);
234 current += BlockSize;
235 m_numBytes += BlockSize;
236 numBytes -= BlockSize;
237 }
238
239 // keep remaining bytes in buffer
240 while (numBytes > 0)
241 {
242 m_buffer[m_bufferSize++] = *current++;
243 numBytes--;
244 }
245}
246
247
248/// process final block, less than 64 bytes
249void MD5::processBuffer()
250{
251 // the input bytes are considered as bits strings, where the first bit is the most significant bit of the byte
252
253 // - append "1" bit to message
254 // - append "0" bits until message length in bit mod 512 is 448
255 // - append length as 64 bit integer
256
257 // number of bits
258 size_t paddedLength = m_bufferSize * 8;
259
260 // plus one bit set to 1 (always appended)
261 paddedLength++;
262
263 // number of bits must be (numBits % 512) = 448
264 size_t lower11Bits = paddedLength & 511;
265 if (lower11Bits <= 448)
266 paddedLength += 448 - lower11Bits;
267 else
268 paddedLength += 512 + 448 - lower11Bits;
269 // convert from bits to bytes
270 paddedLength /= 8;
271
272 // only needed if additional data flows over into a second block
273 unsigned char extra[BlockSize];
274
275 // append a "1" bit, 128 => binary 10000000
276 if (m_bufferSize < BlockSize)
277 m_buffer[m_bufferSize] = 128;
278 else
279 extra[0] = 128;
280
281 size_t i;
282 for (i = m_bufferSize + 1; i < BlockSize; i++)
283 m_buffer[i] = 0;
284 for (; i < paddedLength; i++)
285 extra[i - BlockSize] = 0;
286
287 // add message length in bits as 64 bit number
288 uint64_t msgBits = 8 * (m_numBytes + m_bufferSize);
289 // find right position
290 unsigned char* addLength;
291 if (paddedLength < BlockSize)
292 addLength = m_buffer + paddedLength;
293 else
294 addLength = extra + paddedLength - BlockSize;
295
296 // must be little endian
297 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
298 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
299 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
300 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
301 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
302 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
303 *addLength++ = msgBits & 0xFF; msgBits >>= 8;
304 *addLength++ = msgBits & 0xFF;
305
306 // process blocks
307 processBlock(m_buffer);
308 // flowed over into a second block ?
309 if (paddedLength > BlockSize)
310 processBlock(extra);
311}
312
313
314/// return latest hash as 32 hex characters
315std::string MD5::getHash()
316{
317 // compute hash (as raw bytes)
318 unsigned char rawHash[HashBytes];
319 getHash(rawHash);
320
321 // convert to hex string
322 std::string result;
323 result.reserve(2 * HashBytes);
324 for (int i = 0; i < HashBytes; i++)
325 {
326 static const char dec2hex[16+1] = "0123456789abcdef";
327 result += dec2hex[(rawHash[i] >> 4) & 15];
328 result += dec2hex[ rawHash[i] & 15];
329 }
330
331 return result;
332}
333
334
335/// return latest hash as bytes
336void MD5::getHash(unsigned char buffer[MD5::HashBytes])
337{
338 // save old hash if buffer is partially filled
339 uint32_t oldHash[HashValues];
340 for (int i = 0; i < HashValues; i++)
341 oldHash[i] = m_hash[i];
342
343 // process remaining bytes
344 processBuffer();
345
346 unsigned char* current = buffer;
347 for (int i = 0; i < HashValues; i++)
348 {
349 *current++ = m_hash[i] & 0xFF;
350 *current++ = (m_hash[i] >> 8) & 0xFF;
351 *current++ = (m_hash[i] >> 16) & 0xFF;
352 *current++ = (m_hash[i] >> 24) & 0xFF;
353
354 // restore old hash
355 m_hash[i] = oldHash[i];
356 }
357}
358
359
360/// compute MD5 of a memory block
361std::string MD5::operator()(const void* data, size_t numBytes)
362{
363 reset();
364 add(data, numBytes);
365 return getHash();
366}
367
368
369/// compute MD5 of a string, excluding final zero
370std::string MD5::operator()(const std::string& text)
371{
372 reset();
373 add(text.c_str(), text.size());
374 return getHash();
375}
diff --git a/scilab/modules/core/src/cpp/hash/md5.hxx b/scilab/modules/core/src/cpp/hash/md5.hxx
new file mode 100644
index 0000000..a681417
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/md5.hxx
@@ -0,0 +1,78 @@
1// //////////////////////////////////////////////////////////
2// md5.hxx
3// Copyright (c) 2014 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#pragma once
8
9#include "hash.hxx"
10#include <string>
11
12// define fixed size integer types
13#ifdef _MSC_VER
14// Windows
15typedef unsigned __int8 uint8_t;
16typedef unsigned __int32 uint32_t;
17typedef unsigned __int64 uint64_t;
18#else
19// GCC
20#include <stdint.h>
21#endif
22
23
24/// compute MD5 hash
25/** Usage:
26 MD5 md5;
27 std::string myHash = md5("Hello World"); // std::string
28 std::string myHash2 = md5("How are you", 11); // arbitrary data, 11 bytes
29
30 // or in a streaming fashion:
31
32 MD5 md5;
33 while (more data available)
34 md5.add(pointer to fresh data, number of new bytes);
35 std::string myHash3 = md5.getHash();
36 */
37class MD5 : public Hash
38{
39public:
40 /// split into 64 byte blocks (=> 512 bits), hash is 16 bytes long
41 enum { BlockSize = 512 / 8, HashBytes = 16 };
42
43 /// same as reset()
44 MD5();
45
46 /// compute MD5 of a memory block
47 std::string operator()(const void* data, size_t numBytes);
48 /// compute MD5 of a string, excluding final zero
49 std::string operator()(const std::string& text);
50
51 /// add arbitrary number of bytes
52 void add(const void* data, size_t numBytes);
53
54 /// return latest hash as 32 hex characters
55 std::string getHash();
56 /// return latest hash as bytes
57 void getHash(unsigned char buffer[HashBytes]);
58
59 /// restart
60 void reset();
61
62private:
63 /// process 64 bytes
64 void processBlock(const void* data);
65 /// process everything left in the internal buffer
66 void processBuffer();
67
68 /// size of processed data in bytes
69 uint64_t m_numBytes;
70 /// valid bytes in m_buffer
71 size_t m_bufferSize;
72 /// bytes not processed yet
73 uint8_t m_buffer[BlockSize];
74
75 enum { HashValues = HashBytes / 4 };
76 /// hash, stored as integers
77 uint32_t m_hash[HashValues];
78};
diff --git a/scilab/modules/core/src/cpp/hash/readme.md b/scilab/modules/core/src/cpp/hash/readme.md
new file mode 100644
index 0000000..8be9d01
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/readme.md
@@ -0,0 +1,51 @@
1# Portable C++ Hashing Library
2
3This is a mirror of my library hosted at https://create.stephan-brumme.com/hash-library/
4
5In a nutshell:
6
7- computes CRC32, MD5, SHA1 and SHA256 (most common member of the SHA2 functions), Keccak and its SHA3 sibling
8- optional HMAC (keyed-hash message authentication code)
9- no external dependencies, small code size
10- can work chunk-wise (for example when reading streams block-by-block)
11- portable: supports Windows and Linux, tested on Little Endian and Big Endian CPUs
12- roughly as fast as Linux core hashing functions
13- open source, zlib license
14
15You can find code examples, benchmarks and much more on my website https://create.stephan-brumme.com/hash-library/
16
17# How to use
18
19This example computes SHA256 hashes but the API is more or less identical for all hash algorithms:
20
21``` cpp
22// SHA2 test program
23#include "sha256.h"
24#include <iostream> // for std::cout only, not needed for hashing library
25
26int main(int, char**)
27{
28 // create a new hashing object
29 SHA256 sha256;
30
31 // hashing an std::string
32 std::cout << sha256("Hello World") << std::endl;
33 // => a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
34
35 // hashing a buffer of bytes
36 const char* buffer = "How are you";
37 std::cout << sha256(buffer, 11) << std::endl;
38 // => 9c7d5b046878838da72e40ceb3179580958df544b240869b80d0275cc07209cc
39
40 // or in a streaming fashion (re-use "How are you")
41 SHA256 sha256stream;
42 const char* url = "create.stephan-brumme.com"; // 25 bytes
43 int step = 5;
44 for (int i = 0; i < 25; i += step)
45 sha256stream.add(url + i, step); // add five bytes at a time
46 std::cout << sha256stream.getHash() << std::endl;
47 // => 82aa771f1183c52f973c798c9243a1c73833ea40961c73e55e12430ec77b69f6
48
49 return 0;
50}
51```
diff --git a/scilab/modules/core/src/cpp/hash/sha1.cpp b/scilab/modules/core/src/cpp/hash/sha1.cpp
new file mode 100644
index 0000000..5639a98
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/sha1.cpp
@@ -0,0 +1,320 @@
1// //////////////////////////////////////////////////////////
2// sha1.cpp
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#include "sha1.hxx"
8
9/// same as reset()
10SHA1::SHA1()
11{
12 reset();
13}
14
15
16/// restart
17void SHA1::reset()
18{
19 m_numBytes = 0;
20 m_bufferSize = 0;
21
22 // according to RFC 1321
23 m_hash[0] = 0x67452301;
24 m_hash[1] = 0xefcdab89;
25 m_hash[2] = 0x98badcfe;
26 m_hash[3] = 0x10325476;
27 m_hash[4] = 0xc3d2e1f0;
28}
29
30
31namespace
32{
33 // mix functions for processBlock()
34 inline uint32_t f1(uint32_t b, uint32_t c, uint32_t d)
35 {
36 return d ^ (b & (c ^ d)); // original: f = (b & c) | ((~b) & d);
37 }
38
39 inline uint32_t f2(uint32_t b, uint32_t c, uint32_t d)
40 {
41 return b ^ c ^ d;
42 }
43
44 inline uint32_t f3(uint32_t b, uint32_t c, uint32_t d)
45 {
46 return (b & c) | (b & d) | (c & d);
47 }
48
49 inline uint32_t rotate(uint32_t a, uint32_t c)
50 {
51 return (a << c) | (a >> (32 - c));
52 }
53
54 inline uint32_t swap(uint32_t x)
55 {
56#if defined(__GNUC__) || defined(__clang__)
57 return __builtin_bswap32(x);
58#endif
59#ifdef MSC_VER
60 return _byteswap_ulong(x);
61#endif
62
63 return (x >> 24) |
64 ((x >> 8) & 0x0000FF00) |
65 ((x << 8) & 0x00FF0000) |
66 (x << 24);
67 }
68}
69
70
71/// process 64 bytes
72void SHA1::processBlock(const void* data)
73{
74 // get last hash
75 uint32_t a = m_hash[0];
76 uint32_t b = m_hash[1];
77 uint32_t c = m_hash[2];
78 uint32_t d = m_hash[3];
79 uint32_t e = m_hash[4];
80
81 // data represented as 16x 32-bit words
82 const uint32_t* input = (uint32_t*) data;
83 // convert to big endian
84 uint32_t words[80];
85 for (int i = 0; i < 16; i++)
86#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN)
87 words[i] = input[i];
88#else
89 words[i] = swap(input[i]);
90#endif
91
92 // extend to 80 words
93 for (int i = 16; i < 80; i++)
94 words[i] = rotate(words[i-3] ^ words[i-8] ^ words[i-14] ^ words[i-16], 1);
95
96 // first round
97 for (int i = 0; i < 4; i++)
98 {
99 int offset = 5*i;
100 e += rotate(a,5) + f1(b,c,d) + words[offset ] + 0x5a827999; b = rotate(b,30);
101 d += rotate(e,5) + f1(a,b,c) + words[offset+1] + 0x5a827999; a = rotate(a,30);
102 c += rotate(d,5) + f1(e,a,b) + words[offset+2] + 0x5a827999; e = rotate(e,30);
103 b += rotate(c,5) + f1(d,e,a) + words[offset+3] + 0x5a827999; d = rotate(d,30);
104 a += rotate(b,5) + f1(c,d,e) + words[offset+4] + 0x5a827999; c = rotate(c,30);
105 }
106
107 // second round
108 for (int i = 4; i < 8; i++)
109 {
110 int offset = 5*i;
111 e += rotate(a,5) + f2(b,c,d) + words[offset ] + 0x6ed9eba1; b = rotate(b,30);
112 d += rotate(e,5) + f2(a,b,c) + words[offset+1] + 0x6ed9eba1; a = rotate(a,30);
113 c += rotate(d,5) + f2(e,a,b) + words[offset+2] + 0x6ed9eba1; e = rotate(e,30);
114 b += rotate(c,5) + f2(d,e,a) + words[offset+3] + 0x6ed9eba1; d = rotate(d,30);
115 a += rotate(b,5) + f2(c,d,e) + words[offset+4] + 0x6ed9eba1; c = rotate(c,30);
116 }
117
118 // third round
119 for (int i = 8; i < 12; i++)
120 {
121 int offset = 5*i;
122 e += rotate(a,5) + f3(b,c,d) + words[offset ] + 0x8f1bbcdc; b = rotate(b,30);
123 d += rotate(e,5) + f3(a,b,c) + words[offset+1] + 0x8f1bbcdc; a = rotate(a,30);
124 c += rotate(d,5) + f3(e,a,b) + words[offset+2] + 0x8f1bbcdc; e = rotate(e,30);
125 b += rotate(c,5) + f3(d,e,a) + words[offset+3] + 0x8f1bbcdc; d = rotate(d,30);
126 a += rotate(b,5) + f3(c,d,e) + words[offset+4] + 0x8f1bbcdc; c = rotate(c,30);
127 }
128
129 // fourth round
130 for (int i = 12; i < 16; i++)
131 {
132 int offset = 5*i;
133 e += rotate(a,5) + f2(b,c,d) + words[offset ] + 0xca62c1d6; b = rotate(b,30);
134 d += rotate(e,5) + f2(a,b,c) + words[offset+1] + 0xca62c1d6; a = rotate(a,30);
135 c += rotate(d,5) + f2(e,a,b) + words[offset+2] + 0xca62c1d6; e = rotate(e,30);
136 b += rotate(c,5) + f2(d,e,a) + words[offset+3] + 0xca62c1d6; d = rotate(d,30);
137 a += rotate(b,5) + f2(c,d,e) + words[offset+4] + 0xca62c1d6; c = rotate(c,30);
138 }
139
140 // update hash
141 m_hash[0] += a;
142 m_hash[1] += b;
143 m_hash[2] += c;
144 m_hash[3] += d;
145 m_hash[4] += e;
146}
147
148
149/// add arbitrary number of bytes
150void SHA1::add(const void* data, size_t numBytes)
151{
152 const uint8_t* current = (const uint8_t*) data;
153
154 if (m_bufferSize > 0)
155 {
156 while (numBytes > 0 && m_bufferSize < BlockSize)
157 {
158 m_buffer[m_bufferSize++] = *current++;
159 numBytes--;
160 }
161 }
162
163 // full buffer
164 if (m_bufferSize == BlockSize)
165 {
166 processBlock((void*)m_buffer);
167 m_numBytes += BlockSize;
168 m_bufferSize = 0;
169 }
170
171 // no more data ?
172 if (numBytes == 0)
173 return;
174
175 // process full blocks
176 while (numBytes >= BlockSize)
177 {
178 processBlock(current);
179 current += BlockSize;
180 m_numBytes += BlockSize;
181 numBytes -= BlockSize;
182 }
183
184 // keep remaining bytes in buffer
185 while (numBytes > 0)
186 {
187 m_buffer[m_bufferSize++] = *current++;
188 numBytes--;
189 }
190}
191
192
193/// process final block, less than 64 bytes
194void SHA1::processBuffer()
195{
196 // the input bytes are considered as bits strings, where the first bit is the most significant bit of the byte
197
198 // - append "1" bit to message
199 // - append "0" bits until message length in bit mod 512 is 448
200 // - append length as 64 bit integer
201
202 // number of bits
203 size_t paddedLength = m_bufferSize * 8;
204
205 // plus one bit set to 1 (always appended)
206 paddedLength++;
207
208 // number of bits must be (numBits % 512) = 448
209 size_t lower11Bits = paddedLength & 511;
210 if (lower11Bits <= 448)
211 paddedLength += 448 - lower11Bits;
212 else
213 paddedLength += 512 + 448 - lower11Bits;
214 // convert from bits to bytes
215 paddedLength /= 8;
216
217 // only needed if additional data flows over into a second block
218 unsigned char extra[BlockSize];
219
220 // append a "1" bit, 128 => binary 10000000
221 if (m_bufferSize < BlockSize)
222 m_buffer[m_bufferSize] = 128;
223 else
224 extra[0] = 128;
225
226 size_t i;
227 for (i = m_bufferSize + 1; i < BlockSize; i++)
228 m_buffer[i] = 0;
229 for (; i < paddedLength; i++)
230 extra[i - BlockSize] = 0;
231
232 // add message length in bits as 64 bit number
233 uint64_t msgBits = 8 * (m_numBytes + m_bufferSize);
234 // find right position
235 unsigned char* addLength;
236 if (paddedLength < BlockSize)
237 addLength = m_buffer + paddedLength;
238 else
239 addLength = extra + paddedLength - BlockSize;
240
241 // must be big endian
242 *addLength++ = (unsigned char)((msgBits >> 56) & 0xFF);
243 *addLength++ = (unsigned char)((msgBits >> 48) & 0xFF);
244 *addLength++ = (unsigned char)((msgBits >> 40) & 0xFF);
245 *addLength++ = (unsigned char)((msgBits >> 32) & 0xFF);
246 *addLength++ = (unsigned char)((msgBits >> 24) & 0xFF);
247 *addLength++ = (unsigned char)((msgBits >> 16) & 0xFF);
248 *addLength++ = (unsigned char)((msgBits >> 8) & 0xFF);
249 *addLength = (unsigned char)( msgBits & 0xFF);
250
251 // process blocks
252 processBlock(m_buffer);
253 // flowed over into a second block ?
254 if (paddedLength > BlockSize)
255 processBlock(extra);
256}
257
258
259/// return latest hash as 40 hex characters
260std::string SHA1::getHash()
261{
262 // compute hash (as raw bytes)
263 unsigned char rawHash[HashBytes];
264 getHash(rawHash);
265
266 // convert to hex string
267 std::string result;
268 result.reserve(2 * HashBytes);
269 for (int i = 0; i < HashBytes; i++)
270 {
271 static const char dec2hex[16+1] = "0123456789abcdef";
272 result += dec2hex[(rawHash[i] >> 4) & 15];
273 result += dec2hex[ rawHash[i] & 15];
274 }
275
276 return result;
277}
278
279
280/// return latest hash as bytes
281void SHA1::getHash(unsigned char buffer[SHA1::HashBytes])
282{
283 // save old hash if buffer is partially filled
284 uint32_t oldHash[HashValues];
285 for (int i = 0; i < HashValues; i++)
286 oldHash[i] = m_hash[i];
287
288 // process remaining bytes
289 processBuffer();
290
291 unsigned char* current = buffer;
292 for (int i = 0; i < HashValues; i++)
293 {
294 *current++ = (m_hash[i] >> 24) & 0xFF;
295 *current++ = (m_hash[i] >> 16) & 0xFF;
296 *current++ = (m_hash[i] >> 8) & 0xFF;
297 *current++ = m_hash[i] & 0xFF;
298
299 // restore old hash
300 m_hash[i] = oldHash[i];
301 }
302}
303
304
305/// compute SHA1 of a memory block
306std::string SHA1::operator()(const void* data, size_t numBytes)
307{
308 reset();
309 add(data, numBytes);
310 return getHash();
311}
312
313
314/// compute SHA1 of a string, excluding final zero
315std::string SHA1::operator()(const std::string& text)
316{
317 reset();
318 add(text.c_str(), text.size());
319 return getHash();
320}
diff --git a/scilab/modules/core/src/cpp/hash/sha1.hxx b/scilab/modules/core/src/cpp/hash/sha1.hxx
new file mode 100644
index 0000000..c7b6beb
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/sha1.hxx
@@ -0,0 +1,78 @@
1// //////////////////////////////////////////////////////////
2// sha1.h
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#pragma once
8
9#include "hash.hxx"
10#include <string>
11
12// define fixed size integer types
13#ifdef _MSC_VER
14// Windows
15typedef unsigned __int8 uint8_t;
16typedef unsigned __int32 uint32_t;
17typedef unsigned __int64 uint64_t;
18#else
19// GCC
20#include <stdint.h>
21#endif
22
23
24/// compute SHA1 hash
25/** Usage:
26 SHA1 sha1;
27 std::string myHash = sha1("Hello World"); // std::string
28 std::string myHash2 = sha1("How are you", 11); // arbitrary data, 11 bytes
29
30 // or in a streaming fashion:
31
32 SHA1 sha1;
33 while (more data available)
34 sha1.add(pointer to fresh data, number of new bytes);
35 std::string myHash3 = sha1.getHash();
36 */
37class SHA1 : public Hash
38{
39public:
40 /// split into 64 byte blocks (=> 512 bits), hash is 20 bytes long
41 enum { BlockSize = 512 / 8, HashBytes = 20 };
42
43 /// same as reset()
44 SHA1();
45
46 /// compute SHA1 of a memory block
47 std::string operator()(const void* data, size_t numBytes);
48 /// compute SHA1 of a string, excluding final zero
49 std::string operator()(const std::string& text);
50
51 /// add arbitrary number of bytes
52 void add(const void* data, size_t numBytes);
53
54 /// return latest hash as 40 hex characters
55 std::string getHash();
56 /// return latest hash as bytes
57 void getHash(unsigned char buffer[HashBytes]);
58
59 /// restart
60 void reset();
61
62private:
63 /// process 64 bytes
64 void processBlock(const void* data);
65 /// process everything left in the internal buffer
66 void processBuffer();
67
68 /// size of processed data in bytes
69 uint64_t m_numBytes;
70 /// valid bytes in m_buffer
71 size_t m_bufferSize;
72 /// bytes not processed yet
73 uint8_t m_buffer[BlockSize];
74
75 enum { HashValues = HashBytes / 4 };
76 /// hash, stored as integers
77 uint32_t m_hash[HashValues];
78};
diff --git a/scilab/modules/core/src/cpp/hash/sha256.cpp b/scilab/modules/core/src/cpp/hash/sha256.cpp
new file mode 100644
index 0000000..7afe983
--- /dev/null
+++ b/scilab/modules/core/src/cpp/hash/sha256.cpp
@@ -0,0 +1,405 @@
1// //////////////////////////////////////////////////////////
2// sha256.cpp
3// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
4// see http://create.stephan-brumme.com/disclaimer.html
5//
6
7#include "sha256.hxx"
8
9/// same as reset()
10SHA256::SHA256()
11{
12 reset();
13}
14
15
16/// restart
17void SHA256::reset()
18{
19 m_numBytes = 0;
20 m_bufferSize = 0;
21
22 // according to RFC 1321
23 m_hash[0] = 0x6a09e667;
24 m_hash[1] = 0xbb67ae85;
25 m_hash[2] = 0x3c6ef372;
26 m_hash[3] = 0xa54ff53a;
27 m_hash[4] = 0x510e527f;
28 m_hash[5] = 0x9b05688c;
29 m_hash[6] = 0x1f83d9ab;
30 m_hash[7] = 0x5be0cd19;
31}
32
33
34namespace
35{
36 inline uint32_t rotate(uint32_t a, uint32_t c)
37 {
38 return (a >> c) | (a << (32 - c));
39 }
40
41 inline uint32_t swap(uint32_t x)
42 {
43#if defined(__GNUC__) || defined(__clang__)
44 return __builtin_bswap32(x);
45#endif
46#ifdef MSC_VER
47 return _byteswap_ulong(x);
48#endif
49
50 return (x >> 24) |
51 ((x >> 8) & 0x0000FF00) |
52 ((x << 8) & 0x00FF0000) |
53 (x << 24);
54 }
55
56 // mix functions for processBlock()
57 inline uint32_t f1(uint32_t e, uint32_t f, uint32_t g)
58 {
59 uint32_t term1 = rotate(e, 6) ^ rotate(e, 11) ^ rotate(e, 25);
60 uint32_t term2 = (e & f) ^ (~e & g); //(g ^ (e & (f ^ g)))
61 return term1 + term2;
62 }
63
64 inline uint32_t f2(uint32_t a, uint32_t b, uint32_t c)
65 {
66 uint32_t term1 = rotate(a, 2) ^ rotate(a, 13) ^ rotate(a, 22);
67 uint32_t term2 = ((a | b) & c) | (a & b); //(a & (b ^ c)) ^ (b & c);
68 return term1 + term2;
69 }
70}
71
72
73/// process 64 bytes
74void SHA256::processBlock(const void* data)
75{
76 // get last hash
77 uint32_t a = m_hash[0];
78 uint32_t b = m_hash[1];
79 uint32_t c = m_hash[2];
80 uint32_t d = m_hash[3];
81 uint32_t e = m_hash[4];
82 uint32_t f = m_hash[5];
83 uint32_t g = m_hash[6];
84 uint32_t h = m_hash[7];
85
86 // data represented as 16x 32-bit words
87 const uint32_t* input = (uint32_t*) data;
88 // convert to big endian
89 uint32_t words[64];
90 int i;
91 for (i = 0; i < 16; i++)
92#if defined(__BYTE_ORDER) && (__BYTE_ORDER != 0) && (__BYTE_ORDER == __BIG_ENDIAN)
93 words[i] = input[i];
94#else
95 words[i] = swap(input[i]);
96#endif
97
98 uint32_t x,y; // temporaries
99
100 // first round
101 x = h + f1(e,f,g) + 0x428a2f98 + words[ 0]; y = f2(a,b,c); d += x; h = x + y;
102 x = g + f1(d,e,f) + 0x71374491 + words[ 1]; y = f2(h,a,b); c += x; g = x + y;
103 x = f + f1(c,d,e) + 0xb5c0fbcf + words[ 2]; y = f2(g,h,a); b += x; f = x + y;
104 x = e + f1(b,c,d) + 0xe9b5dba5 + words[ 3]; y = f2(f,g,h); a += x; e = x + y;
105 x = d + f1(a,b,c) + 0x3956c25b + words[ 4]; y = f2(e,f,g); h += x; d = x + y;
106 x = c + f1(h,a,b) + 0x59f111f1 + words[ 5]; y = f2(d,e,f); g += x; c = x + y;
107 x = b + f1(g,h,a) + 0x923f82a4 + words[ 6]; y = f2(c,d,e); f += x; b = x + y;
108 x = a + f1(f,g,h) + 0xab1c5ed5 + words[ 7]; y = f2(b,c,d); e += x; a = x + y;
109
110 // secound round
111 x = h + f1(e,f,g) + 0xd807aa98 + words[ 8]; y = f2(a,b,c); d += x; h = x + y;
112 x = g + f1(d,e,f) + 0x12835b01 + words[ 9]; y = f2(h,a,b); c += x; g = x + y;
113 x = f + f1(c,d,e) + 0x243185be + words[10]; y = f2(g,h,a); b += x; f = x + y;
114 x = e + f1(b,c,d) + 0x550c7dc3 + words[11]; y = f2(f,g,h); a += x; e = x + y;
115 x = d + f1(a,b,c) + 0x72be5d74 + words[12]; y = f2(e,f,g); h += x; d = x + y;
116 x = c + f1(h,a,b) + 0x80deb1fe + words[13]; y = f2(d,e,f); g += x; c = x + y;
117 x = b + f1(g,h,a) + 0x9bdc06a7 + words[14]; y = f2(c,d,e); f += x; b = x + y;
118 x = a + f1(f,g,h) + 0xc19bf174 + words[15]; y = f2(b,c,d); e += x; a = x + y;
119
120 // extend to 24 words
121 for (; i < 24; i++)
122 words[i] = words[i-16] +
123 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
124 words[i-7] +
125 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
126
127 // third round
128 x = h + f1(e,f,g) + 0xe49b69c1 + words[16]; y = f2(a,b,c); d += x; h = x + y;
129 x = g + f1(d,e,f) + 0xefbe4786 + words[17]; y = f2(h,a,b); c += x; g = x + y;
130 x = f + f1(c,d,e) + 0x0fc19dc6 + words[18]; y = f2(g,h,a); b += x; f = x + y;
131 x = e + f1(b,c,d) + 0x240ca1cc + words[19]; y = f2(f,g,h); a += x; e = x + y;
132 x = d + f1(a,b,c) + 0x2de92c6f + words[20]; y = f2(e,f,g); h += x; d = x + y;
133 x = c + f1(h,a,b) + 0x4a7484aa + words[21]; y = f2(d,e,f); g += x; c = x + y;
134 x = b + f1(g,h,a) + 0x5cb0a9dc + words[22]; y = f2(c,d,e); f += x; b = x + y;
135 x = a + f1(f,g,h) + 0x76f988da + words[23]; y = f2(b,c,d); e += x; a = x + y;
136
137 // extend to 32 words
138 for (; i < 32; i++)
139 words[i] = words[i-16] +
140 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
141 words[i-7] +
142 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
143
144 // fourth round
145 x = h + f1(e,f,g) + 0x983e5152 + words[24]; y = f2(a,b,c); d += x; h = x + y;
146 x = g + f1(d,e,f) + 0xa831c66d + words[25]; y = f2(h,a,b); c += x; g = x + y;
147 x = f + f1(c,d,e) + 0xb00327c8 + words[26]; y = f2(g,h,a); b += x; f = x + y;
148 x = e + f1(b,c,d) + 0xbf597fc7 + words[27]; y = f2(f,g,h); a += x; e = x + y;
149 x = d + f1(a,b,c) + 0xc6e00bf3 + words[28]; y = f2(e,f,g); h += x; d = x + y;
150 x = c + f1(h,a,b) + 0xd5a79147 + words[29]; y = f2(d,e,f); g += x; c = x + y;
151 x = b + f1(g,h,a) + 0x06ca6351 + words[30]; y = f2(c,d,e); f += x; b = x + y;
152 x = a + f1(f,g,h) + 0x14292967 + words[31]; y = f2(b,c,d); e += x; a = x + y;
153
154 // extend to 40 words
155 for (; i < 40; i++)
156 words[i] = words[i-16] +
157 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
158 words[i-7] +
159 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
160
161 // fifth round
162 x = h + f1(e,f,g) + 0x27b70a85 + words[32]; y = f2(a,b,c); d += x; h = x + y;
163 x = g + f1(d,e,f) + 0x2e1b2138 + words[33]; y = f2(h,a,b); c += x; g = x + y;
164 x = f + f1(c,d,e) + 0x4d2c6dfc + words[34]; y = f2(g,h,a); b += x; f = x + y;
165 x = e + f1(b,c,d) + 0x53380d13 + words[35]; y = f2(f,g,h); a += x; e = x + y;
166 x = d + f1(a,b,c) + 0x650a7354 + words[36]; y = f2(e,f,g); h += x; d = x + y;
167 x = c + f1(h,a,b) + 0x766a0abb + words[37]; y = f2(d,e,f); g += x; c = x + y;
168 x = b + f1(g,h,a) + 0x81c2c92e + words[38]; y = f2(c,d,e); f += x; b = x + y;
169 x = a + f1(f,g,h) + 0x92722c85 + words[39]; y = f2(b,c,d); e += x; a = x + y;
170
171 // extend to 48 words
172 for (; i < 48; i++)
173 words[i] = words[i-16] +
174 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
175 words[i-7] +
176 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
177
178 // sixth round
179 x = h + f1(e,f,g) + 0xa2bfe8a1 + words[40]; y = f2(a,b,c); d += x; h = x + y;
180 x = g + f1(d,e,f) + 0xa81a664b + words[41]; y = f2(h,a,b); c += x; g = x + y;
181 x = f + f1(c,d,e) + 0xc24b8b70 + words[42]; y = f2(g,h,a); b += x; f = x + y;
182 x = e + f1(b,c,d) + 0xc76c51a3 + words[43]; y = f2(f,g,h); a += x; e = x + y;
183 x = d + f1(a,b,c) + 0xd192e819 + words[44]; y = f2(e,f,g); h += x; d = x + y;
184 x = c + f1(h,a,b) + 0xd6990624 + words[45]; y = f2(d,e,f); g += x; c = x + y;
185 x = b + f1(g,h,a) + 0xf40e3585 + words[46]; y = f2(c,d,e); f += x; b = x + y;
186 x = a + f1(f,g,h) + 0x106aa070 + words[47]; y = f2(b,c,d); e += x; a = x + y;
187
188 // extend to 56 words
189 for (; i < 56; i++)
190 words[i] = words[i-16] +
191 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
192 words[i-7] +
193 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
194
195 // seventh round
196 x = h + f1(e,f,g) + 0x19a4c116 + words[48]; y = f2(a,b,c); d += x; h = x + y;
197 x = g + f1(d,e,f) + 0x1e376c08 + words[49]; y = f2(h,a,b); c += x; g = x + y;
198 x = f + f1(c,d,e) + 0x2748774c + words[50]; y = f2(g,h,a); b += x; f = x + y;
199 x = e + f1(b,c,d) + 0x34b0bcb5 + words[51]; y = f2(f,g,h); a += x; e = x + y;
200 x = d + f1(a,b,c) + 0x391c0cb3 + words[52]; y = f2(e,f,g); h += x; d = x + y;
201 x = c + f1(h,a,b) + 0x4ed8aa4a + words[53]; y = f2(d,e,f); g += x; c = x + y;
202 x = b + f1(g,h,a) + 0x5b9cca4f + words[54]; y = f2(c,d,e); f += x; b = x + y;
203 x = a + f1(f,g,h) + 0x682e6ff3 + words[55]; y = f2(b,c,d); e += x; a = x + y;
204
205 // extend to 64 words
206 for (; i < 64; i++)
207 words[i] = words[i-16] +
208 (rotate(words[i-15], 7) ^ rotate(words[i-15], 18) ^ (words[i-15] >> 3)) +
209 words[i-7] +
210 (rotate(words[i- 2], 17) ^ rotate(words[i- 2], 19) ^ (words[i- 2] >> 10));
211
212 // eigth round
213 x = h + f1(e,f,g) + 0x748f82ee + words[56]; y = f2(a,b,c); d += x; h = x + y;
214 x = g + f1(d,e,f) + 0x78a5636f + words[57]; y = f2(h,a,b); c += x; g = x + y;
215 x = f + f1(c,d,e) + 0x84c87814 + words[58]; y = f2(g,h,a); b += x; f = x + y;
216 x = e + f1(b,c,d) + 0x8cc70208 + words[59]; y = f2(f,g,h); a += x; e = x + y;
217 x = d + f1(a,b,c) + 0x90befffa + words[60]; y = f2(e,f,g); h += x; d = x + y;
218 x = c + f1(h,a,b) + 0xa4506ceb + words[61]; y = f2(d,e,f); g += x; c = x + y;
219 x = b + f1(g,h,a) + 0xbef9a3f7 + words[62]; y = f2(c,d,e); f += x; b = x + y;
220 x = a + f1(f,g,h) + 0xc67178f2 + words[63]; y = f2(b,c,d); e += x; a = x + y;
221
222 // update hash
223 m_hash[0] += a;
224 m_hash[1] += b;
225 m_hash[2] += c;
226 m_hash[3] += d;
227 m_hash[4] += e;
228 m_hash[5] += f;
229 m_hash[6] += g;
230 m_hash[7] += h;
231}
232
233
234/// add arbitrary number of bytes
235void SHA256::add(const void* data, size_t numBytes)
236{
237 const uint8_t* current = (const uint8_t*) data;
238
239 if (m_bufferSize > 0)
240 {
241 while (numBytes > 0 && m_bufferSize < BlockSize)
242 {
243 m_buffer[m_bufferSize++] = *current++;
244 numBytes--;
245 }
246 }
247
248 // full buffer
249 if (m_bufferSize == BlockSize)
250 {
251 processBlock(m_buffer);
252 m_numBytes += BlockSize;
253 m_bufferSize = 0;
254 }
255
256 // no more data ?
257 if (numBytes == 0)
258 return;
259
260 // process full blocks
261 while (numBytes >= BlockSize)
262 {
263 processBlock(current);
264 current += BlockSize;
265 m_numBytes += BlockSize;
266 numBytes -= BlockSize;
267 }
268
269 // keep remaining bytes in buffer
270 while (numBytes > 0)
271 {
272 m_buffer[m_bufferSize++] = *current++;
273 numBytes--;
274 }
275}
276
277
278/// process final block, less than 64 bytes
279void SHA256::processBuffer()
280{
281 // the input bytes are considered as bits strings, where the first bit is the most significant bit of the byte
282
283 // - append "1" bit to message
284 // - append "0" bits until message length in bit mod 512 is 448
285 // - append length as 64 bit integer
286
287 // number of bits
288 size_t paddedLength = m_bufferSize * 8;
289
290 // plus one bit set to 1 (always appended)
291 paddedLength++;
292
293 // number of bits must be (numBits % 512) = 448
294 size_t lower11Bits = paddedLength & 511;
295 if (lower11Bits <= 448)
296 paddedLength += 448 - lower11Bits;
297 else
298 paddedLength += 512 + 448 - lower11Bits;
299 // convert from bits to bytes
300 paddedLength /= 8;
301
302 // only needed if additional data flows over into a second block
303 unsigned char extra[BlockSize];
304
305 // append a "1" bit, 128 => binary 10000000
306 if (m_bufferSize < BlockSize)
307 m_buffer[m_bufferSize] = 128;
308 else
309 extra[0] = 128;
310
311 size_t i;
312 for (i = m_bufferSize + 1; i < BlockSize; i++)
313 m_buffer[i] = 0;
314 for (; i < paddedLength; i++)
315 extra[i - BlockSize] = 0;
316
317 // add message length in bits as 64 bit number
318 uint64_t msgBits = 8 * (m_numBytes + m_bufferSize);
319 // find right position
320 unsigned char* addLength;
321 if (paddedLength < BlockSize)
322 addLength = m_buffer + paddedLength;
323 else
324 addLength = extra + paddedLength - BlockSize;
325
326 // must be big endian
327 *addLength++ = (unsigned char)((msgBits >> 56) & 0xFF);
328 *addLength++ = (unsigned char)((msgBits >> 48) & 0xFF);
329 *addLength++ = (unsigned char)((msgBits >> 40) & 0xFF);
330 *addLength++ = (unsigned char)((msgBits >> 32) & 0xFF);
331 *addLength++ = (unsigned char)((msgBits >> 24) & 0xFF);
332 *addLength++ = (unsigned char)((msgBits >> 16) & 0xFF);
333 *addLength++ = (unsigned char)((msgBits >> 8) & 0xFF);
334 *addLength = (unsigned char)( msgBits & 0xFF);
335
336 // process blocks
337 processBlock(m_buffer);
338 // flowed over into a second block ?
339 if (paddedLength > BlockSize)
340 processBlock(extra);
341}
342
343
344/// return latest hash as 64 hex characters
345std::string SHA256::getHash()
346{
347 // compute hash (as raw bytes)
348 unsigned char rawHash[HashBytes];
349 getHash(rawHash);
350
351 // convert to hex string
352 std::string result;
353 result.reserve(2 * HashBytes);
354 for (int i = 0; i < HashBytes; i++)
355 {
356 static const char dec2hex[16+1] = "0123456789abcdef";
357 result += dec2hex[(rawHash[i] >> 4) & 15];
358 result += dec2hex[ rawHash[i] & 15];
359 }
360
361 return result;
362}
363
364
365/// return latest hash as bytes
366void SHA256::getHash(unsigned char buffer[SHA256::HashBytes])
367{
368 // save old hash if buffer is partially filled
369 uint32_t oldHash[HashValues];
370 for (int i = 0; i < HashValues; i++)
371 oldHash[i] = m_hash[i];
372
373 // process remaining bytes
374 processBuffer();
375
376 unsigned char* current = buffer;
377 for (int i = 0; i < HashValues; i++)
378 {
379 *current++ = (m_hash[i] >> 24) & 0xFF;
380 *current++ = (m_hash[i] >> 16) & 0xFF;
381 *current++ = (m_hash[i] >> 8) & 0xFF;
382 *current++ = m_hash[i] & 0xFF;
383
384 // restore old hash
385 m_hash[i] = oldHash[i];
386 }
387}