diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2020-03-21 22:33:50 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2020-04-19 21:57:48 +0300 |
commit | d7fa70ed9ddc6e0189a8b59016b1f17717a26865 (patch) | |
tree | 82fd521483eddfd3e5ac102e372d03a3c9694e48 /cipher/mac-internal.h | |
parent | 469e2fefb64e3a4bd80995935f82caf416e3a4ae (diff) | |
download | libgcrypt-d7fa70ed9ddc6e0189a8b59016b1f17717a26865.tar.gz |
mac: add support for gcry_mac_ctl(GCRYCTL_SET_SBOX)
* cipher/mac-internal.h (gcry_mac_spec_ops_t): add set_extra_info field
for providing additional settings.
* cipher/mac.c (_gcry_mac_ctl): support GCRYCTL_SET_SBOX call.
* cipher/mac-cmac.c (cmac_ops): set set_extra_info to NULL.
* cipher/mac-gmac.c (gmac_ops): the same.
* cipher/mac-hmac.c (hmac_ops): the same.
* cipher/mac-poly1305.c (poly1305mac_ops): the same.
--
New MAC GOST28147-IMIT needs info about S-Box to be used. This info can
be passed via a call to gcry_mac_ctl(GCRYCTL_SET_SBOX, ...).
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'cipher/mac-internal.h')
-rw-r--r-- | cipher/mac-internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cipher/mac-internal.h b/cipher/mac-internal.h index 03f5b8da..15b4dfc2 100644 --- a/cipher/mac-internal.h +++ b/cipher/mac-internal.h @@ -63,6 +63,9 @@ typedef gcry_err_code_t (*gcry_mac_verify_func_t)(gcry_mac_hd_t h, typedef unsigned int (*gcry_mac_get_maclen_func_t)(int algo); typedef unsigned int (*gcry_mac_get_keylen_func_t)(int algo); +/* The type used to convey additional information to a MAC. */ +typedef gpg_err_code_t (*gcry_mac_set_extra_info_t) + (gcry_mac_hd_t h, int what, const void *buffer, size_t buflen); typedef struct gcry_mac_spec_ops { @@ -76,6 +79,7 @@ typedef struct gcry_mac_spec_ops gcry_mac_verify_func_t verify; gcry_mac_get_maclen_func_t get_maclen; gcry_mac_get_keylen_func_t get_keylen; + gcry_mac_set_extra_info_t set_extra_info; } gcry_mac_spec_ops_t; |