]> git.ipfire.org Git - thirdparty/nettle.git/log
thirdparty/nettle.git
5 years agoAdd benchmarking of ed25519, ed448 and curve448. ed448
Niels Möller [Fri, 3 Jan 2020 06:38:04 +0000 (07:38 +0100)] 
Add benchmarking of ed25519, ed448 and curve448.

5 years agoUse function pointer to represent eddsa dom prefix.
Niels Möller [Thu, 2 Jan 2020 21:58:07 +0000 (22:58 +0100)] 
Use function pointer to represent eddsa dom prefix.

5 years agoImplement ed448-shake256
Niels Möller [Thu, 2 Jan 2020 18:51:24 +0000 (19:51 +0100)] 
Implement ed448-shake256

5 years agoUpdate eddsa internals to support ed448.
Niels Möller [Thu, 2 Jan 2020 18:36:17 +0000 (19:36 +0100)] 
Update eddsa internals to support ed448.

5 years agoAdd dom string to struct ecc_eddsa.
Niels Möller [Thu, 2 Jan 2020 18:24:45 +0000 (19:24 +0100)] 
Add dom string to struct ecc_eddsa.

5 years agoFix comment typo.
Niels Möller [Thu, 2 Jan 2020 06:45:33 +0000 (07:45 +0100)] 
Fix comment typo.

5 years agoReduce scratch need for curve448 inverse and sqrt
Niels Möller [Wed, 1 Jan 2020 19:22:21 +0000 (20:22 +0100)] 
Reduce scratch need for curve448 inverse and sqrt

5 years agoTest edddsa point compression with curve448.
Niels Möller [Wed, 1 Jan 2020 13:42:01 +0000 (14:42 +0100)] 
Test edddsa point compression with curve448.

5 years agoReorganize eddsa, based on patch by Daiki Ueno.
Niels Möller [Mon, 30 Dec 2019 21:43:48 +0000 (22:43 +0100)] 
Reorganize eddsa, based on patch by Daiki Ueno.

* eddsa-internal.h (struct ecc_eddsa): New struct for eddsa
parameters.
ed25519-sha512.c (_nettle_ed25519_sha512): New parameter struct.
* eddsa-expand.c (_eddsa_expand_key): Replace input
struct nettle_hash with struct ecc_eddsa, and generalize for
ed448. Update all callers.
* eddsa-sign.c (_eddsa_sign): Likewise.
* eddsa-verify.c (_eddsa_verify): Likewise.
* eddsa-compress.c (_eddsa_compress): Store sign bit in most
significant bit of last byte, as specified by RFC 8032.
* eddsa-decompress.c (_eddsa_decompress): Corresponding update.
Also generalize to support ed448, and make validity checks
stricter.
* testsuite/eddsa-sign-test.c (test_ed25519_sign): New function.
(test_main): Use it.
* testsuite/eddsa-verify-test.c (test_ed25519): New function.
(test_main): Use it.

5 years agoWhitespace fixes.
Niels Möller [Sat, 28 Dec 2019 09:53:15 +0000 (10:53 +0100)] 
Whitespace fixes.

5 years agoTweak includes of nettle-meta.h.
Niels Möller [Sat, 28 Dec 2019 09:47:32 +0000 (10:47 +0100)] 
Tweak includes of nettle-meta.h.

* bignum.h: Drop unreleted include of nettle-meta.h.
* pss.h: Include nettle-meta.h explicitly.
* eddsa-internal.h: Likewise.

5 years agoDocument SHAKE-256. shake256
Niels Möller [Wed, 25 Dec 2019 18:55:17 +0000 (19:55 +0100)] 
Document SHAKE-256.

5 years agoSupport for SHAKE256, based on patch by Daiki Ueno.
Niels Möller [Wed, 25 Dec 2019 16:55:19 +0000 (17:55 +0100)] 
Support for SHAKE256, based on patch by Daiki Ueno.

* shake256.c (sha3_256_shake): New file and function.
* Makefile.in (nettle_SOURCES): Add shake256.c.
* testsuite/testutils.c (test_hash): Allow arbitrary digest size,
if hash->digest_size == 0.
* testsuite/shake.awk: New script to extract test vectors.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add shake256-test.c.
(DISTFILES): Add shake.awk.

5 years agoChangeLog entry for previous change.
Niels Möller [Wed, 25 Dec 2019 16:41:54 +0000 (17:41 +0100)] 
ChangeLog entry for previous change.

5 years agoGeneralize _sha3_pad to take magic value as argument.
Niels Möller [Wed, 25 Dec 2019 15:30:50 +0000 (16:30 +0100)] 
Generalize _sha3_pad to take magic value as argument.

5 years agoUse add_hh rather than add_hhh for ecc_mul_a_eh.
Niels Möller [Wed, 25 Dec 2019 10:33:08 +0000 (11:33 +0100)] 
Use add_hh rather than add_hhh for ecc_mul_a_eh.

* ecc-mul-a-eh.c (ecc_mul_a_eh) [ECC_MUL_A_EH_WBITS == 0]: Use
add_hh rather than add_hhh.
(table_init) [[ECC_MUL_A_EH_WBITS > 0]: Likewise.
* ecc-internal.h (ECC_MUL_A_EH_ITCH) [ECC_MUL_A_EH_WBITS == 0]:
Reduced from 13*n to 12*n.

5 years agoRename add and dup functions for Edwards curves.
Niels Möller [Tue, 17 Dec 2019 21:59:57 +0000 (22:59 +0100)] 
Rename add and dup functions for Edwards curves.

5 years agoUse function pointer rather than calling ecc_add_eh directly.
Niels Möller [Wed, 18 Dec 2019 07:15:55 +0000 (08:15 +0100)] 
Use function pointer rather than calling ecc_add_eh directly.

* eddsa-verify.c (_eddsa_verify): Use function pointer rather than
calling ecc_add_eh directly. Preparation for eddsa over curve448.

5 years agoSimplify ecc-benchmark.c and delete curve25519 special case.
Niels Möller [Tue, 17 Dec 2019 22:24:15 +0000 (23:24 +0100)] 
Simplify ecc-benchmark.c and delete curve25519 special case.

5 years agoEliminate one unneeded ecc_modp_add in ecc_dup_eh.
Niels Möller [Sun, 15 Dec 2019 18:01:45 +0000 (19:01 +0100)] 
Eliminate one unneeded ecc_modp_add in ecc_dup_eh.

5 years agoComment fixes and notation for ecc_dup_eh
Niels Möller [Sun, 15 Dec 2019 12:39:17 +0000 (13:39 +0100)] 
Comment fixes and notation for ecc_dup_eh

5 years agoComment fixes for ecc_add_ehh
Niels Möller [Sat, 14 Dec 2019 16:46:57 +0000 (17:46 +0100)] 
Comment fixes for ecc_add_ehh

5 years agoComment fixes for ecc_add_eh
Niels Möller [Sat, 14 Dec 2019 12:07:03 +0000 (13:07 +0100)] 
Comment fixes for ecc_add_eh

5 years agoNew function ecc_mul_m.
Niels Möller [Sat, 14 Dec 2019 09:00:23 +0000 (10:00 +0100)] 
New function ecc_mul_m.

* curve25519-mul.c (curve25519_mul): Use ecc_mul_m.
* curve448-mul.c (curve448_mul): Likewise.

* ecc-mul-m.c (ecc_mul_m): New file and function. Implements
multipliction for curves in Montgomery representation, as used for
curve25519 and curve448. Extracted from curve25519_mul.
* ecc-internal.h (ecc_mul_m): Declare.
(ECC_MUL_M_ITCH): New macro.
* Makefile.in (hogweed_SOURCES): Add ecc-mul-m.c.

5 years agoMerge branch 'curve448' into master
Niels Möller [Fri, 13 Dec 2019 17:24:41 +0000 (18:24 +0100)] 
Merge branch 'curve448' into master

5 years agoRevert itch macro changes. curve448
Niels Möller [Mon, 9 Dec 2019 18:28:15 +0000 (19:28 +0100)] 
Revert itch macro changes.

We now have h_to_a_itch <= mul_itch, mul_g_itch. Add asserts at a few
places relying on this.
(ECC_ECDSA_KEYGEN_ITCH, ECC_MAX): Delete macros.
(ECC_ECDSA_SIGN_ITCH): Revert previous change.

5 years agoTrim scratch usage of curve448 operations.
Niels Möller [Mon, 9 Dec 2019 17:58:53 +0000 (18:58 +0100)] 
Trim scratch usage of curve448 operations.

* ecc-448.c (ecc_mod_pow_446m224m1): Reduce scratch space from 9*n
to 6*n.
(ECC_448_INV_ITCH, ECC_448_SQRT_ITCH): Reduce accordingly.
* curve448-mul.c (curve448_mul): Reduce allocation from 14*n to 12*n.

5 years agox86_64 implementation of nettle_ecc_curve448_modp
Niels Möller [Sun, 8 Dec 2019 10:14:00 +0000 (11:14 +0100)] 
x86_64 implementation of nettle_ecc_curve448_modp

* x86_64/ecc-curve448-modp.asm (nettle_ecc_curve448_modp): New
assembly function.
* ecc-448.c (ecc_448_modp) [HAVE_NATIVE_ecc_curve448_modp]: Use
native nettle_ecc_curve448_modp if available.
* configure.ac (asm_hogweed_optional_list): Add ecc-curve448-modp.asm.
(HAVE_NATIVE_ecc_curve448_modp): New config.h define.

5 years agoDelete tests and code for ecdsa over curve25519.
Niels Möller [Sat, 7 Dec 2019 07:14:21 +0000 (08:14 +0100)] 
Delete tests and code for ecdsa over curve25519.

* ecc-eh-to-a.c (ecc_eh_to_a): Require op == 0, delete code only
used for non-standard ecdsa over curve25519.
* testsuite/ecdsa-sign-test.c (test_main): Delete test of ecdsa
over curve25519.
* testsuite/ecdsa-verify-test.c (test_main): Likewise.
* testsuite/ecdsa-keygen-test.c (test_main): Exclude curve25519
from test.

5 years agoFix configure check for __builtin_bswap64.
Niels Möller [Thu, 5 Dec 2019 08:02:15 +0000 (09:02 +0100)] 
Fix configure check for __builtin_bswap64.

* configure.ac: Use AC_TRY_LINK rather than AC_TRY_COMPILE to
check for __builtin_bswap64. Since calling an non-existing
function typically results in a warning only at compile time, but
fails at link time. Patch contributed by by George Koehler.

5 years agoAdd cast in test_cipher_cfb8.
Niels Möller [Wed, 4 Dec 2019 16:32:02 +0000 (17:32 +0100)] 
Add cast in test_cipher_cfb8.

* testsuite/testutils.c (test_cipher_cfb8): Add cast of size_t to
unsigned long for argument to fprintf.

5 years agoNew mod function for curve448, for 64-bit architectures
Niels Möller [Tue, 3 Dec 2019 21:56:47 +0000 (22:56 +0100)] 
New mod function for curve448, for 64-bit architectures

* ecc-448.c (ecc_448_modp) [GMP_NUMB_BITS == 64]: New function.

5 years agoChangeLog for curve448 changes
Niels Möller [Sun, 1 Dec 2019 19:15:46 +0000 (20:15 +0100)] 
ChangeLog for curve448 changes

5 years agoImplement Curve448 primitives
Daiki Ueno [Sat, 30 Nov 2019 09:29:23 +0000 (10:29 +0100)] 
Implement Curve448 primitives

This patch adds the necessary primitives for "curve448", defined in
RFC 7748.  Those primitives are namely: addition, doubling, scalar
multiplication of the generator or an arbitrary point, inversion, and
square root.

5 years agogitlab-ci: Disable gost in gnutls build
Niels Möller [Sun, 24 Nov 2019 08:28:01 +0000 (09:28 +0100)] 
gitlab-ci: Disable gost in gnutls build

Current gost support in gnutls depends on nettle internals.

5 years agoeccdata: (ecc_curve_init_str): Delete unused t and d arguments.
Niels Möller [Thu, 21 Nov 2019 19:00:35 +0000 (20:00 +0100)] 
eccdata: (ecc_curve_init_str): Delete unused t and d arguments.

Related to the the edwards_root member of struct ecc_curve, which
was used by ecc_a_to_eh before it was deleted, see 2014-09-17
entry below.
(ecc_curve_init): Delete corresponding curve25519 constants, and
NULL arguments passed for the other curves.

5 years agoMerge branch 'curve448' into master
Niels Möller [Thu, 21 Nov 2019 18:43:57 +0000 (19:43 +0100)] 
Merge branch 'curve448' into master

5 years agoUpdate link to Pike.
Niels Möller [Sat, 5 Oct 2019 07:30:04 +0000 (09:30 +0200)] 
Update link to Pike.

5 years agoLink to Rust bindings.
Justus Winter [Wed, 2 Oct 2019 12:10:27 +0000 (14:10 +0200)] 
Link to Rust bindings.

5 years agoSort bindings alphabetically.
Justus Winter [Wed, 2 Oct 2019 12:10:26 +0000 (14:10 +0200)] 
Sort bindings alphabetically.

5 years agoImprove cfb8 test
Niels Möller [Tue, 1 Oct 2019 17:56:38 +0000 (19:56 +0200)] 
Improve cfb8 test

* testsuite/testutils.c (test_cipher_cfb8): Reset destination area
between tests. Encrypt/decrypt final partial block.

5 years agoChangeLog for previous change.
Niels Möller [Tue, 1 Oct 2019 17:44:55 +0000 (19:44 +0200)] 
ChangeLog for previous change.

5 years agocfb8: don't truncate output IV if input is shorter than block size
Daiki Ueno [Fri, 27 Sep 2019 14:12:00 +0000 (16:12 +0200)] 
cfb8: don't truncate output IV if input is shorter than block size

Previously cfb8_decrypt didn't update the IV if the input is shorter
than the AES block size.  Reported by Stephan Mueller.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
5 years agosiv-test: Smaller cleanups. Call FAIL on all errors.
Niels Möller [Mon, 30 Sep 2019 18:07:33 +0000 (20:07 +0200)] 
siv-test: Smaller cleanups. Call FAIL on all errors.

5 years agosiv-test: Fix out-of-bounds read.
Niels Möller [Mon, 30 Sep 2019 17:53:50 +0000 (19:53 +0200)] 
siv-test: Fix out-of-bounds read.

5 years agoecc-internal.h comment fixes.
Niels Möller [Thu, 26 Sep 2019 04:37:05 +0000 (06:37 +0200)] 
ecc-internal.h comment fixes.

5 years agoAdd FIXME comment on struct gosthash94_ctx reorg.
Niels Möller [Sun, 15 Sep 2019 08:28:58 +0000 (10:28 +0200)] 
Add FIXME comment on struct gosthash94_ctx reorg.

5 years agoChangeLog entries for gosthash94cp.
Niels Möller [Sun, 15 Sep 2019 08:23:24 +0000 (10:23 +0200)] 
ChangeLog entries for gosthash94cp.

5 years agoAdd PBKDF2 support for gosthash94cp
Dmitry Eremin-Solenikov [Thu, 11 Jul 2019 18:43:16 +0000 (21:43 +0300)] 
Add PBKDF2 support for gosthash94cp

Russian technical comitee working on standartization of cryptography
algorithms has published the document describing usage of GOST R
34.11-94 hash function with PBKDF2 algorithm (MR 26.2.001-2012).
Add test vectors from that document and a special function implementing
Nettle interface for PBKDF2 using gosthash94cp.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoAdd HMAC functions for GOSTHASH94 and GOSTHASH94CP
Dmitry Eremin-Solenikov [Thu, 11 Jul 2019 18:43:15 +0000 (21:43 +0300)] 
Add HMAC functions for GOSTHASH94 and GOSTHASH94CP

GOST hash functions can be used to generate MAC using HMAC algorithm.
Add functions implementing HMAC with GOSTHASH94/GOSTHASH94CP.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoAdd GOST R 34.11-94 to nettle_hashes
Dmitry Eremin-Solenikov [Thu, 11 Jul 2019 18:43:14 +0000 (21:43 +0300)] 
Add GOST R 34.11-94 to nettle_hashes

Add entries for gosthash94 and gosthash94cp in nettle_hashes array.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoAdd support for GOSTHASH94CP: GOST R 34.11-94 hash with CryptoPro S-box
Dmitry Eremin-Solenikov [Thu, 11 Jul 2019 18:43:12 +0000 (21:43 +0300)] 
Add support for GOSTHASH94CP: GOST R 34.11-94 hash with CryptoPro S-box

Hash gosthash94 implements GOST R 34.11-94 standard using S-Box defined
in the standard 'for testing purposes only'. RFC 4357 defines S-Box
(CryptoPro one) for GOST R 34.11-94 hash function that is widely used in
applications. Add separate hash function algorithm (gosthash94cp)
implementing GOST R 34.11-94 hashing using that S-Box.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoStart separating GOST 28147-89 from GOST R 34.11-94
Dmitry Eremin-Solenikov [Thu, 11 Jul 2019 18:43:11 +0000 (21:43 +0300)] 
Start separating GOST 28147-89 from GOST R 34.11-94

Hash function GOST R 34.11-94 (gosthash94) in its compression function
uses Russian block cipher (GOST 28147-89, Magma). Start separating block
cipher code from hash function code. For now there is no public
interface for this cipher, it will be added later.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agodlopen-test: Use libnettle.dylib on MacOS.
Niels Möller [Sun, 15 Sep 2019 08:05:19 +0000 (10:05 +0200)] 
dlopen-test: Use libnettle.dylib on MacOS.

5 years agoMention dependencies on GNU make and GNU GMP in the README file.
Niels Möller [Sat, 14 Sep 2019 06:21:12 +0000 (08:21 +0200)] 
Mention dependencies on GNU make and GNU GMP in the README file.

5 years agogcm: move block shifting function to block-internal.h
Dmitry Eremin-Solenikov [Wed, 4 Sep 2019 06:10:31 +0000 (09:10 +0300)] 
gcm: move block shifting function to block-internal.h

Move GCM's block shift function to block-internal.h. This concludes
moving of all Galois mul-by-2 to single header.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoblock modes: move Galois shifts to block-internal.h
Dmitry Eremin-Solenikov [Wed, 4 Sep 2019 06:10:30 +0000 (09:10 +0300)] 
block modes: move Galois shifts to block-internal.h

Move Galois polynomial shifts to block-internal.h, simplifying common
code. GCM is left unconverted for now, this will be fixed later.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoblock-internal: add block XORing functions
Dmitry Eremin-Solenikov [Wed, 4 Sep 2019 06:10:29 +0000 (09:10 +0300)] 
block-internal: add block XORing functions

Add common implementations for functions doing XOR over
nettle_block16/nettle_block8.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agocmac64: fix nettle_block16 usage
Dmitry Eremin-Solenikov [Mon, 26 Aug 2019 18:20:22 +0000 (21:20 +0300)] 
cmac64: fix nettle_block16 usage

CMAC64 uses block8, rather than block16.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agogcm: use uint64_t member of nettle_block16
Dmitry Eremin-Solenikov [Mon, 26 Aug 2019 18:20:21 +0000 (21:20 +0300)] 
gcm: use uint64_t member of nettle_block16

Remove last usage of unsigned long member of nettle_block16.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoMerge branch 'block16-refactor' into master-updates
Niels Möller [Fri, 23 Aug 2019 04:31:13 +0000 (06:31 +0200)] 
Merge branch 'block16-refactor' into master-updates

6 years agoExpand documentation to cover CMAC-64 cmac64
Dmitry Eremin-Solenikov [Mon, 22 Jul 2019 06:37:12 +0000 (08:37 +0200)] 
Expand documentation to cover CMAC-64

6 years agoCMAC comment fixes
Niels Möller [Sun, 21 Jul 2019 12:47:17 +0000 (14:47 +0200)] 
CMAC comment fixes

6 years agoChangeLog for previous change
Niels Möller [Wed, 10 Jul 2019 21:00:33 +0000 (23:00 +0200)] 
ChangeLog for previous change

6 years agocmac: add CMAC-DES3 (CMAC-TDES) implementation
Dmitry Eremin-Solenikov [Tue, 2 Jul 2019 12:38:57 +0000 (15:38 +0300)] 
cmac: add CMAC-DES3 (CMAC-TDES) implementation

Implement CMAC using TrippleDES as underlying cipher.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
6 years agoChangeLog for previous change
Niels Möller [Wed, 10 Jul 2019 20:44:56 +0000 (22:44 +0200)] 
ChangeLog for previous change

6 years agocmac: add 64-bit mode CMAC
Dmitry Eremin-Solenikov [Tue, 9 Jul 2019 18:58:42 +0000 (21:58 +0300)] 
cmac: add 64-bit mode CMAC

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
6 years agoMark w member of union nettle_block16 as deprecated. block16-refactor
Niels Möller [Mon, 8 Jul 2019 20:25:39 +0000 (22:25 +0200)] 
Mark w member of union nettle_block16 as deprecated.

6 years agogcm: Use uint64_t member of nettle_block16.
Niels Möller [Mon, 8 Jul 2019 20:22:35 +0000 (22:22 +0200)] 
gcm: Use uint64_t member of nettle_block16.

6 years agoeax: Use uint64_t member of nettle_block16.
Niels Möller [Mon, 8 Jul 2019 19:09:50 +0000 (21:09 +0200)] 
eax: Use uint64_t member of nettle_block16.

6 years agoChangeLog for previous change
Niels Möller [Tue, 2 Jul 2019 20:38:21 +0000 (22:38 +0200)] 
ChangeLog for previous change

6 years agoMove MAC testing code to generic place from cmac-test
Dmitry Eremin-Solenikov [Tue, 2 Jul 2019 12:38:55 +0000 (15:38 +0300)] 
Move MAC testing code to generic place from cmac-test

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
6 years agoAdd tests that exercise public key checks for ECDH
Simo Sorce [Mon, 13 May 2019 19:24:56 +0000 (15:24 -0400)] 
Add tests that exercise public key checks for ECDH

When performing ECDH the peer provided public key needs to be checked
for validity. FIPS requires basic tests be performed to insure the
provided points are in fact on the selected curve. Those checks already
exists in the ecc_point_set() function.
Add an explicit test that checks the boundaries so that any regression
in checks will be caught.

Signed-off-by: Simo Sorce <simo@redhat.com>
6 years agoMerge branch 'siv-mode' into master-updates
Niels Möller [Tue, 2 Jul 2019 12:28:04 +0000 (14:28 +0200)] 
Merge branch 'siv-mode' into master-updates

6 years agoFixes for Nettle 3.5.1 nettle_3.5.1_release_20190627
Niels Möller [Wed, 26 Jun 2019 19:51:36 +0000 (21:51 +0200)] 
Fixes for Nettle 3.5.1

6 years agoChangeLog entry for 3.5 release nettle_3.5_release_20190626
Niels Möller [Wed, 26 Jun 2019 05:43:25 +0000 (07:43 +0200)] 
ChangeLog entry for 3.5 release

6 years agoUpdate config.guess and config.sub
Niels Möller [Tue, 25 Jun 2019 19:00:47 +0000 (21:00 +0200)] 
Update config.guess and config.sub

6 years agoNEWS for 3.5. Mention deprecations in intro. nettle_3.5rc1
Niels Möller [Sat, 15 Jun 2019 08:27:58 +0000 (10:27 +0200)] 
NEWS for 3.5. Mention deprecations in intro.

6 years agoFix some typos in the documentation.
Wim Lewis [Sat, 15 Jun 2019 08:15:39 +0000 (10:15 +0200)] 
Fix some typos in the documentation.

6 years agoMerge branch 'master' into siv-mode siv-mode
Niels Möller [Thu, 6 Jun 2019 07:25:59 +0000 (09:25 +0200)] 
Merge branch 'master' into siv-mode

The cmac changes on master breaks the previous version of the siv
code. Now updated, and improved to use const context arguments for the
_message functions.

6 years agoFix doc of cmac context structs.
Niels Möller [Thu, 6 Jun 2019 06:41:32 +0000 (08:41 +0200)] 
Fix doc of cmac context structs.

6 years agoFurther separation of CMAC per-message state from subkeys. cmac-layout
Niels Möller [Wed, 5 Jun 2019 20:25:20 +0000 (22:25 +0200)] 
Further separation of CMAC per-message state from subkeys.

6 years agoRevert move of cmac128_ctx index
Niels Möller [Wed, 5 Jun 2019 19:24:31 +0000 (21:24 +0200)] 
Revert move of cmac128_ctx index

6 years agoNew struct cmac128_key.
Niels Möller [Sat, 1 Jun 2019 08:30:29 +0000 (10:30 +0200)] 
New struct cmac128_key.

6 years agoMention deletion of des-compat.h in NEWS
Niels Möller [Wed, 15 May 2019 09:30:55 +0000 (11:30 +0200)] 
Mention deletion of des-compat.h in NEWS

6 years agoNew SIV key size constants. Use in tests.
Niels Möller [Wed, 15 May 2019 08:24:48 +0000 (10:24 +0200)] 
New SIV key size constants. Use in tests.

6 years agoRequire non-empty nonce for SIV mode.
Niels Möller [Wed, 15 May 2019 08:11:22 +0000 (10:11 +0200)] 
Require non-empty nonce for SIV mode.

6 years agoDelete old libdes/openssl compatibility interface. delete-des-compat
Niels Möller [Sun, 12 May 2019 09:03:42 +0000 (11:03 +0200)] 
Delete old libdes/openssl compatibility interface.

6 years agoNEWS update for Nettle-3.5.
Niels Möller [Sat, 11 May 2019 19:29:52 +0000 (21:29 +0200)] 
NEWS update for Nettle-3.5.

6 years agoSIV-CMAC mode, based on patch by Nikos Mavrogiannopoulos
Niels Möller [Mon, 6 May 2019 17:36:33 +0000 (19:36 +0200)] 
SIV-CMAC mode, based on patch by Nikos Mavrogiannopoulos

This AEAD algorithm provides a way to make nonce-reuse a not critical
issue. That is particular useful to stateless servers that cannot
ensure that the nonce will not repeat. This cipher is used by
draft-ietf-ntp-using-nts-for-ntp-17.

6 years agoNew header file cmac-internal.h
Niels Möller [Wed, 1 May 2019 12:24:35 +0000 (14:24 +0200)] 
New header file cmac-internal.h

Move and rename block_mulx --> _cmac128_block_mulx.

6 years agoChangeLog entry for EPILOGUE fix.
Niels Möller [Sat, 27 Apr 2019 07:37:17 +0000 (09:37 +0200)] 
ChangeLog entry for EPILOGUE fix.

6 years agoAdd missing EPILOGUEs in assembly files
Simo Sorce [Sat, 27 Apr 2019 07:05:08 +0000 (09:05 +0200)] 
Add missing EPILOGUEs in assembly files

6 years agotools/nettle-pbkdf2.c: Check strdup return value.
Niels Möller [Sun, 14 Apr 2019 06:35:47 +0000 (08:35 +0200)] 
tools/nettle-pbkdf2.c: Check strdup return value.

6 years agoRedefine struct aes_ctx as a union of key-size specific contexts. aes-struct-layout
Niels Möller [Fri, 29 Mar 2019 06:32:42 +0000 (07:32 +0100)] 
Redefine struct aes_ctx as a union of key-size specific contexts.

6 years agoRearrange cmac's block_mulx, make it closer to xts_shift.
Niels Möller [Wed, 27 Mar 2019 05:30:58 +0000 (06:30 +0100)] 
Rearrange cmac's block_mulx, make it closer to xts_shift.

* xts.c (xts_shift): Arrange with a single write to u64[1].
* cmac.c (block_mulx): Rewrite to work in the same way as
xts_shift, with 64-bit operations. XTS and CMAC use opposite
endianness, but otherwise, these two functions are identical.

6 years agoUpdate docs for xts-aes
Niels Möller [Sun, 24 Mar 2019 12:34:08 +0000 (13:34 +0100)] 
Update docs for xts-aes

The structs are named xts_aes*_key, not xts_aes*_ctx.

6 years agoChangeLog entries for XTS support.
Niels Möller [Sun, 24 Mar 2019 12:31:37 +0000 (13:31 +0100)] 
ChangeLog entries for XTS support.

6 years agoRecode xts_shift based on endianess
Simo Sorce [Wed, 20 Mar 2019 15:46:22 +0000 (11:46 -0400)] 
Recode xts_shift based on endianess

This creates two implementations of xts_shift, one for little endian and
one for big endian. This way we avoid copies to additional variables and
inefficient byteswapping on platforms that do not have dedicated
instructions.

Signed-off-by: Simo Sorce <simo@redhat.com>
6 years agoInline ciphertext stealing
Simo Sorce [Tue, 19 Mar 2019 20:30:53 +0000 (16:30 -0400)] 
Inline ciphertext stealing

This avoids copying and may be somewhat more readable without the need
for so much explanation.

Signed-off-by: Simo Sorce <simo@redhat.com>