[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 +++

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

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

[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

[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
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