diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2016-11-30 01:32:30 +0300 |
---|---|---|
committer | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-06-24 03:08:23 +0300 |
commit | 92daa9548dfd53490e6e463e4ce5185cdd766be0 (patch) | |
tree | 14f3e6caac7ce8a9fe4279c1b476050ceec7732e /lib/hash_int.h | |
parent | 7d8fd3aee4d71e1cd79ab5c980d137b363283a33 (diff) | |
download | gnutls-92daa9548dfd53490e6e463e4ce5185cdd766be0.tar.gz |
Add MAC api to support copying of instances
GOST ciphersuites requires continuously computing MAC of all the
previously sent or received data. The easies way to support that is to
add support for copy function, that creates MAC instance with the same
internal state.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'lib/hash_int.h')
-rw-r--r-- | lib/hash_int.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hash_int.h b/lib/hash_int.h index 52fb2b01f0..8e3154daa6 100644 --- a/lib/hash_int.h +++ b/lib/hash_int.h @@ -41,6 +41,7 @@ typedef int (*nonce_func) (void *handle, const void *text, size_t size); typedef int (*output_func) (void *src_ctx, void *digest, size_t digestsize); typedef void (*hash_deinit_func) (void *handle); +typedef void *(*copy_func) (const void *handle); typedef struct { const mac_entry_st *e; @@ -62,6 +63,7 @@ typedef struct { nonce_func setnonce; output_func output; hash_deinit_func deinit; + copy_func copy; void *handle; } mac_hd_st; @@ -73,6 +75,8 @@ int _gnutls_mac_exists(gnutls_mac_algorithm_t algorithm); int _gnutls_mac_init(mac_hd_st *, const mac_entry_st * e, const void *key, int keylen); +int _gnutls_mac_copy(const mac_hd_st * handle, mac_hd_st * dst); + int _gnutls_mac_fast(gnutls_mac_algorithm_t algorithm, const void *key, int keylen, const void *text, size_t textlen, void *digest); |