diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2020-02-09 21:29:43 +0300 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-03-20 13:48:44 +0100 |
commit | dcee00adbd1c0a2cde1aeed1bb94421e81d0de3b (patch) | |
tree | 410d7d0226d3b1f83caa6a62a395180ec327c788 /cipher/cipher.c | |
parent | 18cd3f0c473ae909cdaa5a820faef50d7670fcbb (diff) | |
download | libgcrypt-dcee00adbd1c0a2cde1aeed1bb94421e81d0de3b.tar.gz |
gost28147: add support for CryptoPro key meshing per RFC 4357
* cipher/gost28147.c (gost_do_set_sbox, cryptopro_key_meshing,
CryptoProMeshingKey, gost_encrypt_block_mesh): New.
(_gcry_cipher_spec_gost28147_mesh): New cipher with keymeshing,
(_gcry_cipher_spec_gost28147): Remove OIDs for this cipher should not
be selected using these OIDs (they are for CFB with keymeshing).
* cipher/cipher.c (cipher_list, cipher_list_algo301): add
_gcry_cipher_spec_gost28147_mesh.
* src/gcrypt.h.in (GCRY_CIPHER_GOST28147_MESH): New cipher with
keymeshing.
* doc/gcrypt.texi (GCRY_CIPHER_GOST28147_MESH): Add definition.
* tests/basic.c (check_gost28147_cipher, check_gost28147_cipher_basic):
Run basic tests on GCRY_CIPHER_GOST28147_MESH.
--
Add actual cipher implementing CryptoPro KeyMeshing. This has been
requested by AltLinux team to properly support CFB-encrypted CMS files.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r-- | cipher/cipher.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c index 09b8d829..edcb421a 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -83,6 +83,7 @@ static gcry_cipher_spec_t * const cipher_list[] = #endif #if USE_GOST28147 &_gcry_cipher_spec_gost28147, + &_gcry_cipher_spec_gost28147_mesh, #endif #if USE_CHACHA20 &_gcry_cipher_spec_chacha20, @@ -193,7 +194,12 @@ static gcry_cipher_spec_t * const cipher_list_algo301[] = NULL, #endif #if USE_CHACHA20 - &_gcry_cipher_spec_chacha20 + &_gcry_cipher_spec_chacha20, +#else + NULL, +#endif +#if USE_GOST28147 + &_gcry_cipher_spec_gost28147_mesh, #else NULL, #endif |