Lines Matching defs:HMAC
2076 \mysection{HMAC Protocol}
2077 Thanks to Dobes Vandermeer, the library now includes support for hash based message authentication codes, or HMAC for short. An HMAC
2079 to allow an owner of a private symmetric key to produce an HMAC on a message then later verify if it is correct. Any impostor or
2082 The HMAC support works much like the normal hash functions except that the initialization routine requires you to pass a key
2085 \index{hmac\_init()}
2087 int hmac_init( hmac_state *hmac,
2092 The \textit{hmac} parameter is the state for the HMAC code. The \textit{hash} parameter is the index into the descriptor table of the hash you want
2094 length (in octets) of the key you want to use to authenticate the message. To send octets of a message through the HMAC system you must use the following function:
2095 \index{hmac\_process()}
2097 int hmac_process( hmac_state *hmac,
2101 \textit{hmac} is the HMAC state you are working with. \textit{buf} is the array of octets to send into the HMAC process. \textit{len} is the
2103 are finished with the HMAC process you must call the following function to get the HMAC code:
2104 \index{hmac\_done()}
2106 int hmac_done( hmac_state *hmac,
2110 The \textit{hmac} parameter is the HMAC state you are working with. The \textit{out} parameter is the array of octets where the HMAC code should be stored.
2111 You must set \textit{outlen} to the size of the destination buffer before calling this function. It is updated with the length of the HMAC code
2113 the HMAC code) then the HMAC code is truncated as per FIPS-198 specifications (e.g. take the first \textit{outlen} bytes).
2116 message (file pointer, address in memory), and produce the HMAC result in one shot. These are useful if you want to avoid
2119 \index{hmac\_memory()}
2127 This will produce an HMAC code for the array of octets in \textit{in} of length \textit{inlen}. The index into the hash descriptor
2131 \index{hmac\_file()}
2143 To test if the HMAC code is working there is the following function:
2144 \index{hmac\_test()}
2149 HMAC system is given below.
2157 hmac_state hmac;
2172 /* start the HMAC */
2173 if ((err = hmac_init(&hmac, idx, key, 16)) != CRYPT_OK) {
2174 printf("Error setting up hmac: %s\n", error_to_string(err));
2179 if((err = hmac_process(&hmac, "hello", 5) != CRYPT_OK) {
2180 printf("Error processing hmac: %s\n", error_to_string(err));
2186 if ((err = hmac_done(&hmac, dst, &dstlen)) != CRYPT_OK) {
2187 printf("Error finishing hmac: %s\n", error_to_string(err));
2190 printf("The hmac is %lu bytes long\n", dstlen);
2203 HMAC routines. Instead, in this case a cipher is used instead of a hash.
2246 Which will terminate the OMAC and output the \textit{tag} (MAC) to \textit{out}. Note that unlike the HMAC and other code
2252 Similar to the HMAC
5020 The rest of the code uses state variables you must pass it such as hash\_state, hmac\_state, etc. This means that if each
5811 /* accelerated hmac callback: if you need to-do
5854 \subsection{HMAC Acceleration}
5855 The hmac\_block() callback is meant for single--shot optimized HMAC implementations. It is called directly by hmac\_memory() if present. If you need
5856 to be able to process multiple blocks per MAC then you will have to simply provide a process() callback and use hmac\_memory() as provided in LibTomCrypt.