]>
git.ipfire.org Git - thirdparty/nettle.git/log
Niels Möller [Wed, 23 Feb 2022 16:51:23 +0000 (16:51 +0000)]
Merge branch 's390x-ghash-refactor' into 'ghash-refactor'
Refactor s390x-specific code for new ghash organization
See merge request nettle/nettle!44
Maamoun TK [Wed, 23 Feb 2022 09:08:07 +0000 (11:08 +0200)]
Refactor s390x-specific code for new ghash organization
Niels Möller [Tue, 22 Feb 2022 18:43:41 +0000 (19:43 +0100)]
ppc: Update fat setup for new ghash organization.
Niels Möller [Tue, 22 Feb 2022 17:01:55 +0000 (18:01 +0100)]
ppc: Update vpmsumd ghash to new organization.
Niels Möller [Tue, 22 Feb 2022 17:00:23 +0000 (18:00 +0100)]
Comment fix.
Niels Möller [Mon, 21 Feb 2022 17:58:40 +0000 (18:58 +0100)]
arm64: Update fat setup for new ghash organization.
Niels Möller [Mon, 21 Feb 2022 17:35:45 +0000 (18:35 +0100)]
Fix comment error
Niels Möller [Mon, 21 Feb 2022 16:39:31 +0000 (17:39 +0100)]
arm64: Update pclmul ghash to new organization.
Niels Möller [Sat, 19 Feb 2022 21:25:57 +0000 (22:25 +0100)]
Update fat setup for new ghash organization.
Niels Möller [Sat, 19 Feb 2022 19:45:37 +0000 (20:45 +0100)]
Delete _ghash_digest.
Niels Möller [Sat, 19 Feb 2022 19:39:03 +0000 (20:39 +0100)]
x86_64: Update pclmul ghash to new organization.
Niels Möller [Sat, 19 Feb 2022 19:00:26 +0000 (20:00 +0100)]
x86_64: Update table-based ghash to new organization.
Niels Möller [Sat, 19 Feb 2022 18:54:34 +0000 (19:54 +0100)]
Move _ghash_digest.
Niels Möller [Fri, 18 Feb 2022 20:14:49 +0000 (21:14 +0100)]
Refactor GCM C implementation.
Assembly implementations not yet updated.
* Makefile.in (nettle_SOURCES): Add ghash-set-key.c ghash-update.c.
(DISTFILES): Replaced gcm-internal.h with ghash-internal.h.
* testsuite/gcm-test.c (test_ghash_internal): Updated to use
_ghash_set_key and _ghash_update.
* gcm.c (INC32): Deleted macro, used in only one place.
(gcm_set_key): Update to use _ghash_set_key.
(gcm_hash): Renamed, was _gcm_hash, and implemented in terms of
_ghash_update.
(bswap_if_le): New function (copied from nist-keywrap.c).
(gcm_hash_sizes): Use bswap_if_le and _ghash_update.
(gcm_set_iv): Updated to use gcm_hash and block16_zero.
(gcm_digest): Use _ghash_digest.
* ghash-internal.h: New file, declaring new internal ghash interface.
* gcm-internal.h: Deleted file.
* ghash-update.c (gcm_gf_shift_8): Moved here (from gcm.c)
(gcm_gf_mul): Likewise.
(_ghash_update): New function, extracted from _nettle_gcm_hash_c.
(_ghash_digest): New function.
* ghash-set-key.c (_ghash_set_key): New file and function.
Extracted from _nettle_gcm_init_key_c and _nettle_gcm_set_key.
Niels Möller [Fri, 18 Feb 2022 20:12:49 +0000 (21:12 +0100)]
New function block16_zero.
Niels Möller [Thu, 17 Feb 2022 18:26:12 +0000 (19:26 +0100)]
Delete code for GCM_TABLE_BITS != 8.
Niels Möller [Tue, 15 Feb 2022 20:21:21 +0000 (21:21 +0100)]
x86_64: Fat setup for GCM.
Niels Möller [Tue, 15 Feb 2022 20:19:31 +0000 (21:19 +0100)]
Fix comment typo.
Niels Möller [Tue, 15 Feb 2022 19:53:26 +0000 (20:53 +0100)]
x86_64: Initial implementation of gcm using the pclmulqdq instructions.
Niels Möller [Thu, 10 Feb 2022 17:32:12 +0000 (18:32 +0100)]
Rearrange gcm configuration defines, and add tests for internal functions.
Niels Möller [Fri, 28 Jan 2022 18:35:38 +0000 (19:35 +0100)]
Add tests for edge cases in poly1305 digest folding.
Niels Möller [Thu, 27 Jan 2022 21:10:50 +0000 (22:10 +0100)]
x86_64: Rewrite of poly1305 assembly.
Niels Möller [Tue, 25 Jan 2022 18:51:14 +0000 (19:51 +0100)]
ChangeLog entry for arm64 implementation of chacha.
Niels Möller [Tue, 25 Jan 2022 18:47:39 +0000 (18:47 +0000)]
Merge branch 'arm64-chacha' into 'master'
[Arm64] Optimize Chacha20
See merge request nettle/nettle!37
Niels Möller [Mon, 24 Jan 2022 19:06:10 +0000 (20:06 +0100)]
ChangeLog entries for new ppc64 ecc files.
Martin Schwenke [Fri, 21 Jan 2022 04:02:38 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_448_modp
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Niels Möller [Mon, 24 Jan 2022 18:49:52 +0000 (19:49 +0100)]
Move a comment.
Martin Schwenke [Fri, 21 Jan 2022 04:02:37 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_25519_modp
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Amitay Isaacs [Fri, 21 Jan 2022 04:02:34 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_224_modp
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Niels Möller [Mon, 24 Jan 2022 17:58:54 +0000 (18:58 +0100)]
Simplify poly1305-test, more use of tstring length.
Niels Möller [Sun, 23 Jan 2022 13:27:03 +0000 (14:27 +0100)]
Add randomized tests of poly1305.
Niels Möller [Sun, 23 Jan 2022 13:21:48 +0000 (14:21 +0100)]
Arrange so that GMP or mini-gmp is always available for tests.
Niels Möller [Fri, 21 Jan 2022 18:29:11 +0000 (19:29 +0100)]
ChangeLog entries for new ppc64 ecc files.
Martin Schwenke [Fri, 21 Jan 2022 04:02:36 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_521_modp
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Martin Schwenke [Fri, 21 Jan 2022 04:02:35 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_384_modp
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Amitay Isaacs [Fri, 21 Jan 2022 04:02:33 +0000 (15:02 +1100)]
ecc: Add powerpc64 assembly for ecc_192_modp
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Mamone Tarsha [Thu, 20 Jan 2022 21:14:55 +0000 (23:14 +0200)]
[Arm64] Optimize Chacha20
Niels Möller [Thu, 20 Jan 2022 20:27:09 +0000 (20:27 +0000)]
Merge branch 's390x-chacha' into 'master'
[S390x] Optimize Chacha20 with fat build support
See merge request nettle/nettle!40
Mamone Tarsha [Tue, 18 Jan 2022 17:32:31 +0000 (19:32 +0200)]
[S390x] Optimize Chacha20
Niels Möller [Mon, 17 Jan 2022 20:19:31 +0000 (21:19 +0100)]
tests: Use inline function for dummy definition of test_randomize.
Niels Möller [Mon, 17 Jan 2022 20:03:10 +0000 (21:03 +0100)]
Share ecc point validation function in testutils.c.
* testsuite/testutils.c (test_ecc_point_valid_p): New function,
moved from...
* testsuite/ecdsa-keygen-test.c (ecc_valid_p): ... old copy.
* testsuite/gostdsa-keygen-test.c (ecc_valid_p): ... old copy.
* testsuite/testutils.h: Declare it.
Niels Möller [Mon, 17 Jan 2022 19:52:42 +0000 (20:52 +0100)]
Whitespace cleanup
Niels Möller [Mon, 10 Jan 2022 19:22:30 +0000 (20:22 +0100)]
ppc: Reduce number of registers used for ecc_secp256r1_redc.
Niels Möller [Tue, 4 Jan 2022 19:37:27 +0000 (20:37 +0100)]
ppc: New configure test for ELFV2_ABI
Niels Möller [Thu, 9 Dec 2021 20:39:09 +0000 (21:39 +0100)]
x86_64: Improved ecc_secp256r1_redc
* x86_64/ecc-secp256r1-redc.asm: New folding scheme with one less
carry propagation phase, and fewer registers, avoiding save and
restore of callee-save registers. 17% speedup of this function on
AMD Ryzen 5, resulting in a modest improvement in ecdsa
performance.
Niels Möller [Thu, 9 Dec 2021 20:31:24 +0000 (21:31 +0100)]
ChangeLog for previous change.
Amitay Isaacs [Tue, 7 Dec 2021 20:20:35 +0000 (21:20 +0100)]
ppc: Add powerpc64 assembly for ecc_256_redc
Tianjia Zhang [Tue, 7 Dec 2021 20:34:44 +0000 (21:34 +0100)]
doc: documentation for SM3 hash
To: Niels Möller <nisse@lysator.liu.se>, nettle-bugs@lists.lysator.liu.se
Cc: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Date: Mon, 6 Dec 2021 16:57:00 +0800 (1 day, 11 hours, 33 minutes ago)
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Niels Möller [Sun, 5 Dec 2021 20:21:46 +0000 (21:21 +0100)]
Merge branch 'sm3'
Niels Möller [Wed, 1 Dec 2021 21:20:10 +0000 (22:20 +0100)]
Comment improvements for x86_64 ecc_secp256r1_redc
Tianjia Zhang [Mon, 29 Nov 2021 12:32:36 +0000 (20:32 +0800)]
nettle-benchmark: bench SM3 hashes
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tianjia Zhang [Mon, 29 Nov 2021 12:32:35 +0000 (20:32 +0800)]
hmac: add support for SM3 hash function
Add support for calculating HMAC using SM3 hash functions.
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tianjia Zhang [Mon, 29 Nov 2021 12:32:34 +0000 (20:32 +0800)]
testsuite: add test for SM3 hash function
Add a testuite for SM3 hash function. Test vectors are based on:
https://datatracker.ietf.org/doc/html/draft-shen-sm3-hash-01
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Tianjia Zhang [Mon, 29 Nov 2021 12:32:33 +0000 (20:32 +0800)]
Add OSCCA SM3 hash algorithm
Add OSCCA SM3 secure hash (OSCCA GM/T 0004-2012 SM3) generic
hash transformation.
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Niels Möller [Fri, 19 Nov 2021 21:01:26 +0000 (22:01 +0100)]
Delete function mpz_limbs_read_n.
Niels Möller [Fri, 19 Nov 2021 20:46:56 +0000 (21:46 +0100)]
Delete function mpz_limbs_cmp.
Niels Möller [Mon, 15 Nov 2021 18:53:48 +0000 (19:53 +0100)]
gitlab-ci: Enable randomized tests
Add NETTLE_TEST_SEED=0 when running make check, in all configurations
except the --enable-mini-gmp build.
Niels Möller [Mon, 15 Nov 2021 18:48:26 +0000 (19:48 +0100)]
Randomize more tests
Niels Möller [Mon, 15 Nov 2021 18:43:36 +0000 (19:43 +0100)]
Reduce allocation in modinv test
Niels Möller [Mon, 15 Nov 2021 18:40:58 +0000 (19:40 +0100)]
Fix sqrt_ratio test for v = 0 case.
Niels Möller [Mon, 15 Nov 2021 18:38:11 +0000 (19:38 +0100)]
Reduce allocation in sqrt tests
Niels Möller [Sat, 13 Nov 2021 16:17:36 +0000 (17:17 +0100)]
Move NETTLE_TEST_SEED logic to testutils.c.
* testsuite/testutils.c (get_random_seed): Move function here.
(test_randomize): New function.
* testsuite/ecc-mod-test.c (get_random_seed): Delete old copy.
(test_main): Use test_randomize.
* testsuite/rsa-compute-root-test.c (get_random_seed): Delete old copy.
(test_main): Use test_randomize.
Niels Möller [Sat, 13 Nov 2021 16:15:21 +0000 (17:15 +0100)]
Delete obsolete comment.
Niels Möller [Sat, 13 Nov 2021 08:36:20 +0000 (09:36 +0100)]
Fix and test for sqrt(0) special case.
Niels Möller [Thu, 11 Nov 2021 20:43:13 +0000 (21:43 +0100)]
eccdata: Output ecc_sqrt_z and ECC_SQRT_E only when computed.
Niels Möller [Thu, 11 Nov 2021 20:29:17 +0000 (21:29 +0100)]
Fix comment typo.
Niels Möller [Thu, 11 Nov 2021 20:22:44 +0000 (21:22 +0100)]
Let secp384r1 inverse and sqrt share most of the powering.
* ecc-secp384r1.c (ecc_mod_pow_288m32m1): New function.
(ecc_secp384r1_inv): Use ecc_mod_pow_288m32m1.
(ecc_secp384r1_sqrt): Likewise.
Niels Möller [Thu, 11 Nov 2021 18:52:30 +0000 (19:52 +0100)]
eccdata: Delete generation of unused values ecc_sqrt_t and ECC_SQRT_T_BITS.
Niels Möller [Wed, 10 Nov 2021 17:46:02 +0000 (18:46 +0100)]
eccdata: Generate both redc and non-redc versions of ecc_sqrt_z.
Niels Möller [Mon, 8 Nov 2021 19:14:32 +0000 (20:14 +0100)]
Implement secp224r1 square root, based on patch by Wim Lewis.
Niels Möller [Mon, 8 Nov 2021 19:10:32 +0000 (20:10 +0100)]
New function ecc_mod_equal_p, based on patch by Wim Lewis.
Niels Möller [Mon, 8 Nov 2021 19:03:11 +0000 (20:03 +0100)]
New function ecc_mod_pow_127m1, used for ecc_secp224r1_inv.
Niels Möller [Mon, 8 Nov 2021 16:51:07 +0000 (17:51 +0100)]
Implement secp521r1 square root, based on patch by Wim Lewis.
Niels Möller [Mon, 8 Nov 2021 16:47:12 +0000 (17:47 +0100)]
Implement secp384r1 square root, based on patch by Wim Lewis.
Niels Möller [Mon, 8 Nov 2021 16:41:54 +0000 (17:41 +0100)]
Implement secp256r1 square root, based on patch by Wim Lewis.
Niels Möller [Mon, 8 Nov 2021 16:37:05 +0000 (17:37 +0100)]
Implement secp192r1 square root, based on patch by Wim Lewis.
Niels Möller [Sat, 6 Nov 2021 16:10:26 +0000 (17:10 +0100)]
Renamed sqrt_itch --> sqrt_ratio_itch, and curve25519 and curve448 sqrt functions.
Niels Möller [Sat, 6 Nov 2021 15:38:41 +0000 (16:38 +0100)]
Rename ecc sqrt --> sqrt_ratio.
* ecc-internal.h (ecc_mod_sqrt_ratio_func): Renamed typedef...
(ecc_mod_sqrt_func): ... from old name.
(struct ecc_modulo): Renamed corresponding function pointer to
sqrt_ratio. Updated all uses.
Niels Möller [Sat, 6 Nov 2021 15:30:50 +0000 (16:30 +0100)]
Merge branch 'secp256r1-mod'
Niels Möller [Sun, 31 Oct 2021 07:35:19 +0000 (07:35 +0000)]
Merge branch 's390x-sha1' into 'master'
[S390x] Optimize SHA3 permute using vector facility
This patch optimizes SHA3 permute function by taking advantage of supported vector facility. Vectorizing SHA3 permute fits more than applying SHA3 hardware-accelerator for s390x architecture in terms of implementing the actual permute procedure only rather than executing unneeded extra procedures which are handled by other functions in nettle library. Applying SHA3 hardware-accelerator in a previous patch yielded 12% performance boost while this patch has ~105% performance increase for SHA3 functions.
The optimized core follows the same optimization procedure that used in SHA3 permute implementation for x86_64 architecture.
| Algorithm | C (Mbyte/s) | Vectorized (Mbyte/s) |
| ------ | ------ | ------ |
| sha3_224 | 235.08 | 483.41 |
| sha3_256 | 226.15 | 460.68 |
| sha3_384 | 172.90 | 357.15 |
| sha3_512 | 120.46 | 243.96 |
See merge request nettle/nettle!36
Niels Möller [Tue, 26 Oct 2021 16:00:07 +0000 (18:00 +0200)]
New function ecc_mod_zero_p.
* ecc-mod-arith.c (ecc_mod_zero_p): New function.
* ecc-curve25519.c (ecc_curve25519_zero_p): Use it.
* ecc-curve448.c (ecc_curve448_zero_p): Deleted, usage replaced
with ecc_mod_zero_p.
* testsuite/ecc-modinv-test.c (mod_eq_p): Rewritten to use
ecc_mod_zero_p, and require that one input is canonically reduced.
(zero_p): Deleted, usage replaced with ecc_mod_zero_p.
Mamone Tarsha [Sun, 24 Oct 2021 18:39:11 +0000 (20:39 +0200)]
[S390x] Improvements on documentation and instruction set usage for SHA3 permute
Niels Möller [Sat, 23 Oct 2021 18:39:15 +0000 (20:39 +0200)]
New function sec_zero_p.
Mamone Tarsha [Fri, 22 Oct 2021 13:08:04 +0000 (15:08 +0200)]
[S390x] Remove lgr instructions by using xgrk instead of xgr instruction
Niels Möller [Fri, 22 Oct 2021 08:03:12 +0000 (10:03 +0200)]
Rewrite of secp256r1 mod functions.
Niels Möller [Fri, 22 Oct 2021 07:46:03 +0000 (09:46 +0200)]
Extend ecc-mod-test, with improved coverage of corner cases.
Mamone Tarsha [Thu, 21 Oct 2021 09:25:26 +0000 (11:25 +0200)]
[S390x] Optimize SHA3 permute using vector facility
Niels Möller [Tue, 12 Oct 2021 15:45:15 +0000 (17:45 +0200)]
Change "signature on digest" --> "of digest".
Niels Möller [Tue, 12 Oct 2021 06:07:17 +0000 (08:07 +0200)]
Doc fixes.
Add documented types to the index. Clarify docs on dsa_signature,
ecc_point_clear and ecc_scalar_clear. Fix typo in docs of ecdsa_sign.
Niels Möller [Fri, 24 Sep 2021 05:48:11 +0000 (07:48 +0200)]
Delete a few old FIXME comments
Niels Möller [Tue, 21 Sep 2021 19:45:13 +0000 (21:45 +0200)]
Use @url and https consistently for references. Fix overlong lines.
Niels Möller [Tue, 21 Sep 2021 19:18:32 +0000 (21:18 +0200)]
Use texi2pdf to generate the pdf manual
Niels Möller [Tue, 21 Sep 2021 19:13:38 +0000 (21:13 +0200)]
ChangeLog entries for doc structure improvements.
Niels Möller [Tue, 21 Sep 2021 19:03:11 +0000 (21:03 +0200)]
Divide Cipher section into menu and nodes, and some other minor fixes.
Niels Möller [Tue, 21 Sep 2021 16:20:43 +0000 (18:20 +0200)]
Delete explicit node pointers in nettle.texinfo
Instead, rely on makeinfo's automatic pointer creation.
Niels Möller [Tue, 14 Sep 2021 12:40:35 +0000 (14:40 +0200)]
Change CBC-AES interface
* cbc.h (cbc_aes128_encrypt, cbc_aes192_encrypt)
(cbc_aes256_encrypt): Change interface, take cipher context
pointer and iv as separate arguments. Update C and x86_64
implementations and corresponding glue code.
Niels Möller [Tue, 14 Sep 2021 11:51:17 +0000 (13:51 +0200)]
Test AEAD encrypt/decrypt with message split into pieces.
Niels Möller [Sun, 12 Sep 2021 15:30:27 +0000 (17:30 +0200)]
Merge branch 'aes-cbc' into master
Niels Möller [Thu, 9 Sep 2021 19:46:29 +0000 (21:46 +0200)]
More checks for null pointers in test_aead, to silent static analyzer.
Niels Möller [Thu, 9 Sep 2021 19:40:59 +0000 (21:40 +0200)]
Fix checks of HAVE_NATIVE_cbc_aes*_encrypt