From 25d6af77e2336b5979ddbe8b90978fe5b61dfaf9 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Fri, 6 Jun 2014 22:48:32 +0400 Subject: Add GOST R 34.11-94 variant using id-GostR3411-94-CryptoProParamSet * src/gcrypt.h.in (GCRY_MD_GOSTR3411_CP): New. * src/cipher.h (_gcry_digest_spec_gost3411_cp): New. * cipher/gost28147.c (_gcry_gost_enc_one): Differentiate between CryptoPro and Test S-Boxes. * cipher/gostr3411-94.c (_gcry_digest_spec_gost3411_cp, gost3411_cp_init): New. * cipher/md.c (md_open): GCRY_MD_GOSTR3411_CP also uses B=32. -- RFC4357 defines only two S-Boxes that should be used together with GOST R 34.11-94 - a testing one (from standard itself, for testing only) and CryptoPro one. Instead of adding a separate gcry_md_ctrl() function just to switch s-boxes, add a separate MD algorithm using CryptoPro S-box. Signed-off-by: Dmitry Eremin-Solenikov --- cipher/gost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cipher/gost.h') diff --git a/cipher/gost.h b/cipher/gost.h index 3fbd9df2..caaf34ba 100644 --- a/cipher/gost.h +++ b/cipher/gost.h @@ -27,6 +27,6 @@ typedef struct { /* This is a simple interface that will be used by GOST R 34.11-94 */ extern unsigned int _gcry_gost_enc_one (GOST28147_context *c, const byte *key, - byte *out, byte *in); + byte *out, byte *in, int cryptopro); #endif -- cgit v1.2.1