Changeset 2685
- Timestamp:
- 02/22/08 00:22:23 (9 months ago)
- Files:
-
- trunk/NEWS (modified) (1 diff)
- trunk/configure.ac (modified) (5 diffs)
- trunk/lib_internal/Makefile-files (modified) (1 diff)
- trunk/lib_internal/crypto-wrapper-beecrypt.h (added)
- trunk/lib_internal/crypto-wrapper-nss.h (added)
- trunk/lib_internal/crypto-wrapper.h (added)
- trunk/lib_internal/testsuite/Makefile-files (modified) (2 diffs)
- trunk/lib_internal/testsuite/SPEED-RESULTS.txt (added)
- trunk/lib_internal/testsuite/crypto-speed.c (added)
- trunk/lib_internal/testsuite/crypto.c (added)
- trunk/src/Makefile-files (modified) (3 diffs)
- trunk/src/testsuite/Makefile-files (modified) (3 diffs)
- trunk/src/testsuite/hashcalc-plain.c (modified) (5 diffs)
- trunk/src/testsuite/hashcalc.c (modified) (3 diffs)
- trunk/src/testsuite/hashcalc.sh (modified) (1 diff)
- trunk/src/vhashify-init.hc (modified) (3 diffs)
- trunk/src/vhashify.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/NEWS
r2604 r2685 1 version 0.30.??? 2 ================ 3 4 - added support for using libnss instead of beecrypt for 5 vhashify's hash calculation. libnss has bad SHA1 performance on 6 i386, but is a) maintained and b) gives better performance with 7 all other hashes and on x86_64. 8 9 1 10 version 0.30.214 2 11 ================ trunk/configure.ac
r2626 r2685 43 43 AC_PROG_LN_S 44 44 AM_PROG_CC_C_O 45 PKG_PROG_PKG_CONFIG 45 46 ENSC_CXXCOMPILER 46 47 ENSC_C99COMPILER … … 312 313 dnl ######################## 313 314 dnl 315 dnl {crypto stuff 316 dnl 317 AC_MSG_CHECKING([for used crypto API]) 318 AC_ARG_WITH(crypto-api, 319 AC_HELP_STRING([--with-crypto-api=API], 320 [select crypto api to be used; possible values are `none', `nss', `beecrypt', `auto' (default:auto)]), 321 [case $withval in 322 (none|nss|beecrypt|auto) ensc_crypto_api=$withval;; 323 (*) AC_MSG_ERROR([invalid initscripts value, only gentoo and sysv are supported]);; 324 esac],[ensc_crypto_api=auto]) 325 AC_MSG_RESULT($ensc_crypto_api) 326 327 328 dnl Now, check for matching crypto api. When selected 'auto', the 329 dnl first matching one wins 330 331 dnl ######################## 332 dnl 314 333 dnl {check for beecrypt 315 334 dnl 335 case $ensc_crypto_api in 336 (auto|beecrypt) 316 337 if test x"$ensc_cv_c99_c99compiler" = xyes; then 317 338 ensc_have_beecrypt=yes … … 326 347 [ ensc_have_beecrypt=no ]) 327 348 fi 328 329 if test x"$ensc_have_beecrypt" != xyes; then330 AC_MSG_WARN([331 ****332 **** 'beecrypt' could not be found;333 **** this will disable the build of 'vhashify'334 ****])335 fi336 349 else 337 350 ensc_have_beecrypt=no 338 fi 351 fi;; 352 esac 353 354 case $ensc_crypto_api in 355 (auto) if test x"$ensc_have_beecrypt" = xyes; then 356 AC_MSG_NOTICE([using beecrypt as crypto api]) 357 ensc_crypto_api=beecrypt 358 fi;; 359 (beecrypt) if test x"$ensc_have_beecrypt" != xyes; then 360 AC_MSG_ERROR([beecrypt crypto api not found]) 361 fi;; 362 esac 339 363 340 364 AM_CONDITIONAL(ENSC_HAVE_BEECRYPT, test x"$ensc_have_beecrypt" = xyes) … … 342 366 dnl 343 367 dnl beecrypt stuff ends here} 368 dnl 369 dnl ######################## 370 371 372 dnl ######################## 373 dnl 374 dnl {check for nss 375 dnl 376 377 case $ensc_crypto_api in 378 (nss) PKG_CHECK_MODULES(NSS, nss);; 379 (auto) PKG_CHECK_MODULES(NSS, nss, [ 380 AC_MSG_NOTICE([using NSS as crypto api]) 381 ensc_crypto_api=nss], 382 AC_MSG_RESULT(no));; 383 esac 384 385 dnl 386 dnl nss stuff ends here} 387 dnl 388 dnl ######################## 389 390 case $ensc_crypto_api in 391 (beecrypt) 392 ENSC_HAVE_CRYPTO=true 393 ENSC_CRYPTO_API=ENSC_CRYPTO_API_BEECRYPT 394 ENSC_CRYPTO_CFLAGS= 395 ENSC_CRYPTO_LIB=-lbeecrypt 396 ENSC_CAN_CRYPTO_WITH_DIETLIBC=false 397 ;; 398 399 (nss) 400 ENSC_HAVE_CRYPTO=true 401 ENSC_CRYPTO_API=ENSC_CRYPTO_API_NSS 402 ENSC_CRYPTO_CFLAGS=$NSS_CFLAGS 403 ENSC_CRYPTO_LIB=$NSS_LIBS 404 ENSC_CAN_CRYPTO_WITH_DIETLIBC=false 405 ;; 406 407 (none) 408 ENSC_HAVE_CRYPTO=false 409 ENSC_CRYPTO_API=ENSC_CRYPTO_API_NONE 410 ENSC_CRYPTO_CFLAGS= 411 ENSC_CRYPTO_LIB= 412 ENSC_CAN_CRYPTO_WITH_DIETLIBC=false 413 414 AC_MSG_WARN([No crypto api found/select. This will disable the build of `vhashify']) 415 ;; 416 417 (*) AC_MSG_ERROR([internal error]) 418 esac 419 420 AM_CONDITIONAL(ENSC_HAVE_CRYPTO, $ENSC_HAVE_CRYPTO) 421 AM_CONDITIONAL(ENSC_CAN_CRYPTO_WITH_DIETLIBC, $ENSC_CAN_CRYPTO_WITH_DIETLIBC) 422 AC_SUBST(ENSC_CRYPTO_CFLAGS, $ENSC_CRYPTO_CFLAGS) 423 AC_SUBST(ENSC_CRYPTO_LIB, $ENSC_CRYPTO_LIB) 424 AC_DEFINE_UNQUOTED(ENSC_CRYPTO_API, $ENSC_CRYPTO_API, [Used crypto API]) 425 426 dnl 427 dnl crypto stuff ends here} 344 428 dnl 345 429 dnl ######################## … … 408 492 syscall(2) invocation: $with_syscall 409 493 vserver(2) syscall#: $ensc_cv_value_syscall_vserver 494 crypto api: $ensc_crypto_api 410 495 411 496 Paths: trunk/lib_internal/Makefile-files
r2579 r2685 53 53 noinst_HEADERS += \ 54 54 lib_internal/coreassert.h \ 55 lib_internal/crypto-wrapper.h \ 56 lib_internal/crypto-wrapper-nss.h \ 57 lib_internal/crypto-wrapper-beecrypt.h \ 55 58 lib_internal/errinfo.h \ 56 59 lib_internal/jail.h \ trunk/lib_internal/testsuite/Makefile-files
r2569 r2685 37 37 endif 38 38 39 if ENSC_HAVE_CRYPTO 40 check_PROGRAMS += lib_internal/testsuite/crypto \ 41 lib_internal/testsuite/crypto-speed 42 TESTS += lib_internal/testsuite/crypto 43 endif 44 39 45 DIETPROGS += lib_internal/testsuite/isnumber \ 40 46 lib_internal/testsuite/sigbus \ 41 47 lib_internal/testsuite/matchlist 48 49 if ENSC_CAN_CRYPTO_WITH_DIETLIBC 50 DIETPROGS += lib_internal/testsuite/crypto \ 51 lib_internal/testsuite/crypto-speed 52 endif 42 53 43 54 EXTRA_DIST += lib_internal/testsuite/copy-check … … 80 91 lib_internal_testsuite_matchlist_gnu_LDADD = $(LIBINTERNAL_GLIBC) 81 92 lib_internal_testsuite_matchlist_gnu_CPPFLAGS = $(AM_CPPFLAGS) # see note above 93 94 if ENSC_HAVE_CRYPTO 95 lib_internal_testsuite_crypto_speed_SOURCES = lib_internal/testsuite/crypto-speed.c 96 lib_internal_testsuite_crypto_speed_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS) 97 lib_internal_testsuite_crypto_speed_LDADD = $(ENSC_CRYPTO_LIB) -lrt 98 99 lib_internal_testsuite_crypto_SOURCES = lib_internal/testsuite/crypto.c 100 lib_internal_testsuite_crypto_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS) 101 lib_internal_testsuite_crypto_LDADD = $(ENSC_CRYPTO_LIB) 102 103 if !ENSC_CAN_CRYPTO_WITH_DIETLIBC 104 lib_internal_testsuite_crypto_speed_LDFLAGS = -Wl,--as-needed 105 lib_internal_testsuite_crypto_LDFLAGS = -Wl,--as-needed 106 endif 107 endif trunk/src/Makefile-files
r2619 r2685 87 87 src/vmemctrl 88 88 89 if ENSC_CAN_ BEECRYPT_WITH_DIETLIBC89 if ENSC_CAN_CRYPTO_WITH_DIETLIBC 90 90 DIETPROGS += src/vhashify 91 91 endif … … 128 128 129 129 if ENSC_HAVE_C99_COMPILER 130 if ENSC_HAVE_ BEECRYPT130 if ENSC_HAVE_CRYPTO 131 131 pkglib_PROGRAMS += src/vhashify 132 endif ENSC_HAVE_ BEECRYPT132 endif ENSC_HAVE_CRYPTO 133 133 endif ENSC_HAVE_C99_COMPILER 134 134 … … 296 296 297 297 src_vhashify_SOURCES = src/vhashify.c 298 if ENSC_CAN_BEECRYPT_WITH_DIETLIBC 299 src_vhashify_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) -lbeecrypt $(VSERVER_LDADDS) 298 src_vhashify_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS) 299 if ENSC_CAN_CRYPTO_WITH_DIETLIBC 300 src_vhashify_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS) 300 301 src_vhashify_LDFLAGS = $(VSERVER_LDFLGS) 301 302 else 302 src_vhashify_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) -lbeecrypt303 src_vhashify_LDFLAGS = 303 src_vhashify_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) $(ENSC_CRYPTO_LIB) 304 src_vhashify_LDFLAGS = -Wl,--as-needed 304 305 endif 305 306 trunk/src/testsuite/Makefile-files
r2245 r2685 23 23 24 24 if ENSC_HAVE_C99_COMPILER 25 if ENSC_HAVE_ BEECRYPT25 if ENSC_HAVE_CRYPTO 26 26 src_testsuite_check_passive_PRGS += src/testsuite/hashcalc \ 27 27 src/testsuite/hashcalc-plain … … 34 34 if ENSC_HAVE_C99_COMPILER 35 35 src_testsuite_check_src_C99_SCRPTS = src/testsuite/vunify-test.sh 36 if ENSC_HAVE_ BEECRYPT36 if ENSC_HAVE_CRYPTO 37 37 src_testsuite_check_src_C99_SCRPTS += src/testsuite/hashcalc-plain.sh \ 38 38 src/testsuite/hashcalc.sh … … 74 74 src_testsuite_hashcalc_SOURCES = src/testsuite/hashcalc.c 75 75 src_testsuite_hashcalc_plain_SOURCES = src/testsuite/hashcalc-plain.c 76 if ENSC_CAN_BEECRYPT_WITH_DIETLIBC 77 src_testsuite_hashcalc_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) -lbeecrypt $(VSERVER_LDADDS) 76 src_testsuite_hashcalc_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS) 77 src_testsuite_hashcalc_plain_CFLAGS = $(AM_CFLAGS) $(ENSC_CRYPTO_CFLAGS) 78 79 if ENSC_CAN_CRYPTO_WITH_DIETLIBC 80 src_testsuite_hashcalc_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS) 78 81 src_testsuite_hashcalc_LDFLAGS = $(VSERVER_LDFLGS) 79 82 80 src_testsuite_hashcalc_plain_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) -lbeecrypt$(VSERVER_LDADDS)83 src_testsuite_hashcalc_plain_LDADD = $(LIBINTERNAL) $(LIBENSCVECTOR) $(ENSC_CRYPTO_LIB) $(VSERVER_LDADDS) 81 84 src_testsuite_hashcalc_plain_LDFLAGS = $(VSERVER_LDFLGS) 82 85 else 83 src_testsuite_hashcalc_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) -lbeecrypt84 src_testsuite_hashcalc_LDFLAGS = 86 src_testsuite_hashcalc_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) $(ENSC_CRYPTO_LIB) 87 src_testsuite_hashcalc_LDFLAGS = -Wl,--as-needed 85 88 86 src_testsuite_hashcalc_plain_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) -lbeecrypt87 src_testsuite_hashcalc_plain_LDFLAGS = 89 src_testsuite_hashcalc_plain_LDADD = $(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) $(ENSC_CRYPTO_LIB) 90 src_testsuite_hashcalc_plain_LDFLAGS = -Wl,--as-needed 88 91 endif 89 92 trunk/src/testsuite/hashcalc-plain.c
r2245 r2685 21 21 #endif 22 22 23 #include < beecrypt/beecrypt.h>23 #include <lib_internal/crypto-wrapper.h> 24 24 #include <stdbool.h> 25 25 #include <unistd.h> … … 33 33 34 34 static bool 35 convertDigest(char res[], hashFunctionContext * h_ctx)35 convertDigest(char res[], ensc_hash_context * h_ctx) 36 36 { 37 37 static char const HEX_DIGIT[] = "0123456789abcdef"; 38 size_t d_size = h_ctx->algo->digestsize;38 size_t d_size = ensc_crypto_hashctx_get_digestsize(h_ctx); 39 39 40 40 unsigned char digest[d_size]; 41 41 size_t out = 0; 42 42 43 if ( hashFunctionContextDigest(h_ctx, digest)==-1)43 if (ensc_crypto_hashctx_get_digest(h_ctx, digest, NULL, d_size)==-1) 44 44 return false; 45 45 … … 55 55 int main(int UNUSED argc, char *argv[]) 56 56 { 57 int fd = open(argv[1], O_NOFOLLOW|O_NONBLOCK|O_RDONLY|O_NOCTTY);58 hashFunctionContexthash_context;59 hashFunctionconst *method;60 struct stat st;61 off_t size;62 loff_t offset = 0;63 char digest[1024];57 int fd = open(argv[1], O_NOFOLLOW|O_NONBLOCK|O_RDONLY|O_NOCTTY); 58 ensc_hash_context hash_context; 59 ensc_hash_method const *method; 60 struct stat st; 61 off_t size; 62 loff_t offset = 0; 63 char digest[2048]; 64 64 65 assert((method = hashFunctionFind(argv[2]))!=0); 66 assert(hashFunctionContextInit(&hash_context, method)!=-1); 65 ensc_crypto_init(); 66 assert((method = ensc_crypto_hash_find(argv[2]))!=0); 67 assert(ensc_crypto_hashctx_init(&hash_context, method)!=-1); 67 68 68 69 assert(fstat(fd, &st)!=-1); 69 assert( hashFunctionContextReset(&hash_context)!=-1);70 assert(ensc_crypto_hashctx_reset(&hash_context)!=-1); 70 71 71 72 size = st.st_size; … … 78 79 assert((buf=mmap(0, buf_size, PROT_READ, MAP_SHARED, fd, offset))!=0); 79 80 offset += buf_size; 80 assert( hashFunctionContextUpdate(&hash_context, buf, buf_size)!=-1);81 assert(ensc_crypto_hashctx_update(&hash_context, buf, buf_size)!=-1); 81 82 munmap((void *)(buf), buf_size); 82 83 } … … 87 88 Vwrite(1, "\n", 1); 88 89 89 hashFunctionContextFree(&hash_context);90 ensc_crypto_hashctx_free(&hash_context); 90 91 91 92 return 0; trunk/src/testsuite/hashcalc.c
r2209 r2685 40 40 volatile unsigned int canary3; 41 41 } __attribute__((__packed__)) d_path; 42 42 43 43 d_path.canary0 = 0x12345678; 44 44 d_path.canary1 = 0x21436587; … … 47 47 memset(d_path.d, 0x66, sizeof d_path.d); 48 48 49 global_info.hash_conf.method = hashFunctionFind(argv[2]); 49 ensc_crypto_init(); 50 global_info.hash_conf.method = ensc_crypto_hash_find(argv[2]); 50 51 51 assert( hashFunctionContextInit(&global_info.hash_context,52 global_info.hash_conf.method)!=-1);52 assert(ensc_crypto_hashctx_init(&global_info.hash_context, 53 global_info.hash_conf.method)!=-1); 53 54 54 55 assert(fstat(fd, &st)!=-1); … … 69 70 Vwrite(1, "\n", 1); 70 71 71 hashFunctionContextFree(&global_info.hash_context);72 ensc_crypto_hashctx_free(&global_info.hash_context); 72 73 73 74 return 0; trunk/src/testsuite/hashcalc.sh
r2176 r2685 52 52 53 53 for i in $tmpdir/rand-*; do 54 sha1_0=$($hashcalc "$i" SHA-1 | tr -d / ) 55 sha1_1=$(sha1sum "$i" | awk '{ print $1}' ) 54 for m in md5 sha1 sha256 sha512; do 55 sum_0=$($hashcalc "$i" "$m" | tr -d / ) 56 sum_1=$(${m}sum "$i" | awk '{ print $1}' ) 56 57 57 test x"$sha1_0" = x"$sha1_1" || { 58 echo "SHA-1 mismatch at $(basename $i)" 59 exit 1 60 } 61 62 md5_0=$($hashcalc "$i" MD5 | tr -d / ) 63 md5_1=$(md5sum "$i" | awk '{ print $1}' ) 64 65 test x"$md5_0" = x"$md5_1" || { 66 echo "MD5 mismatch at $(basename $i)" 67 exit 1 68 } 58 # compare only the first 80 chars as vhashify will cut digest to MAXPATHLEN 59 test x"${sum_0::80}" = x"${sum_1::80}" || { 60 echo "$m mismatch at $(basename $i): '$sum_0' vs. '$sum_1'" 61 exit 1 62 } 63 done 69 64 done 70 65 trunk/src/vhashify-init.hc
r1967 r2685 97 97 int fd = open(filename, O_RDONLY); 98 98 if (fd==-1 && conf->method==0) 99 conf->method = hashFunctionDefault();99 conf->method = ensc_crypto_hash_get_default(); 100 100 101 101 if (fd==-1) { 102 char const *hash_name; 102 103 assert(conf->method!=0); 103 104 if (conf->method==0) return false; 104 105 if (global_args->dry_run) return true; // do not create the file 105 106 106 107 fd = Eopen(filename, O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW, 0644); 107 TEMP_FAILURE_RETRY(write(fd, conf->method->name, strlen(conf->method->name))); 108 109 hash_name = ensc_crypto_hash_get_name(conf->method); 110 TEMP_FAILURE_RETRY(write(fd, hash_name, strlen(hash_name))); 108 111 TEMP_FAILURE_RETRY(write(fd, "\n", 1)); 109 112 } … … 120 123 buf[s] = '\0'; 121 124 122 conf->method = hashFunctionFind(buf);125 conf->method = ensc_crypto_hash_find(buf); 123 126 if (conf->method==0) { 124 127 WRITE_MSG(2, "Can not find hash-function '"); … … 131 134 } 132 135 133 if (conf->method!=0 && conf->method->digestsize*8>HASH_MAXBITS) {136 if (conf->method!=0 && ensc_crypto_hash_get_digestsize(conf->method)*8>HASH_MAXBITS) { 134 137 WRITE_MSG(2, "Wow... what an huge hash-function. I can not handle so much bits; giving up...\n"); 135 138 conf->method=0; trunk/src/vhashify.c
r2569 r2685 31 31 #include "ensc_vector/vector.h" 32 32 33 #include <beecrypt/beecrypt.h>33 #include "lib_internal/crypto-wrapper.h" 34 34 35 35 #include <setjmp.h> … … 96 96 struct HashDirConfiguration 97 97 { 98 hashFunction const*method;98 ensc_hash_method const *method; 99 99 enum { hshALL=0, hshSTART = 1, hshMIDDLE=2, 100 100 hshEND = 4, hshINVALID = -1 } blocks; … … 110 110 size_t hash_dirs_max_size; 111 111 112 hashFunctionContext hash_context;112 ensc_hash_context hash_context; 113 113 }; 114 114 … … 252 252 { 253 253 static char const HEX_DIGIT[] = "0123456789abcdef"; 254 hashFunctionContext * const h_ctx = &global_info.hash_context;255 size_t d_size = h_ctx->algo->digestsize;256 254 ensc_hash_context * const h_ctx = &global_info.hash_context; 255 size_t d_size = ensc_crypto_hashctx_get_digestsize(h_ctx); 256 257 257 unsigned char digest[d_size]; 258 258 size_t out = 0; 259 259 260 if ( hashFunctionContextDigest(h_ctx, digest)==-1)260 if (ensc_crypto_hashctx_get_digest(h_ctx, digest, NULL, d_size)==-1) 261 261 return false; 262 262 … … 276 276 #ifndef ENSC_TESTSUITE 277 277 static bool 278 addStatHash( hashFunctionContext *h_ctx, struct stat const * const st)278 addStatHash(ensc_hash_context *h_ctx, struct stat const * const st) 279 279 { 280 280 #define DECL_ATTR(X) __typeof__(st->st_##X) X … … 301 301 302 302 303 return hashFunctionContextUpdate(h_ctx, (void *)&tmp, sizeof tmp)!=-1;303 return ensc_crypto_hashctx_update(h_ctx, (void *)&tmp, sizeof tmp)!=-1; 304 304 } 305 305 #else 306 306 static bool 307 addStatHash( hashFunctionContext UNUSED *h_ctx, struct stat const UNUSED * const st)307 addStatHash(ensc_hash_context UNUSED *h_ctx, struct stat const UNUSED * const st) 308 308 { 309 309 return true; … … 314 314 calculateHashFromFD(int fd, HashPath d_path, struct stat const * const st) 315 315 { 316 hashFunctionContext * const h_ctx = &global_info.hash_context;316 ensc_hash_context * const h_ctx = &global_info.hash_context; 317 317 void const * volatile buf = 0; 318 318 loff_t volatile buf_size = 0; … … 320 320 321 321 322 if ( hashFunctionContextReset(h_ctx)==-1 ||322 if (ensc_crypto_hashctx_reset(h_ctx)==-1 || 323 323 !addStatHash(h_ctx, st)) 324 324 return false; … … 341 341 madvise(const_cast(void *)(buf), buf_size, MADV_SEQUENTIAL); // ignore error... 342 342 343 if ( hashFunctionContextUpdate(h_ctx, buf, buf_size)==-1) goto out;343 if (ensc_crypto_hashctx_update(h_ctx, buf, buf_size)==-1) goto out; 344 344 345 345 munmap(const_cast(void *)(buf), buf_size); … … 669 669 } 670 670 671 ensc_crypto_init(); 671 672 switch (args.mode) { 672 673 case mdMANUALLY : initModeManually(&args, argc-optind, argv+optind); break; … … 675 676 }; 676 677 677 if ( hashFunctionContextInit(&global_info.hash_context,678 global_info.hash_conf.method)==-1) {678 if (ensc_crypto_hashctx_init(&global_info.hash_context, 679 global_info.hash_conf.method)==-1) { 679 680 WRITE_MSG(2, "Failed to initialize hash-context\n"); 680 681 return EXIT_FAILURE; … … 692 693 MatchList_destroy(&global_info.dst_list); 693 694 freeHashList(&global_info.hash_dirs); 694 hashFunctionContextFree(&global_info.hash_context);695 ensc_crypto_hashctx_free(&global_info.hash_context); 695 696 #endif 696 697
