From c3d1f9c3159416331c0c852739fb5fd2cf60f708 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Sun, 28 Oct 2018 10:11:21 +0300 Subject: nettle: fix s-boxes selection for rare GOST 28147-89 variants gost28147-89 code contained c&p error, which resulted in using S-BOX CryptoPro-A instead of -B, -C, -D. Fix that. Signed-off-by: Dmitry Eremin-Solenikov --- lib/nettle/cipher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nettle/cipher.c b/lib/nettle/cipher.c index eab1a03588..e28c39038c 100644 --- a/lib/nettle/cipher.c +++ b/lib/nettle/cipher.c @@ -176,21 +176,21 @@ static void _gost28147_set_key_cpb(void *ctx, const uint8_t *key) { gost28147_set_key(ctx, key); - gost28147_set_param(ctx, &gost28147_param_CryptoPro_A); + gost28147_set_param(ctx, &gost28147_param_CryptoPro_B); } static void _gost28147_set_key_cpc(void *ctx, const uint8_t *key) { gost28147_set_key(ctx, key); - gost28147_set_param(ctx, &gost28147_param_CryptoPro_A); + gost28147_set_param(ctx, &gost28147_param_CryptoPro_C); } static void _gost28147_set_key_cpd(void *ctx, const uint8_t *key) { gost28147_set_key(ctx, key); - gost28147_set_param(ctx, &gost28147_param_CryptoPro_A); + gost28147_set_param(ctx, &gost28147_param_CryptoPro_D); } #endif -- cgit v1.2.1