Two MRs on git.lysator.liu.se

2020-02-10 Thread Dmitry Eremin-Solenikov
Hello, I've opened two merge requests on git.lysator.liu.se: one for new hash function support (https://git.lysator.liu.se/nettle/nettle/merge_requests/6) and another one for GOST 28147 cipher/MAC support (https://git.lysator.liu.se/nettle/nettle/merge_requests/7). Code has been tested for quite

Re: [PATCH 0/2] two small fixes for ecc-gost branch

2020-01-29 Thread Dmitry Eremin-Solenikov
Hello, ср, 29 янв. 2020 г. в 07:14, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > I've sent two patches for next curve (the 256-bit 8.0c99 one) > > for review. > > > > I still hope to get most curves into next release. I'm perfectly fine

Re: [PATCH 0/2] two small fixes for ecc-gost branch

2020-01-27 Thread Dmitry Eremin-Solenikov
пн, 27 янв. 2020 г. в 17:26, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > This is strange. I have checked the e-mail from my 'sent' mailbox, it > > applies cleanly. Anyway, I have uploaded the diff to paste server. You > > can download and apply it: &

Re: [PATCH 0/2] two small fixes for ecc-gost branch

2020-01-27 Thread Dmitry Eremin-Solenikov
Hello, сб, 25 янв. 2020 г. в 18:23, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Thank you! What about GOST DSA v5 patches? > > Look good, I'm trying them out right now, before leaving for the next > airport. Running the benchmark, signing looks a bit faster t

Re: [PATCH 0/2] two small fixes for ecc-gost branch

2020-01-24 Thread Dmitry Eremin-Solenikov
чт, 23 янв. 2020 г. в 17:06, Niels Möller : > > dbarysh...@gmail.com writes: > > > Two small fixes to go on top of ecc-gost branch. These two patches can > > be squashed into respective patches or just live as separate instances, > > whatever you would prefer. > > Pushed to that branch now. Thank

Re: [PATCH v4 3/4] Add GOST DSA according to GOST R 34.10-2001/-2012

2020-01-16 Thread Dmitry Eremin-Solenikov
Hello, чт, 16 янв. 2020 г. в 21:36, Niels Möller : > > From: Dmitry Eremin-Solenikov > > > > 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.

Re: Gitlab merge requests

2020-01-15 Thread Dmitry Eremin-Solenikov
ср, 15 янв. 2020 г., 12:03 Tim Rühsen : > On 1/15/20 9:24 AM, Nikos Mavrogiannopoulos wrote: > > On Wed, Jan 15, 2020 at 7:18 AM Niels Möller > wrote: > > > >>> If they are you should be able to see them in Settings -> CI/CD -> > Runners. > >> > >> I've now had a look. There's a section for

Re: [PATCH v2 1/3] Add support for GOST GC256B curve

2020-01-15 Thread Dmitry Eremin-Solenikov
Please excuse me for top-posting. I'll change the names t follow gost_gc256b pattern, add documentation and submit v4. -- With best wishes Dmitry ср, 15 янв. 2020 г., 19:17 Niels Möller : > Dmitry Eremin-Solenikov writes: > > >> > +const struct ecc_curve *nett

Re: [PATCH v2 1/3] Add support for GOST GC256B curve

2020-01-12 Thread Dmitry Eremin-Solenikov
вс, 12 янв. 2020 г. в 23:45, Niels Möller : > > dbarysh...@gmail.com writes: > > > From: Dmitry Eremin-Solenikov > > > > Add support for GC256B curve ("TLS Supported Groups" registry, > > draft-smyshlyaev-tls12-gost-suites) also known as > > GostR3

Re: Gitlab merge requests

2020-01-12 Thread Dmitry Eremin-Solenikov
Hello, сб, 11 янв. 2020 г. в 12:20, Niels Möller : > > Hi, > > After some off-list discussions and encouragement, I've reenabled the > "merge request" feature on git.lysator.liu.se/nettle. Great! > I don't know yet precisely how I will want to use it, but feel free to > create merge requests if

Re: [PATCH v3 2/3] ecc: prefix optimized ECC function names with underscore

2020-01-10 Thread Dmitry Eremin-Solenikov
пт, 10 янв. 2020 г. в 23:01, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > So did I at the time of writing a patch, finding no actual users of > > these functions. I think it is fine to drop them without bumping > > soname. > > It seems none disagrees

Re: [PATCH v3 2/3] ecc: prefix optimized ECC function names with underscore

2020-01-09 Thread Dmitry Eremin-Solenikov
Hello, вт, 7 янв. 2020 г. в 23:20, Niels Möller : > > dbarysh...@gmail.com writes: > > From: Dmitry Eremin-Solenikov > > > > There is no need to keep optimized ECC functions in public namespace > > (nettle_*), move them to internal namespace (_nettle_*). >

Re: [PATCH v2 3/6] nettle-meta: Add meta interface for HMAC functions

2019-12-25 Thread Dmitry Eremin-Solenikov
Hello, ср, 25 дек. 2019 г. в 14:31, Niels Möller : > > Daiki Ueno writes: > > > +static void > > +hmac_md5_set_key_wrapper (void *ctx, const uint8_t *key) > > +{ > > + hmac_md5_set_key (ctx, MD5_BLOCK_SIZE, key); > > +} > > [...] > > > +extern const struct nettle_mac nettle_hmac_md5; > >

Re: Current ECC work

2019-12-25 Thread Dmitry Eremin-Solenikov
ср, 25 дек. 2019 г. в 14:01, Niels Möller : > > I've now merged Daiki's implementation of curve448, and I've done some > followup cleanups: Moving and renaming edwards/twisted edwards > functions, and using a shared ecc_mul_m function for both curve25519_mul > and curve448_mul. Great, thank you!

Re: [PATCH] ecc: rename source files with curves data

2019-12-05 Thread Dmitry Eremin-Solenikov
Hello, чт, 5 дек. 2019 г. в 18:45, Dmitry Eremin-Solenikov : > > Any feedback on this change? > > I'm going to send patches adding 3 256-bit curves and 2 512-bit curves > with another 256-bit and 512-bit curves waiting some restructuring of > the code. > It would be too e

Re: [PATCH] ecc: rename source files with curves data

2019-12-05 Thread Dmitry Eremin-Solenikov
Any feedback on this change? I'm going to send patches adding 3 256-bit curves and 2 512-bit curves with another 256-bit and 512-bit curves waiting some restructuring of the code. It would be too easy to mix curves w/o this patch. вс, 24 нояб. 2019 г. в 17:22, : > > From: Dmitry Eremin-Sol

Re: [RFC] ecc: switch away from affine points representation

2019-12-04 Thread Dmitry Eremin-Solenikov
Hello, чт, 5 дек. 2019 г., 8:15 Niels Möller : > Dmitry Eremin-Solenikov writes: > > > Well, I've had two particular GOST curves in mind. They are defined in > > Weierstrass form, but have birationally equal Edwards curves that can > > be used for point addition. >

Re: [RFC] ecc: switch away from affine points representation

2019-12-04 Thread Dmitry Eremin-Solenikov
Hello, чт, 5 дек. 2019 г. в 00:18, Niels Möller : > > dbarysh...@gmail.com writes: > > > From: Dmitry Eremin-Solenikov > > > > Use jacobian/harmonized representation in ecc_point structure. > > Can you explain what benefit you see from this? Well, I've had t

Re: ECC code rework

2019-11-24 Thread Dmitry Eremin-Solenikov
Hello, вс, 24 нояб. 2019 г. в 11:45, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > GOST curves support in GnuTLS depends on exact Nettle ABI. I'd propose > > to add --disable-gost to Nettle's GnuTLS execution for now, till ECC > > ABI gets stable again. &g

Re: ECC code rework

2019-11-22 Thread Dmitry Eremin-Solenikov
пт, 22 нояб. 2019 г., 18:16 Niels Möller : > Dmitry Eremin-Solenikov writes: > > > Basically I have two strange curves which are defined in Weierstrass > > form, but have equivalent Untwisted Edwards form. I planned to make > > ecc_point_set/get convert between x,y

Re: ECC code rework

2019-11-22 Thread Dmitry Eremin-Solenikov
чт, 21 нояб. 2019 г. в 22:22, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > During this rework I thought about switching ecc_point from bearing > > just x and y coordinates to have per-curve defined coordinates (like > > projectile or inverted). > >

Re: ECC code rework

2019-11-22 Thread Dmitry Eremin-Solenikov
Hello, пт, 22 нояб. 2019 г. в 09:28, Niels Möller : > > ni...@lysator.liu.se (Niels Möller) writes: > > > The gnutls tests failed, see > > https://gitlab.com/gnutls/nettle/-/jobs/357863630. > > These are the failing gnutls tests: > > FAIL: chainverify > FAIL: key-import-export > FAIL:

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-11-15 Thread Dmitry Eremin-Solenikov
Hello, ср, 18 сент. 2019 г. в 08:38, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > >> 2. What should be the behavior for usage like > >> > >>->set_key > >>->set_nonce > >>->update > >>->digest &

ECC code rework

2019-11-01 Thread Dmitry Eremin-Solenikov
Hello colleagues, I have been working on support for two particularly strange GOST curves, which are defined in Weierstrass form, but there exists a birationally equivalent Untwisted Edwards form (so all sign/verify calculations should be done in Edwards form). Major issues came from the fact

Re: Nettle ECC code question

2019-10-31 Thread Dmitry Eremin-Solenikov
Hello, чт, 31 окт. 2019 г. в 17:55, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > After ecc_modp_mul() call value of `t` should be already lower than > > `ecc->p.m`. So subtract will always return a carry. > > No, the reduction after mul and sqr doe

Re: Nettle ECC code question

2019-10-31 Thread Dmitry Eremin-Solenikov
чт, 31 окт. 2019 г. в 17:00, Simo Sorce : > > On Thu, 2019-10-31 at 15:07 +0300, Dmitry Eremin-Solenikov wrote: > > Hello, > > > > I've noticed the following typical code sequence: > > > > ecc_modp_mul(ecc, t, x, y); > > cy = mpn_sub_n(dest, t, ecc->p.m

Nettle ECC code question

2019-10-31 Thread Dmitry Eremin-Solenikov
Hello, I've noticed the following typical code sequence: ecc_modp_mul(ecc, t, x, y); cy = mpn_sub_n(dest, t, ecc->p.m, ecc->p.size); cnd_copy(cy, dest, t, ecc->p.size); What is the benefit of this piece of code over the following one? ecc_modp_mul(ecc, t, x, y); memcpy(dest, t, ecc->p.size *

Re: [PATCH 1/2] Implement GOST R 34.11-2012 (Streebog) hash function

2019-10-23 Thread Dmitry Eremin-Solenikov
ср, 2 окт. 2019 г. в 15:14, : > > From: Dmitry Eremin-Solenikov > > Signed-off-by: Dmitry Eremin-Solenikov Any feedback on these patches? (And on gost28147?) -- With best wishes Dmitry ___ nettle-bugs mailing list nettle-bugs@lists.ly

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-09-16 Thread Dmitry Eremin-Solenikov
вс, 15 сент. 2019 г. в 10:28, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > There will be a nonce for GMAC. > > Ok. If we keep set_nonce, we have to clarify what it means. There are a > couple of cases, where the first two are relatively easy. > > nonc

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-09-15 Thread Dmitry Eremin-Solenikov
вс, 15 сент. 2019 г. в 11:40, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > I can live with the patch in question being left out for now. We can > > merge it later. > > Merged to master now. Thank you! > One more question: The gost28147.h header, do you

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-09-14 Thread Dmitry Eremin-Solenikov
сб, 14 сент. 2019 г. в 13:33, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Any feedback on v2 of patchset? > > Looks good, merged onto a branch godthash94cp. Not sure what to do about > the MD_UPDATE cleanup, though, maybe we need to revert that one out to >

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-09-14 Thread Dmitry Eremin-Solenikov
сб, 14 сент. 2019 г. в 13:47, Niels Möller : > > Daiki Ueno writes: > > > From: Daiki Ueno > > > > The changes from the previous series are: > > - remove the global hmac_*_set_key_expanded functions > > - leave out set_nonce member if the operation is not supported > > > > For the latter, I was

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-09-14 Thread Dmitry Eremin-Solenikov
сб, 14 сент. 2019 г. в 13:33, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Any feedback on v2 of patchset? > > Looks good, merged onto a branch godthash94cp. Not sure what to do about > the MD_UPDATE cleanup, though, maybe we need to revert that one out to >

Re: [PATCH v2 3/4] gcm: move block shifting function to block-internal.h

2019-09-04 Thread Dmitry Eremin-Solenikov
ср, 4 сент. 2019 г. в 23:25, Niels Möller : > > dbarysh...@gmail.com writes: > > > From: Dmitry Eremin-Solenikov > > > > Move GCM's block shift function to block-internal.h. This concludes > > moving of all Galois mul-by-2 to single header. > > I've merged

Re: [PATCH 4/5] block modes: move Galois shifts to block-internal.h

2019-09-03 Thread Dmitry Eremin-Solenikov
вт, 3 сент. 2019 г. в 20:26, Niels Möller : > > dbarysh...@gmail.com writes: > > > From: Dmitry Eremin-Solenikov > > > > Move Galois polynomial shifts to block-internal.h, simplifying common > > code. GCM is left unconverted for now, this will be fixed later. >

Re: [PATCH 3/5] block-internal: add block XORing functions

2019-09-03 Thread Dmitry Eremin-Solenikov
Hello, вт, 3 сент. 2019 г. в 20:05, Niels Möller : > > dbarysh...@gmail.com writes: > > > From: Dmitry Eremin-Solenikov > > > > Add common implementations for functions doing XOR over > > nettle_block16/nettle_block8. > > I've merged the first two patches.

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-08-11 Thread Dmitry Eremin-Solenikov
Hello, чт, 11 июл. 2019 г. в 21:43, Dmitry Eremin-Solenikov : > > 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

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-07-22 Thread Dmitry Eremin-Solenikov
пн, 22 июл. 2019 г. в 11:54, Daiki Ueno : > > From: Daiki Ueno > > The changes from the previous series are: > - remove the global hmac_*_set_key_expanded functions > - leave out set_nonce member if the operation is not supported > > For the latter, I was wondering whether it is better to define

Re: [PATCH 0/7] Add meta interface for MAC algorithms

2019-07-20 Thread Dmitry Eremin-Solenikov
Hello, сб, 20 июл. 2019 г. в 12:00, Daiki Ueno : > > Dmitry Eremin-Solenikov writes: > > >> Each meta interface shall provide the following 4 functions: > >> > >> nettle_set_key_func *set_key; > >> nettle_set_key_func *set_

Re: [PATCH 0/7] Add meta interface for MAC algorithms

2019-07-19 Thread Dmitry Eremin-Solenikov
Hello, пт, 19 июл. 2019 г. в 16:38, Daiki Ueno : > > From: Daiki Ueno > > As discussed in: > https://lists.lysator.liu.se/pipermail/nettle-bugs/2019/007662.html > > This moves `struct nettle_mac` to nettle-meta.h and provide the meta > interface for all defined MAC algorithms. Great! > Each

Re: [PATCH 1/7] hmac: Add set_key_expanded function

2019-07-19 Thread Dmitry Eremin-Solenikov
Hello, пт, 19 июл. 2019 г. в 16:38, Daiki Ueno : > > From: Daiki Ueno > > This adds a set_key_expanded to all HMACs, to provide a compatible > signature with nettle_set_key_func. This function is similar to > set_key, but assumes the input is already expanded to the hash block > size. I'd

[PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-07-11 Thread Dmitry Eremin-Solenikov
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

[PATCH v2 3/6] gosthash94: switch to using MD_UPDATE() macro

2019-07-11 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- gosthash94.c | 43 +-- gosthash94.h | 5 +++-- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/gosthash94.c b/gosthash94.c index 954130f741e9..b1ea98736b0d 100644 --- a/gosthash94.c +++ b

[PATCH v2 6/6] Add PBKDF2 support for gosthash94cp

2019-07-11 Thread Dmitry Eremin-Solenikov
using gosthash94cp. Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in | 3 ++- pbkdf2-hmac-gosthash94.c | 53 pbkdf2.h | 7 ++ testsuite/pbkdf2-test.c | 24 ++ 4 files changed, 86 insertions(+), 1

[PATCH v2 5/6] Add HMAC functions for GOSTHASH94 and GOSTHASH94CP

2019-07-11 Thread Dmitry Eremin-Solenikov
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 --- Makefile.in | 5 +-- hmac-gosthash94.c | 79 +++ hmac.h

[PATCH v2 4/6] Add GOST R 34.11-94 to nettle_hashes

2019-07-11 Thread Dmitry Eremin-Solenikov
Add entries for gosthash94 and gosthash94cp in nettle_hashes array. Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta-hashes.c | 2 ++ testsuite/meta-hash-test.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nettle-meta-hashes.c b/nettle-meta-hashes.c index 37552edec5ca

[PATCH v2 2/6] Add support for GOSTHASH94CP: GOST R 34.11-94 hash with CryptoPro S-box

2019-07-11 Thread Dmitry Eremin-Solenikov
34.11-94 hashing using that S-Box. Signed-off-by: Dmitry Eremin-Solenikov --- examples/nettle-benchmark.c | 1 + gost28147.c | 267 gost28147.h | 2 + gosthash94-meta.c | 3 + gosthash94.c| 83

Re: [PATCH] cmac: add 64-bit mode CMAC

2019-07-10 Thread Dmitry Eremin-Solenikov
Hello, чт, 11 июл. 2019 г. в 00:05, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > --- /dev/null > > +++ b/cmac64.c > > @@ -0,0 +1,177 @@ > > +/* > > + AES-CMAC-128 (rfc 4493) / CMAC-64 > > I've now merged this and the cmac_des3 patch

Re: [PATCH 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-07-09 Thread Dmitry Eremin-Solenikov
Hello, вт, 9 июл. 2019 г. в 01:17, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > 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

[PATCH] cmac: add 64-bit mode CMAC

2019-07-09 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in| 2 +- cmac.h | 69 +++ cmac64.c | 177 + nettle-types.h | 6 ++ 4 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 cmac64.c diff

Re: [PATCH] cmac: add 64-bit mode CMAC

2019-07-09 Thread Dmitry Eremin-Solenikov
Hello, вт, 9 июл. 2019 г. в 00:56, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > Patch looks nice, thanks! Is any of the implementation shared with > cmac128? I think it would be nice to move it to a separate source file > cmac64.c. Sharing the cmac.h header file i

Re: [PATCH 2/3] gcm: drop w field from nettle_block16

2019-07-09 Thread Dmitry Eremin-Solenikov
Hello, вт, 9 июл. 2019 г. в 00:44, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > "unsigned long w" comes from the time when Nettle didn't use uint64_t. > > It is unused now and thus can be dropped. > > I've done something very similar on the

Re: [PATCH] nettle-types: drop w field from nettle_block16

2019-07-04 Thread Dmitry Eremin-Solenikov
Hello, чт, 4 июл. 2019 г. в 10:06, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Hmm. This patch has to wait a bit, sent it without actual testing. > > nettle_block16.w is used by eax (easy to copy with) and gcm > > (might need performance checks on 32-bit

[PATCH v2 3/3] nettle-types: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- nettle-types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/nettle-types.h b/nettle-types.h index 5addf3600d69..93a68f3b3

[PATCH v2 0/3] drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
I'm sorry for the noise. This iteration fixes an issue with cross-mips build, noticed with the help of GitLab CI. -- With best wishes Dmitry ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se

[PATCH v2 2/3] gcm: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- gcm.c | 128 +- 1 file changed, 29 insertions(+), 99 deletions(-)

[PATCH v2 1/3] eax: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- eax.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eax.c b/eax.c index 621020def5ce..4b8b51177

[PATCH 2/3] gcm: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- gcm.c | 126 +- 1 file changed, 28 insertions(+), 98 deletions(-)

[PATCH 3/3] nettle-types: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- nettle-types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/nettle-types.h b/nettle-types.h index 5addf3600d69..93a68f3b3

[PATCH 1/3] eax: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- eax.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eax.c b/eax.c index 621020def5ce..4b8b51177

Re: [PATCH] nettle-types: drop w field from nettle_block16

2019-07-03 Thread Dmitry Eremin-Solenikov
Hmm. This patch has to wait a bit, sent it without actual testing. nettle_block16.w is used by eax (easy to copy with) and gcm (might need performance checks on 32-bit architectures). ср, 3 июл. 2019 г. в 00:45, Dmitry Eremin-Solenikov : > > "unsigned long w" comes from the

[PATCH] nettle-types: drop w field from nettle_block16

2019-07-02 Thread Dmitry Eremin-Solenikov
"unsigned long w" comes from the time when Nettle didn't use uint64_t. It is unused now and thus can be dropped. Signed-off-by: Dmitry Eremin-Solenikov --- nettle-types.h | 1 - 1 file changed, 1 deletion(-) diff --git a/nettle-types.h b/nettle-types.h index 5addf3600d69..93a68f3b3

Re: [PATCH 2/4] cmac: add 64-bit mode CMAC

2019-07-02 Thread Dmitry Eremin-Solenikov
ср, 3 июл. 2019 г. в 00:15, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > +union nettle_block8 > > +{ > > + uint8_t b[8]; > > + unsigned long w[8 / sizeof(unsigned long)]; > > + uint64_t u64; > > +}; > > The "unsigned lo

[PATCH 14/14] hmac-sha512/hmac-sha384: use new hmac and hash split state/buffer interface

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac-sha384.c | 4 ++-- hmac-sha512.c | 6 +++--- hmac.h| 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hmac-sha384.c b/hmac-sha384.c index 30008b5f85c1..d162c4a0fab8 100644 --- a/hmac-sha384.c +++ b/hmac-sha384.c

[PATCH 11/14] sha256/sha224: split context into hash state and byte buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h | 2 ++ sha2.h| 42 ++-- sha224-meta.c | 3 ++ sha256-meta.c | 3 ++ sha256.c | 76 +++ 5 files changed, 106 insertions(+), 20 deletions(-) diff --git

[PATCH 12/14] hmac-sha256/hmac-sha224: use new hmac and hash split state/buffer interface

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac-sha224.c | 4 ++-- hmac-sha256.c | 6 +++--- hmac.h| 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hmac-sha224.c b/hmac-sha224.c index c5bc8750a054..303337fe257f 100644 --- a/hmac-sha224.c +++ b/hmac-sha224.c

[PATCH 07/14] ripemd160: split context into hash state and byte buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h| 1 + ripemd160-meta.c | 3 +++ ripemd160.c | 50 ripemd160.h | 29 +--- 4 files changed, 68 insertions(+), 15 deletions(-) diff --git a/nettle

[PATCH 06/14] hmac-md5: use new hmac and hash split state/buffer interface

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac-md5.c | 6 +++--- hmac.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmac-md5.c b/hmac-md5.c index a27e64f6f61b..910d8a508a11 100644 --- a/hmac-md5.c +++ b/hmac-md5.c @@ -41,19 +41,19 @@ void hmac_md5_set_key(struct

[PATCH 05/14] hmac: add interface for working with separate hash state and buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac.c | 62 ++ hmac.h | 27 + 2 files changed, 89 insertions(+) diff --git a/hmac.c b/hmac.c index 6ac5e11a0686..6b925ce6e147 100644 --- a/hmac.c +++ b/hmac.c @@ -115,3

[PATCH 13/14] sha512/sha384: split context into hash state and byte buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h | 12 + sha2.h| 45 -- sha384-meta.c | 3 ++ sha512-meta.c | 3 ++ sha512.c | 129 -- 5 files changed, 152 insertions(+), 40 deletions(-) diff --git

[PATCH 10/14] hmac-sha1: use new hmac and hash split state/buffer interface

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac-sha1.c | 6 +++--- hmac.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmac-sha1.c b/hmac-sha1.c index 5e7188f92cf2..e968a51cd431 100644 --- a/hmac-sha1.c +++ b/hmac-sha1.c @@ -41,19 +41,19 @@ void hmac_sha1_set_key

[PATCH 01/14] sha512-224, -256: use _NETTLE_HASH_US instead of hand-coding structure definitions

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h | 10 ++ sha512-224-meta.c | 12 ++-- sha512-256-meta.c | 12 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/nettle-meta.h b/nettle-meta.h index 74e50e59cd2e..e3db0e9d63aa 100644

[PATCH 02/14] hash: start separating state and block contexts

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h | 28 nettle-types.h | 15 +++ 2 files changed, 43 insertions(+) diff --git a/nettle-meta.h b/nettle-meta.h index e3db0e9d63aa..f21dcd9b344d 100644 --- a/nettle-meta.h +++ b/nettle-meta.h

[PATCH 09/14] sha1: split context into hash state and byte buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta.h | 1 + sha1-meta.c | 3 +++ sha1.c| 56 --- sha1.h| 29 +++--- 4 files changed, 70 insertions(+), 19 deletions(-) diff --git a/nettle-meta.h b/nettle

[PATCH 00/14] HMAC implementation rework

2019-07-02 Thread Dmitry Eremin-Solenikov
to dda00a07d26dbdb6647186c778febe870c30cafc: hmac-sha512/hmac-sha384: use new hmac and hash split state/buffer interface (2019-07-02 16:21:48 +0300) Dmitry Eremin-Solenikov (14): sha512-224,-256: use _NETTLE_HASH_US instead

[PATCH 04/14] md5: split context into hash state and byte buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- md5-meta.c| 3 +++ md5.c | 52 +-- md5.h | 29 +--- nettle-meta.h | 2 ++ 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/md5-meta.c b/md5

[PATCH 08/14] hmac-ripemd160: use new hmac and hash split state/buffer interface

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- hmac-ripemd160.c | 6 +++--- hmac.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hmac-ripemd160.c b/hmac-ripemd160.c index 24e2cbe7a578..fa4e6a09075c 100644 --- a/hmac-ripemd160.c +++ b/hmac-ripemd160.c @@ -41,19

[PATCH 03/14] macros: add interface for working with separate hash state and buffer

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- macros.h | 66 1 file changed, 66 insertions(+) diff --git a/macros.h b/macros.h index 990d32ee3b36..615f06c4c7de 100644 --- a/macros.h +++ b/macros.h @@ -215,6 +215,45 @@ do

[PATCH 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-07-02 Thread Dmitry Eremin-Solenikov
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

[PATCH 4/6] Add HMAC functions for GOSTHASH94 and GOSTHASH94CP

2019-07-02 Thread Dmitry Eremin-Solenikov
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 --- Makefile.in | 6 ++-- hmac-gosthash94.c | 79 +++ hmac.h

[PATCH 5/6] Add PBKDF2 support for gosthash94cp

2019-07-02 Thread Dmitry Eremin-Solenikov
function implementing Nettle interface for PBKDF2 using gosthash94cp. Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in | 3 ++- pbkdf2-hmac-gosthash94.c | 53 pbkdf2.h | 7 ++ testsuite/pbkdf2-test.c | 24

[PATCH 2/6] Add GOST R 34.11 to nettle_hashes

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle-meta-hashes.c | 1 + testsuite/meta-hash-test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/nettle-meta-hashes.c b/nettle-meta-hashes.c index 37552edec5ca..f0ef026d359f 100644 --- a/nettle-meta-hashes.c +++ b/nettle-meta-hashes.c

[PATCH 6/6] gosthash94: switch to using MD_UPDATE() macro

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- gosthash94.c | 43 +-- gosthash94.h | 5 +++-- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/gosthash94.c b/gosthash94.c index 0e84553f9a03..8105530516ee 100644 --- a/gosthash94.c +++ b

[PATCH 3/6] Add support for GOSTHASH94CP: GOST R 34.11-94 hash with CryptoPro S-box

2019-07-02 Thread Dmitry Eremin-Solenikov
34.11-94 hashing using that S-Box. Signed-off-by: Dmitry Eremin-Solenikov --- examples/nettle-benchmark.c | 1 + gost28147.c | 266 gost28147.h | 2 + gosthash94-meta.c | 3 + gosthash94.c| 83

[PATCH 2/4] cmac: add 64-bit mode CMAC

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- cmac.c | 125 - cmac.h | 69 +++ nettle-types.h | 7 +++ 3 files changed, 200 insertions(+), 1 deletion(-) diff --git a/cmac.c b/cmac.c index c5a59b18e572

[PATCH 3/4] cmac: add CMAC-DES3 (CMAC-TDES) implementation

2019-07-02 Thread Dmitry Eremin-Solenikov
Implement CMAC using TrippleDES as underlying cipher. Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in | 2 +- cmac-des3.c | 61 +++ cmac.h| 17 testsuite/cmac-test.c | 32 +++ 4

[PATCH 4/4] Expand documentation to cover CMAC-64

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle.texinfo | 38 ++ 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/nettle.texinfo b/nettle.texinfo index b8579a6ed59b..57e6345f78df 100644 --- a/nettle.texinfo +++ b/nettle.texinfo @@ -3718,14

[PATCH 1/4] Move MAC testing code to generic place from cmac-test

2019-07-02 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- testsuite/cmac-test.c | 100 +++--- testsuite/testutils.c | 64 +++ testsuite/testutils.h | 6 +++ 3 files changed, 96 insertions(+), 74 deletions(-) diff --git a/testsuite/cmac-test.c b

Re: Changes after 3.5.1

2019-07-02 Thread Dmitry Eremin-Solenikov
Hello, вт, 2 июл. 2019 г. в 15:03, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > I have several patch series that were sitting in my local gost tree. > > Most of them were posted to this mailing list for review with little > > to no feedback. > &g

Changes after 3.5.1

2019-06-28 Thread Dmitry Eremin-Solenikov
Hello, I have several patch series that were sitting in my local gost tree. Most of them were posted to this mailing list for review with little to no feedback. For now they are incorporated into GnuTLS for testing and maturing. I'd like to understand, how should I proceed if I'd like to get them

[PATCH v2 4/4] Expand documentation to cover CMAC-64

2019-06-07 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- nettle.texinfo | 38 ++ 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/nettle.texinfo b/nettle.texinfo index 547e0c2b462c..9670bf119211 100644 --- a/nettle.texinfo +++ b/nettle.texinfo @@ -3718,14

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-12 Thread Dmitry Eremin-Solenikov
Hi, > > For now I'm running ecc-mul-a-test and ecc-mul-g-test in a loop without any > > errors. > > To make running in a loop useful, you need to add random seeding, see > ecc-mod-test.c for an example to how to do it, enabled by the > NETTLE_TEST_SEED environment variable. Used like > > while

[PATCH 1/2] Implement GOST R 34.11-2012 (Streebog) hash function

2019-05-12 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in |5 +- examples/nettle-benchmark.c |1 + hmac-streebog.c | 73 ++ hmac.h | 33 + nettle-meta-hashes.c|2 + nettle-meta.h |2 + nettle.texinfo

[PATCH 2/2] Implement PBKDF2 shortcut function for Streebog256/512

2019-05-12 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- Makefile.in | 1 + pbkdf2-hmac-streebog.c | 67 + pbkdf2.h| 14 + testsuite/pbkdf2-test.c | 6 4 files changed, 88 insertions(+) create mode 100644 pbkdf2-hmac

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-12 Thread Dmitry Eremin-Solenikov
сб, 11 мая 2019 г. в 21:55, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > >> If p is close to B^size / 2, then I think a reduction like > > > > Yes, it is. > > > > As an overflow happens in low level code, do you suggest > > duplicating ec

Re: [PATCH 1/3] Move MAC testing code to generic place from cmac-test

2019-05-12 Thread Dmitry Eremin-Solenikov
ср, 8 мая 2019 г. в 15:33, Dmitry Eremin-Solenikov : > Any chances to get these 3 patches in? Just as a word of justification: one of GOST-defined modes is CFB, which is used with 64-bit cipher (Magma, GOST 28147-89). Having this code in allows us to use it directly from Nettle instead of hav

Re: Release? (was: Re: curve448 branch)

2019-05-11 Thread Dmitry Eremin-Solenikov
Hello, сб, 11 мая 2019 г. в 22:40, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Is there anything that we can do to help with 3.5? > > I've just updated the NEWS file, please review. Since it's an ABI break, > maybe a few more things could be deleted. > &

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-11 Thread Dmitry Eremin-Solenikov
Hello, сб, 11 мая 2019 г. в 11:26, Niels Möller : > > Dmitry Eremin-Solenikov writes: > > > Signed-off-by: Dmitry Eremin-Solenikov > > --- > > ecc-mod-arith.c | 30 ++ > > 1 file changed, 18 insertions(+), 12 deletions(-) > >

[PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-08 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- ecc-mod-arith.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/ecc-mod-arith.c b/ecc-mod-arith.c index f2e47f6747c1..571680a98dc3 100644 --- a/ecc-mod-arith.c +++ b/ecc-mod-arith.c @@ -73,10 +73,12

[PATCH 2/3] Add GOST R 34.10 curves defined by RFC4357 and newer standard

2019-05-08 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov --- .gitignore | 5 ++ Makefile.in | 55 +- ecc-curve.h | 5 ++ ecc-gc256b.c | 125 ++ ecc-gc256c.c | 143 +++ ecc

  1   2   >