diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2020-03-21 22:33:51 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2020-04-19 21:57:53 +0300 |
commit | 45f21f871982753716d4a7676d948e8c7d644db5 (patch) | |
tree | 5451d3ae4d1eb6f7dd18f41d7946380be1c41f07 /src/gcrypt.h.in | |
parent | d7fa70ed9ddc6e0189a8b59016b1f17717a26865 (diff) | |
download | libgcrypt-45f21f871982753716d4a7676d948e8c7d644db5.tar.gz |
gost28147: implement special MAC mode called imitovstavka (IMIT)
* src/gcrypt.h.in (GCRY_MAC_GOST28147_IMIT): New.
* cipher/gost28147.c (gost_imit_open, gost_imit_close)
(gost_imit_setkey, gost_imit_setiv, gost_imit_reset, _gost_imit_block)
(gost_imit_block, gost_imit_write, gost_imit_finish, gost_imit_read)
(gost_imit_verify, gost_imit_get_maclen, gost_imit_get_keylen)
(gost_imit_set_extra_info): New functions implementing GOST 28147-89
MAC (imitovstavka, IMIT) mode.
* cipher/gost28147.c (gost_imit_ops)
(_gcry_mac_type_spec_gost28147_imit): declare GOST 28147-89 IMIT
handler.
* cipher/mac-internal.h (gcry_mac_handle): add fields to support GOST
28147-89 IMIT mode.
* cipher/mac.c (mac_list): add _gcry_mac_type_spec_gost28147_imit.
(spec_from_algo): handle GCRY_MAC_GOST28147_IMIT.
* tests/basic.c (check_mac): add GOST28147-89 IMIT test vector.
--
GOST 28147-89 (see RFC 5830 Section 8) defines MAC construction using
the same base transformation. Implement support for it: required to read
some CMS files produced using GOST algorithms, see RFC 4490.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
[jk: cipher/mac-internal.h: moved include of gost.h to include section]
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'src/gcrypt.h.in')
-rw-r--r-- | src/gcrypt.h.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index 375a40e2..bc96ba40 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -1440,6 +1440,7 @@ typedef struct gcry_mac_handle *gcry_mac_hd_t; enum gcry_mac_algos { GCRY_MAC_NONE = 0, + GCRY_MAC_GOST28147_IMIT = 1, GCRY_MAC_HMAC_SHA256 = 101, GCRY_MAC_HMAC_SHA224 = 102, |