From: Niels Möller Date: Tue, 26 Dec 2017 23:10:44 +0000 (+0100) Subject: Merge branch 'master' into skein X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1af249fa6325f65d308f80689b43cc91060b375b;p=thirdparty%2Fnettle.git Merge branch 'master' into skein --- 1af249fa6325f65d308f80689b43cc91060b375b diff --cc ChangeLog index 7825119e,231cb8ce..cb639a8b --- a/ChangeLog +++ b/ChangeLog @@@ -1,94 -1,322 +1,413 @@@ +2017-01-18 Niels Möller + + * skein512-internal.c (ROUND_EVEN, ROUND_ODD, ADD_KEY_MOD): New + macros. + (_skein512_block): Use them. + +2017-01-12 Niels Möller + + * examples/nettle-benchmark.c (bench_skein256_block) + (bench_skein512_block): New functions. + (main): Use them. + +2016-12-27 Niels Möller + + * testsuite/skein256-test.c: Use symbolic constants. + +2016-10-18 Niels Möller + + * skein512-internal.c (_skein512_block): New file and function. + * skein.h: Added skein512 declarations. + * Makefile.in (nettle_SOURCES): Added skein512-internal.c. + * testsuite/skein512-test.c: New test case. + * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added skein512-test.c. + +2016-10-16 Niels Möller + + * skein256-internal.c (_skein256_block): Keep the subkey words in + scalar variables. + * x86_64/skein256-internal.asm: Likewise, keep subkey words in + registers. + +2016-10-15 Niels Möller + + * skein256-internal.c (_skein256_block): Keep tweak words in + scalar variables, and expand on the fly, which is a single xor + operation. + * x86_64/skein256-internal.asm: Likewise, keep tweak words in + registers. + * skein256.c (_skein256_expand): Deleted tweak argument. Updated + callers. + * skein.h (_SKEIN_NTWEAK): Reduce to 2. + +2016-10-14 Niels Möller + + * x86_64/skein256-internal.asm: New file, initial assembly + implementation for x86_64. Modest speedup compared to C version. + +2016-10-13 Niels Möller + + * Makefile.in (nettle_SOURCES): Added skein256-internal.c. + + * skein256-internal.c (_skein256_block): Move to a separate file, + from... + * skein256.c: ... old location. + +2016-10-12 Niels Möller + + * skein.h (_SKEIN256_NKEYS, _SKEIN_NTWEAK): Increase to 6 and 4, + respectively, to reduce number of modulo operations. + * skein256.c (_skein256_expand): Intialize the additional words. + (_skein256_block): Avoid modulo operations in the loop. Almost 50% + speedup. + + * skein256.c (_skein256_expand): New function. + (skein256_process_block): Use it. + + * testsuite/skein256-test.c (test_skein256_block): Use it. + +2016-10-10 Niels Möller + + * skein.h (struct skein256_ctx): New context struct. + * skein256.c (skein256_init, skein256_update, skein256_digest): + New functions. + (skein256_process_block): New internal function. + * skein256-meta.c (nettle_skein256): New file, new nettle_hash. + * nettle-meta.h (nettle_skein256): Declare it. + * examples/nettle-benchmark.c (main): Add benchmarking of + nettle_skein256 + * testsuite/skein256-test.c (test_main): Add test cases from + skein-1.3 paper. + +2016-10-07 Niels Möller + + * skein256.c (_skein256_block): New file and function. + * skein.h: New file. + * Makefile.in (nettle_SOURCES): Added skein256.c. + (HEADERS): Added skein.h. + * testsuite/skein256-test.c: New test cases. + * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added + skein256-test.c. + + 2017-11-19 Niels Möller + + * Released nettle-3.4. + + 2017-11-12 Niels Möller + + * configure.ac: Update check of GMP_NUMB_BITS declaration in + assembly files. Was broken by rename of configure variable + GMP_NUMB_BITS --> NUMB_BITS. + + 2017-11-11 Niels Möller + + * nettle.texinfo: Document nettle_get_hashes, nettle_get_ciphers + and nettle_get_aeads, and replace nettle_secp_256r1 by + nettle_get_secp_256r1. Update version numbers. Delete ancient + setting of ispell-skip-region-alist as an emacs file-local + variable. + + 2017-11-08 Niels Möller + + * ecc-curve.h (nettle_secp_192r1, nettle_secp_224r1) + (nettle_secp_256r1, nettle_secp_384r1, nettle_secp_521r1): Delete + macro wrappers, partially reverting below 2017-04-09 change. They + didn't work at all for applications that only see a forward + declaration of struct ecc_curve. Instead, we will have to make an + ABI and API break and delete these symbols, when the size of + struct ecc_curve is increased. + + 2017-11-05 Niels Möller + + * configure.ac Bump package version to 3.4. + (LIBNETTLE_MINOR): Bump library version to 6.4. + (LIBHOGWEED_MINOR): Bump library version to 4.4. + + 2017-10-23 Niels Möller + + * examples/Makefile.in (check): Also set DYLD_LIBRARY_PATH in the + environment, to support Mac OSX shared libraries. + * testsuite/Makefile.in (LD_LIBRARY_PATH): Likewise. + + 2017-10-23 Niels Möller + + Merge API fixes, starting at 2017-01-12. + + 2017-04-09 Niels Möller + + * ecc-curve.h (nettle_get_secp_192r1, nettle_get_secp_224r1) + (nettle_get_secp_256r1, nettle_get_secp_384r1) + (nettle_get_secp_521r1): New functions, returning a pointer to + corresponding structure. + (nettle_secp_192r1, nettle_secp_224r1, nettle_secp_256r1) + (nettle_secp_384r1, nettle_secp_521r1): Redefined as macros, + calling the corresponding function. + + * nettle-meta.h (nettle_ciphers, nettle_aeads, nettle_armors): New + macros, analogous to below change to nettle_hashes. + + * nettle-meta-ciphers.c (nettle_get_ciphers): New function. + + * nettle-meta-aeads.c (nettle_get_aeads): New function. + + * nettle-meta-armors.c (nettle_get_armors): New function. + + 2017-01-12 Niels Möller + + * tools/nettle-hash.c (find_algorithm): Deleted function. + (main): Replaced by call to nettle_lookup_hash. + + * testsuite/meta-hash-test.c (test_main): Use nettle_lookup_hash. + + * nettle-meta.h (nettle_hashes): New macro, expanding to a call to + nettle_get_hashes. Direct access to the array causes the array + size to leak into the ABI, since a plain un-relocatable executable + linking with libnettle.so gets copy relocations for any referenced + data items in the shared library. + + * nettle-meta-hashes.c (nettle_get_hashes): New function. + + 2017-10-16 Niels Möller + + CFB support, contributed by Dmitry Eremin-Solenikov. + * cfb.c (cfb_encrypt, cfb_decrypt): New file, new functions. + * cfb.h: New header file. + (CFB_CTX, CFB_SET_IV, CFB_ENCRYPT, CFB_DECRYPT): New macros. + * Makefile.in (nettle_SOURCES): Add cfb.c. + (HEADERS): Add cfb.h. + * testsuite/cfb-test.c: New test case. + * testsuite/testutils.c (test_cipher_cfb): New function. + * nettle.texinfo (CFB): Documentation. + + 2017-10-16 Niels Möller + + * aclocal.m4 (GMP_PROG_CC_FOR_BUILD): Add -g when compiling with + gcc. + + 2017-09-27 Niels Möller + + Merged armor-signedness branch, starting 2017-08-27. + + 2017-09-24 Niels Möller + + * tools/pkcs1-conv.c (base64_decode_in_place): New helper + function. + (decode_base64): Use it. + + * sexp-transport-format.c (base64_encode_in_place): New helper + function. + (sexp_transport_vformat): Use it. + + * testsuite/base64-test.c (test_fuzz_once): Update to use char + type where appropriate. + (test_main): Use helper functions base64_encode_in_place and + base64_decode_in_place (copied to this file). + + * testsuite/testutils.c (tstring_data): Use uint8_t for data + argument. + * testsuite/testutils.h (SDATA): Use US macro to cast data + argument. + + 2017-08-27 Niels Möller + + * base64-encode.c (base64_encode_raw, base64_encode_group) + (base64_encode_single, base64_encode_update) + (base64_encode_final): Change type of destination to char *. + * base16-encode.c (base16_encode_single, base16_encode_update): + Likewise. + * base64-decode.c (base64_decode_single, base64_decode_update): + Change type of source argument to const char *. Update (almost) + all callers. + * base16-decode.c (base16_decode_single, base16_decode_update): + Likewise. + * nettle-types.h (nettle_armor_encode_update_func) + (nettle_armor_encode_final_func, nettle_armor_decode_update_func): + Corresponding updates to typedefs. + + 2017-09-14 Niels Möller + + * hkdf.c: Delete unneeded includes. Use Nettle licensing notice. + * hkdf.h: Include only nettle-types.h, not nettle-meta.h. + + * ecc-mod.c (ecc_mod): Workaround to silence a false positive from + the clang static analyzer. + + 2017-09-12 Niels Möller + + * testsuite/testutils.h (mpn_zero_p): Avoid redefining mpn_zero_p + when building with mini-gmp. Since the mini-gmp update, this + function is defined by mini-gmp, causing link errors if nettle is + configured with --enable-mini-gmp --disable-shared. Reported by + Tim Rühsen. + + 2017-09-09 Daiki Ueno + + * testsuite/ecc-mul-g-test.c (test_main): Fixed mpn_cmp call. + * testsuite/ecc-mul-a-test.c (test_main): Likewise. + * eccdata.c (ecc_point_out): Write to given stream, instead of + stderr. + * eccdata.c (output_curve): In curve448, the bit size of the order + is slightly smaller than the one of p's. Adjust ecc_Bmodq_shifted + accordingly. + + 2017-09-09 Niels Möller + + * mini-gmp.c: Updated mini-gmp from the gmp repository, latest + change from 2017-07-23. + * mini-gmp.h: Likewise. + + 2017-09-06 Niels Möller + + * hkdf.c (hkdf_expand): Eliminate a (signed) ssize_t variable, use + break rather than return at loop termination. + + 2017-09-06 Niels Möller + + HKDF implementation, contributed by Nikos Mavrogiannopoulos. + * hkdf.c (hkdf_extract, hkdf_expand): New file, new functions. + * hkdf.h: New file. + * Makefile.in (nettle_SOURCES): Add hkdf.c. + (HEADERS): Add hkdf.h. + * testsuite/hkdf-test.c: Tests for hkdf-sha256 and hkdf-sha1. + * testsuite/Makefile.in (TS_NETTLE_SOURCES): Added hkdf-test.c. + * nettle.texinfo (Key derivation functions): Document HKDF. + + 2017-09-04 Andreas Schneider + + * fat-arm.c: Add missing define for _GNU_SOURCE. + + 2017-08-27 Niels Möller + + * configure.ac (GMP_NUMB_BITS): Set to dummy value "n/a" in + mini-gmp builds. + (NUMB_BITS): New substituted variable which always holds the + configured value. + * Makefile.in (GMP_NUMB_BITS): Renamed variable... + (NUMB_BITS): ...new name + * config.make.in: Update corresponding substitution. + + 2017-08-26 Niels Möller + + * ecc-mod-inv.c (ecc_mod_inv): Add missing assert. Fixes a + "dead increment" warning from the clang static analyzer. + + 2017-08-26 Niels Möller + + * examples/nettle-openssl.c (struct openssl_cipher_ctx): New + struct. Use everywhere, instead of typing EVP_CIPHER_CTX pointers + directly. + + * configure.ac: Update openssl-related tests. Checks for + cipher-specific headers are replaced by a check for openssl/evp.h, + and the check for the BF_ecb_encrypt function is replaced by a + check for EVP_CIPHER_CTX_new. + + 2017-08-03 Daniel P. Berrange + + * examples/nettle-openssl.c: Rewritten to use openssl's EVP APIs. + The older cipher-specific functions always use openssl's generic + software implementation, while the EVP functions enables + platform-specific code, e.g., using the x86 AES-NI instructions. + (nettle_openssl_init): New function. + + 2017-07-18 Niels Möller + + * ecc-add-eh.c (ecc_add_eh): Fix in-place operation by reordering + two multiplies. Previously, in-place operation resulted in an + invalid call to mpn_mul with overlapping operands. Reported by + Sergei Trofimovich. + + 2017-06-09 Niels Möller + + * pss.c (pss_verify_mgf1): Check for m being too large, fixing an + assertion failure for certain invalid signatures. Based on a patch + contributed by Daiki Ueno. + + * testsuite/rsa-pss-sign-tr-test.c (test_main): Add test case + contributed by Daiki Ueno. Problem originally found by oss-fuzz, + see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2132. + That problem report is currently embargoed, but will hopefully be + public in a month or two. + + 2017-05-23 Niels Möller + + Rework the previous change, which had the unintended effect of + always regenerating .test-rules.make after ./configure is run. + * testsuite/Makefile.in (test-rules.stamp): New stamp file target, + depend on Makefile.in, and run $(MAKE) test-rules. + (.test-rules.make): Add a level of indirection, by depending on + test-rules.stamp. + + 2017-05-20 Niels Möller + + * testsuite/Makefile.in (test-rules): Use $(srddir)/-prefix for + .test-rules.make target, and change dependency from Makefile.in to + Makefile. + + 2017-05-17 Nikos Mavrogiannopoulos + + * testsuite/Makefile.in: Ensure .test-rules.make is regenerated + when Makefile.in is modified. + + 2017-04-09 Niels Möller + + * testsuite/dlopen-test.c (main): Call dlclose, to fix memory leak + on success. + + * testsuite/pss-test.c: Delete magic to let valgrind to check if + pss_encode_mgf1 is side-channel silent with respect to the salt + and digest inputs. It turns out that the most significant bits of + the padded bignum, and hence its size, depends on these inputs. + Which results in a data-dependent branch in the normalization code + of at the end of gmp's mpz_import. + + 2017-04-04 Niels Möller + + * pss.c (pss_verify_mgf1): Use const for input mpz_t argument. + (pss_encode_mgf1): Avoid unnecessary memset and xor operations. + + Merged RSA-PSS support, contributed by Daiki Ueno. + * pss-mgf1.h, pss.h: New header files. + * pss-mgf1.c (pss_mgf1): New file and function. + * pss.c (pss_encode_mgf1, pss_verify_mgf1): New file and + functions. + * rsa-verify.c (_rsa_verify_recover): New function. + * rsa-pss-sha256-sign-tr.c: (rsa_pss_sha256_sign_digest_tr): New + file and function. + * rsa-pss-sha256-verify.c (rsa_pss_sha256_verify_digest): New + file and function. + * rsa-pss-sha512-sign-tr.c (rsa_pss_sha384_sign_digest_tr) + (rsa_pss_sha512_sign_digest_tr): New file and functions. + * rsa-pss-sha512-verify.c (rsa_pss_sha384_verify_digest) + (rsa_pss_sha512_verify_digest): New file and functions. + * rsa.h: Prototypes for new functions. + * testsuite/rsa-pss-sign-tr-test.c: New test case. + * testsuite/pss-test.c: New test case. + * testsuite/pss-mgf1-test.c: New test case. + * Makefile.in, testsuite/Makefile.in: Added new files. + * nettle.texinfo: Documentation of rsa-pss functions. + + 2017-03-20 Niels Möller + + * nettle-internal.h (NETTLE_MAX_HASH_CONTEXT_SIZE): New constant. + * testsuite/meta-hash-test.c (test_main): Add sanity check for + NETTLE_MAX_HASH_CONTEXT_SIZE. + + * tools/nettle-hash.c (list_algorithms): Also display the internal + context size. + + 2017-01-03 Nikos Mavrogiannopoulos + + * ecdsa-verify.c (ecdsa_verify): Eliminated memory leak on error + path. + + 2016-10-10 Niels Möller + + * write-be32.c (_nettle_write_be32): Use const for source argument. + * write-le32.c (_nettle_write_le32): Likewise. + * write-le64.c (_nettle_write_le64): Likewise. + * nettle-write.h: Update prototypes. + 2016-10-01 Niels Möller * Released nettle-3.3. diff --cc Makefile.in index d308b828,6a0c13ec..d5b9a258 --- a/Makefile.in +++ b/Makefile.in @@@ -197,9 -200,9 +201,9 @@@ HEADERS = aes.h arcfour.h arctwo.h asn1 memops.h memxor.h \ nettle-meta.h nettle-types.h \ pbkdf2.h \ - pgp.h pkcs1.h realloc.h ripemd160.h rsa.h \ + pgp.h pkcs1.h pss.h pss-mgf1.h realloc.h ripemd160.h rsa.h \ salsa20.h sexp.h \ - serpent.h sha.h sha1.h sha2.h sha3.h twofish.h \ + serpent.h sha.h sha1.h sha2.h sha3.h skein.h twofish.h \ umac.h yarrow.h poly1305.h INSTALL_HEADERS = $(HEADERS) nettle-stdint.h version.h @IF_MINI_GMP@ mini-gmp.h diff --cc testsuite/Makefile.in index b8ee7ff4,3117d66d..e3190c98 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@@ -23,10 -23,9 +23,10 @@@ TS_NETTLE_SOURCES = aes-test.c arcfour- sha384-test.c sha512-test.c sha512-224-test.c sha512-256-test.c \ sha3-permute-test.c sha3-224-test.c sha3-256-test.c \ sha3-384-test.c sha3-512-test.c \ + skein256-test.c skein512-test.c \ serpent-test.c twofish-test.c version-test.c \ knuth-lfib-test.c \ - cbc-test.c ctr-test.c gcm-test.c eax-test.c ccm-test.c \ + cbc-test.c cfb-test.c ctr-test.c gcm-test.c eax-test.c ccm-test.c \ poly1305-test.c chacha-poly1305-test.c \ hmac-test.c umac-test.c \ meta-hash-test.c meta-cipher-test.c\