]> git.ipfire.org Git - thirdparty/nettle.git/log
thirdparty/nettle.git
5 years agoUpdate mini-gmp to latest version
Niels Möller [Mon, 27 Apr 2020 17:34:54 +0000 (19:34 +0200)] 
Update mini-gmp to latest version

5 years agoMention GMP-6.1.0 in NEWS.
Niels Möller [Sun, 26 Apr 2020 11:53:35 +0000 (13:53 +0200)] 
Mention GMP-6.1.0 in NEWS.

5 years agoDelete compatibility definitions of mpz_limbs_read and friends.
Niels Möller [Sat, 25 Apr 2020 18:27:57 +0000 (20:27 +0200)] 
Delete compatibility definitions of mpz_limbs_read and friends.

5 years agoRequire gmp-6.1.0 or later, for mpn_zero_p.
Niels Möller [Sat, 25 Apr 2020 18:01:00 +0000 (20:01 +0200)] 
Require gmp-6.1.0 or later, for mpn_zero_p.

5 years agoDISTFILES fixes. nettle_3.6rc2
Niels Möller [Sat, 25 Apr 2020 08:13:18 +0000 (10:13 +0200)] 
DISTFILES fixes.

5 years agoSet WINEPATH for tests, and remove symlink workaround.
Niels Möller [Thu, 23 Apr 2020 17:25:08 +0000 (19:25 +0200)] 
Set WINEPATH for tests, and remove symlink workaround.

5 years agoIn tests, delete ASSERTs with functions pointer comparisons.
Niels Möller [Thu, 23 Apr 2020 16:19:09 +0000 (18:19 +0200)] 
In tests, delete ASSERTs with functions pointer comparisons.

5 years agoDelete .test-rules.make, replaced by GNU make pattern rules.
Niels Möller [Wed, 22 Apr 2020 18:31:07 +0000 (20:31 +0200)] 
Delete .test-rules.make, replaced by GNU make pattern rules.

5 years agoChangeLog entry for gost_vko.
Niels Möller [Tue, 21 Apr 2020 16:40:12 +0000 (18:40 +0200)] 
ChangeLog entry for gost_vko.

5 years agoImplement GOST VKO key derivation algorithm
Dmitry Eremin-Solenikov [Tue, 21 Apr 2020 11:50:48 +0000 (14:50 +0300)] 
Implement GOST VKO key derivation algorithm

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoChangeLog for previous gosthash changes.
Niels Möller [Sun, 19 Apr 2020 15:02:40 +0000 (17:02 +0200)] 
ChangeLog for previous gosthash changes.

5 years agoDelete obsolete FIXME comment.
Niels Möller [Sun, 19 Apr 2020 14:25:37 +0000 (16:25 +0200)] 
Delete obsolete FIXME comment.

5 years agogosthash94: switch to using MD_UPDATE() macro
Dmitry Baryshkov [Sun, 19 Apr 2020 14:24:13 +0000 (16:24 +0200)] 
gosthash94: switch to using MD_UPDATE() macro

5 years agoNEWS file update for soname changes.
Niels Möller [Fri, 17 Apr 2020 06:06:28 +0000 (08:06 +0200)] 
NEWS file update for soname changes.

5 years agoBump libnettle soname, libnettle version is now 8.0.
Niels Möller [Fri, 17 Apr 2020 05:28:52 +0000 (07:28 +0200)] 
Bump libnettle soname, libnettle version is now 8.0.

5 years agoFix file header.
Niels Möller [Wed, 15 Apr 2020 18:08:00 +0000 (20:08 +0200)] 
Fix file header.

5 years agoMake poly1305-internal.h include poly1305.h, not aes.h.
Niels Möller [Wed, 15 Apr 2020 18:04:36 +0000 (20:04 +0200)] 
Make poly1305-internal.h include poly1305.h, not aes.h.

5 years agoChangeLog for poly1305-internal.h.
Niels Möller [Wed, 15 Apr 2020 18:03:23 +0000 (20:03 +0200)] 
ChangeLog for poly1305-internal.h.

5 years agopoly1305: make internal symbols internal
Dmitry Baryshkov [Tue, 14 Apr 2020 10:53:10 +0000 (13:53 +0300)] 
poly1305: make internal symbols internal

Make low-level poly1305 functions that were marked as "internal" in
public header file really internal. Change their prefix from nettle to
_nettle.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoReorder DISTFILES to avoid wrong timestamp order in tar file.
Niels Möller [Wed, 15 Apr 2020 17:47:27 +0000 (19:47 +0200)] 
Reorder DISTFILES to avoid wrong timestamp order in tar file.

5 years agoNEWS fixes from Daiki Ueno.
Niels Möller [Sun, 12 Apr 2020 07:53:08 +0000 (09:53 +0200)] 
NEWS fixes from Daiki Ueno.

5 years agoDefine _GNU_SOURCE in ed448-test.c.
Niels Möller [Sun, 12 Apr 2020 07:51:33 +0000 (09:51 +0200)] 
Define _GNU_SOURCE in ed448-test.c.

5 years agoUpdate info on ABI compatibility in NEWS. nettle_3.6rc1
Niels Möller [Mon, 6 Apr 2020 17:41:35 +0000 (19:41 +0200)] 
Update info on ABI compatibility in NEWS.

5 years agoIncrease hogweed version number to 6.0, at request of Gnutls team.
Niels Möller [Mon, 6 Apr 2020 17:31:25 +0000 (19:31 +0200)] 
Increase hogweed version number to 6.0, at request of Gnutls team.

5 years agoFix gnutls ci job to not replace the system's nettle libraries.
Niels Möller [Thu, 2 Apr 2020 19:42:21 +0000 (21:42 +0200)] 
Fix gnutls ci job to not replace the system's nettle libraries.

5 years agoUpdate config.guess and config.sub.
Niels Möller [Wed, 1 Apr 2020 17:45:38 +0000 (19:45 +0200)] 
Update config.guess and config.sub.

5 years agoDelete some unused autoconf macros.
Niels Möller [Wed, 1 Apr 2020 17:39:31 +0000 (19:39 +0200)] 
Delete some unused autoconf macros.

5 years agoDelete extra quotes from TEST_SHLIB_DIR. Add comment.
Niels Möller [Wed, 1 Apr 2020 16:37:54 +0000 (18:37 +0200)] 
Delete extra quotes from TEST_SHLIB_DIR. Add comment.

5 years agoRework setting of LD_LIBRARY_PATH for tests. test-shlib-dir
Niels Möller [Tue, 31 Mar 2020 17:52:15 +0000 (19:52 +0200)] 
Rework setting of LD_LIBRARY_PATH for tests.

* testsuite/Makefile.in (check): Pass only TEST_SHLIB_DIR
to the run-tests script, and leave setting of LD_LIBRARY_PATH and
related variables to that script.
* examples/Makefile.in (check): Likewise.

* run-tests: Check TEST_SHLIB_DIR, and set up LD_LIBRARY_PATH and
related member variables.

* config.make.in (abs_top_builddir, TEST_SHLIB_DIR): New variables.

5 years agoVersion number update for Nettle-3.6
Niels Möller [Thu, 26 Mar 2020 18:51:37 +0000 (19:51 +0100)] 
Version number update for Nettle-3.6

* configure.ac: Bump package version to 3.6.
(LIBNETTLE_MINOR): Bump minor number, now 7.1.
(LIBHOGWEED_MINOR): Bump minor numbers, now 5.1

5 years agoMore NEWS entries for Nettle-3.6.
Niels Möller [Sun, 22 Mar 2020 18:47:55 +0000 (19:47 +0100)] 
More NEWS entries for Nettle-3.6.

5 years agox86: Add x86-ibt-test.c
H.J. Lu [Mon, 16 Mar 2020 12:17:34 +0000 (05:17 -0700)] 
x86: Add x86-ibt-test.c

On Linux/x86, when CET is enabled, all indirect branch targets must
start with ENDBR instruction.  Add x86-ibt-test.c to verify that missing
ENDBR instruction at indirect branch target will trigger SIGSEGV on CET
platforms.

5 years agoChangeLog entry for x86_64 CET fixes.
Niels Möller [Sat, 14 Mar 2020 18:45:41 +0000 (19:45 +0100)] 
ChangeLog entry for x86_64 CET fixes.

5 years agox86: Add ASM_X86_ENDBR and x86 CET marker to config.m4.in
H.J. Lu [Fri, 28 Feb 2020 17:52:08 +0000 (09:52 -0800)] 
x86: Add ASM_X86_ENDBR and x86 CET marker to config.m4.in

Intel Control-flow Enforcement Technology (CET):

https://software.intel.com/en-us/articles/intel-sdm

contains shadow stack (SHSTK) and indirect branch tracking (IBT).  When
CET is enabled, ELF object files must be marked with .note.gnu.property
section.  Also when IBT is enabled, all indirect branch targets must
start with ENDBR instruction.

This patch adds ASM_X86_ENDBR and the x86 CET marker to config.m4.in when
CET is enabled.  It updates PROLOGUE with ASM_X86_ENDBR.

Tested on CET machine with i686 and x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 years agoarm: Fix memxor for non-armv6+ big-endian systems
Michael Weiser [Thu, 5 Mar 2020 19:13:07 +0000 (20:13 +0100)] 
arm: Fix memxor for non-armv6+ big-endian systems

ARM assembly adjustments for big-endian systems contained armv6+-only
instructions (rev) in generic arm memxor code. Replace those with an
actual conversion of the leftover byte store routines for big-endian
systems. This also provides a slight optimisation by removing the
additional instruction as well as increased symmetry between little- and
big-endian implementations.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
5 years agoMinor fixes for chacha comments and docs.
Niels Möller [Mon, 9 Mar 2020 21:15:21 +0000 (22:15 +0100)] 
Minor fixes for chacha comments and docs.

5 years agoChangeLog for previous change.
Niels Möller [Mon, 9 Mar 2020 21:14:34 +0000 (22:14 +0100)] 
ChangeLog for previous change.

5 years agodoc: match ChaCha-Poly1305 documentation to the implementation
Daiki Ueno [Mon, 9 Mar 2020 12:01:19 +0000 (13:01 +0100)] 
doc: match ChaCha-Poly1305 documentation to the implementation

While the documentation said the nonce size is 8 octets, the
implementation actually assumed 12 octets following RFC 7539.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
5 years agochacha: add variant that treats counter value as 32-bit
Daiki Ueno [Mon, 9 Mar 2020 12:01:18 +0000 (13:01 +0100)] 
chacha: add variant that treats counter value as 32-bit

The ChaCha-Poly1305 implementation previously used the chacha_crypt
function that assumes the block counter is 64-bit long, while RFC 8439
defines that the counter is 32-bit long.  Although this should be fine
as long as up to 256 gigabytes of data is encrypted with the same key,
it would be nice to use a separate functions (chacha_set_counter32 and
chacha_crypt32) that assume the counter is 32-bit long.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
5 years agochacha: add function to set initial block counter
Daiki Ueno [Mon, 9 Mar 2020 12:01:17 +0000 (13:01 +0100)] 
chacha: add function to set initial block counter

The ChaCha20 based header protection algorithm in QUIC requires a way
to set the initial value of counter:
https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-chacha20-based-header-prote

This will add a new function chacha_set_counter, which takes an
8-octet initial value of the block counter.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
5 years agoChangeLog for previous change.
Niels Möller [Sun, 8 Mar 2020 19:16:12 +0000 (20:16 +0100)] 
ChangeLog for previous change.

5 years agocmac-des3: add meta declaration to Nettle library
Dmitry Baryshkov [Sun, 9 Feb 2020 17:13:04 +0000 (20:13 +0300)] 
cmac-des3: add meta declaration to Nettle library

Move cmac-des3 meta information from testsuite/cmac-test.c to main
Nettle library.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoChangeLog for previous change.
Niels Möller [Sat, 15 Feb 2020 18:57:36 +0000 (19:57 +0100)] 
ChangeLog for previous change.

5 years agoecc: remove ecc_modp_foo/ecc_modq_foo macros
Dmitry Baryshkov [Mon, 10 Feb 2020 15:09:33 +0000 (18:09 +0300)] 
ecc: remove ecc_modp_foo/ecc_modq_foo macros

To make ecc functions usage more obvious remove ecc_modp_foo() and
ecc_modq_foo() wrapper macros.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agonettle-meta: Expose defined MACs through nettle_macs move-nettle_mac
Niels Möller [Sun, 9 Feb 2020 13:13:22 +0000 (14:13 +0100)] 
nettle-meta: Expose defined MACs through nettle_macs

Based on patches by Daiki Ueno.

5 years agoFix dash vs underscore in nettle_cmac_aes256 name.
Niels Möller [Sun, 9 Feb 2020 09:46:59 +0000 (10:46 +0100)] 
Fix dash vs underscore in nettle_cmac_aes256 name.

5 years agoAdd meta interface for HMAC functions.
Niels Möller [Sun, 9 Feb 2020 08:57:34 +0000 (09:57 +0100)] 
Add meta interface for HMAC functions.

Based on patches by Daiki Ueno.

5 years agoAdd meta interface for CMAC functions.
Niels Möller [Sun, 9 Feb 2020 07:48:27 +0000 (08:48 +0100)] 
Add meta interface for CMAC functions.

Based on patches by Daiki Ueno.
* testsuite/cmac-test.c (nettle_cmac_aes128, nettle_cmac_aes256):
Moved to...
* cmac-aes128-meta.c: New file.
* cmac-aes256-meta.c: New file.

5 years agoMove struct nettle_mac to nettle-meta.h.
Niels Möller [Wed, 25 Dec 2019 11:34:29 +0000 (12:34 +0100)] 
Move struct nettle_mac to nettle-meta.h.

5 years agoChangeLog for previous change.
Niels Möller [Thu, 6 Feb 2020 06:36:28 +0000 (07:36 +0100)] 
ChangeLog for previous change.

5 years agogost28147: move gost params to internal interface
Dmitry Baryshkov [Tue, 4 Feb 2020 13:29:26 +0000 (16:29 +0300)] 
gost28147: move gost params to internal interface

gost28147_param instances were never a part of stable release, so move
them to internal header.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoOn Solaris, link shared libraries with --shared rather than -G.
Niels Möller [Wed, 5 Feb 2020 05:25:08 +0000 (06:25 +0100)] 
On Solaris, link shared libraries with --shared rather than -G.

5 years agoFix comment typo
Niels Möller [Wed, 29 Jan 2020 14:20:28 +0000 (15:20 +0100)] 
Fix comment typo

5 years agoMerge branch 'delete-ecc-g'
Niels Möller [Tue, 28 Jan 2020 15:51:29 +0000 (16:51 +0100)] 
Merge branch 'delete-ecc-g'

5 years agoMerge branch 'ecc-gost'
Niels Möller [Tue, 28 Jan 2020 15:26:06 +0000 (16:26 +0100)] 
Merge branch 'ecc-gost'

5 years agoAdd index entries for GOST hash and GOST DSA. ecc-gost
Niels Möller [Mon, 27 Jan 2020 14:25:05 +0000 (15:25 +0100)] 
Add index entries for GOST hash and GOST DSA.

5 years agoAdd documentation for GOSTDSA and GOST curves.
Dmitry Baryshkov [Thu, 16 Jan 2020 21:52:36 +0000 (00:52 +0300)] 
Add documentation for GOSTDSA and GOST curves.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoChangeLog entries
Niels Möller [Sun, 26 Jan 2020 17:37:54 +0000 (18:37 +0100)] 
ChangeLog entries

5 years agoMerge commit '33d047b2fdf56207fa26a41c531eb7b3192ced53' into ecc-gost
Niels Möller [Sun, 26 Jan 2020 15:42:57 +0000 (16:42 +0100)] 
Merge commit '33d047b2fdf56207fa26a41c531eb7b3192ced53' into ecc-gost

For gitlab CI fix.

5 years agoChangeLog entries delete-ecc-g
Niels Möller [Sun, 26 Jan 2020 15:41:24 +0000 (16:41 +0100)] 
ChangeLog entries

5 years agoFix memory leak in ecc-mul-a-test
Niels Möller [Sun, 26 Jan 2020 15:20:32 +0000 (16:20 +0100)] 
Fix memory leak in ecc-mul-a-test

5 years agoStarted on NEWS entries for Nettle-3.6.
Niels Möller [Sun, 26 Jan 2020 15:13:12 +0000 (16:13 +0100)] 
Started on NEWS entries for Nettle-3.6.

5 years agoFix ChangeLog typo.
Niels Möller [Sun, 26 Jan 2020 15:10:44 +0000 (16:10 +0100)] 
Fix ChangeLog typo.

5 years agoMerge branch 'master' into delete-ecc-g
Niels Möller [Sun, 26 Jan 2020 13:37:45 +0000 (14:37 +0100)] 
Merge branch 'master' into delete-ecc-g

For gitlab CI fix.

5 years ago.gitlab-ci.yml: require linux systems for running CI
Nikos Mavrogiannopoulos [Sat, 25 Jan 2020 19:56:40 +0000 (20:56 +0100)] 
.gitlab-ci.yml: require linux systems for running CI

Gitlab added windows shared runners and we should avoid
running CI in this environment as it will immediatelly
fail.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
5 years agoDelete definition of ecc->g
Niels Möller [Sat, 25 Jan 2020 19:04:33 +0000 (20:04 +0100)] 
Delete definition of ecc->g

5 years agoDelete all usage of ecc->g
Niels Möller [Sat, 25 Jan 2020 18:55:08 +0000 (19:55 +0100)] 
Delete all usage of ecc->g

5 years agohogweed-benchmark: Pass correct sizes to knuth_lfib_random.
Niels Möller [Sat, 25 Jan 2020 15:31:44 +0000 (16:31 +0100)] 
hogweed-benchmark: Pass correct sizes to knuth_lfib_random.

5 years agohogweed-benchmark: enable testing of GOST DSA
Dmitry Baryshkov [Thu, 16 Jan 2020 21:52:37 +0000 (00:52 +0300)] 
hogweed-benchmark: enable testing of GOST DSA

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoAdd GOST DSA according to GOST R 34.10-2001/-2012
Dmitry Baryshkov [Thu, 16 Jan 2020 21:52:35 +0000 (00:52 +0300)] 
Add GOST DSA according to GOST R 34.10-2001/-2012

Add GOST Digital Signature Algorithms support according to GOST R
34.10-2001/-2012. English translations of these standards are provided
as RFC 5832 and RFC 7091.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years ago.gitignore: correct generated header names
Dmitry Baryshkov [Sat, 18 Jan 2020 13:01:45 +0000 (16:01 +0300)] 
.gitignore: correct generated header names

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agogost gc512a: rename functions to follow usual pattern
Dmitry Baryshkov [Sat, 18 Jan 2020 13:01:44 +0000 (16:01 +0300)] 
gost gc512a: rename functions to follow usual pattern

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoAdd support for GOST GC512A curve
Dmitry Eremin-Solenikov [Wed, 15 Jan 2020 22:36:09 +0000 (01:36 +0300)] 
Add support for GOST GC512A curve

Add support for GC512A curve ("TLS Supported Groups" registry,
draft-smyshlyaev-tls12-gost-suites) also known as
tc26-gost-3410-12-512-paramSetA (RFC 7836).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoAdd support for GOST GC256B curve
Dmitry Eremin-Solenikov [Wed, 15 Jan 2020 22:36:08 +0000 (01:36 +0300)] 
Add support for GOST GC256B curve

Add support for GC256B curve ("TLS Supported Groups" registry,
draft-smyshlyaev-tls12-gost-suites) also known as
GostR3410-2001-CryptoPro-A and GostR3410-2001-CryptoPro-XchA (RFC 4357).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
5 years agoUse %-pattern rules instad of suffix rules. require-gnu-make
Niels Möller [Wed, 15 Jan 2020 20:38:45 +0000 (21:38 +0100)] 
Use %-pattern rules instad of suffix rules.

5 years agoSimplify dependency rules using GNU make -include.
Niels Möller [Wed, 15 Jan 2020 19:16:48 +0000 (20:16 +0100)] 
Simplify dependency rules using GNU make -include.

* aclocal.m4 (DEP_INCLUDE): Delete substituted variable.

* Makefile.in: Use the GNU make directive -include to include
dependency .d files. Delete dependency files on make clean.
* examples/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise. Also use $(OBJEXT) properly.
* tools/Makefile.in: Likewise.

* configure.ac (dummy-dep-files): Delete these config commands.

5 years agoChangeLog entry for ecc renaming.
Niels Möller [Fri, 10 Jan 2020 19:59:40 +0000 (20:59 +0100)] 
ChangeLog entry for ecc renaming.

5 years agoecc: rename functions to contain curve names instead of bits
Dmitry Eremin-Solenikov [Mon, 6 Jan 2020 22:16:45 +0000 (01:16 +0300)] 
ecc: rename functions to contain curve names instead of bits

Rename curve functions to use curve names instead of just bits.
Otherwise function names can easily become confusing after adding other
curves.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoecc: prefix optimized ECC function names with underscore
Dmitry Eremin-Solenikov [Mon, 6 Jan 2020 22:16:44 +0000 (01:16 +0300)] 
ecc: prefix optimized ECC function names with underscore

There is no need to keep optimized ECC functions in public namespace
(nettle_*), move them to internal namespace (_nettle_*).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoecc: rename source files with curves data
Dmitry Eremin-Solenikov [Mon, 6 Jan 2020 22:16:43 +0000 (01:16 +0300)] 
ecc: rename source files with curves data

In preparation to adding GOST curves support, rename source files and
use curve name as eccdata parameter.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years ago.gitlab-ci.yml: use fedora31 image
Nikos Mavrogiannopoulos [Fri, 3 Jan 2020 08:48:59 +0000 (09:48 +0100)] 
.gitlab-ci.yml: use fedora31 image

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
5 years agosexp-conv: ensure non-null input to strcmp() and strtol()
Nikos Mavrogiannopoulos [Fri, 3 Jan 2020 08:57:38 +0000 (09:57 +0100)] 
sexp-conv: ensure non-null input to strcmp() and strtol()

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
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.