From: Niels Möller Date: Mon, 26 May 2025 18:16:00 +0000 (+0200) Subject: Delete documentation of old hmac functions and macros. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=338191dcaf7c74d039fe3534ece306fa6cc01d5d;p=thirdparty%2Fnettle.git Delete documentation of old hmac functions and macros. --- diff --git a/nettle.texinfo b/nettle.texinfo index e5db3ee7..7af9bc08 100644 --- a/nettle.texinfo +++ b/nettle.texinfo @@ -4043,83 +4043,6 @@ keys of length @code{l}, the digest size of the underlying hash function very useful. Nettle's @acronym{HMAC} functions are defined in @file{}. -There are abstract functions that use a pointer to a @code{struct -nettle_hash} to represent the underlying hash function and @code{void *} -pointers that point to three different context structs for that hash -function. There are also concrete functions for @acronym{HMAC-MD5}, -@acronym{HMAC-RIPEMD160} @acronym{HMAC-SHA1}, @acronym{HMAC-SHA256}, -@acronym{HMAC-SHA512}, and @acronym{HMAC-SM3}. First, the abstract functions: - -@deftypefun void hmac_set_key (void *@var{outer}, void *@var{inner}, void *@var{state}, const struct nettle_hash *@var{H}, size_t @var{length}, const uint8_t *@var{key}) -Initializes the three context structs from the key. The @var{outer} and -@var{inner} contexts corresponds to the subkeys @code{k_o} and -@code{k_i}. @var{state} is used for hashing the message, and is -initialized as a copy of the @var{inner} context. -@end deftypefun - -@deftypefun void hmac_update (void *@var{state}, const struct nettle_hash *@var{H}, size_t @var{length}, const uint8_t *@var{data}) -This function is called zero or more times to process the message. -Actually, @code{hmac_update(state, H, length, data)} is equivalent to -@code{H->update(state, length, data)}, so if you wish you can use the -ordinary update function of the underlying hash function instead. -@end deftypefun - -@deftypefun void hmac_digest (const void *@var{outer}, const void *@var{inner}, void *@var{state}, const struct nettle_hash *@var{H}, uint8_t *@var{digest}) -Extracts the @acronym{MAC} of the message, writing @code{H->digest_size} -octets to @var{digest}. @var{outer} and @var{inner} are not modified. - -This function also resets the @var{state} context so that you can start -over processing a new message (with the same key). -@end deftypefun - -Like for @acronym{CBC}, there are some macros to help use these -functions correctly. - -@deffn Macro HMAC_CTX (@var{type}) -Expands to -@example -@{ - type outer; - type inner; - type state; -@} -@end example -@end deffn - -It can be used to define a @acronym{HMAC} context struct, either -directly, - -@example -struct HMAC_CTX(struct md5_ctx) ctx; -@end example - -or to give it a struct tag, - -@example -struct hmac_md5_ctx HMAC_CTX (struct md5_ctx); -@end example - -@deffn Macro HMAC_SET_KEY (@var{ctx}, @var{H}, @var{length}, @var{key}) -@var{ctx} is a pointer to a context struct as defined by -@code{HMAC_CTX}, @var{H} is a pointer to a @code{const struct -nettle_hash} describing the underlying hash function (so it must match -the type of the components of @var{ctx}). The last two arguments specify -the secret key. -@end deffn - -@deffn Macro HMAC_DIGEST (@var{ctx}, @var{H}, @var{digest}) -@var{ctx} is a pointer to a context struct as defined by -@code{HMAC_CTX}, @var{H} is a pointer to a @code{const struct -nettle_hash} describing the underlying hash function. The @var{digest} -argument specifies where the digest is written. -@end deffn - -Note that there is no @code{HMAC_UPDATE} macro; simply call -@code{hmac_update} function directly, or the update function of the -underlying hash function. - -Now we come to the specialized @acronym{HMAC} functions, which are -easier to use than the general @acronym{HMAC} functions. @subsubsection @acronym{HMAC-MD5}