LIBKECCAK_...AST_DIGEST(3)
π NAME π
libkeccak_hmac_fast_digest β Complete the HMAC-hashing of a message without erasure.
okay bestie, welcome to the LIBKECCAK Library Functions Manual page for this icon. Itβs the fast digest finish-line function, and yes, weβre keeping every deet. β¨
β¨ SYNOPSIS β¨
#include <libkeccak.h>
int libkeccak_hmac_fast_digest(struct libkeccak_hmac_state *state, const void *msg, size_t msglen,
size_t bits, const char *suffix, void *hashsum);
Link with -lkeccak.
π¦ DESCRIPTION π¦
The libkeccak_hmac_fast_digest() function absorbs the last part of (or all of) a message, and returns the HMAC hash of the entire message. Slay. π
Hereβs the parameter tea:
msgβ the last part of the message. If all of the message has already been processed by calls tolibkeccak_hmac_update(3)orlibkeccak_hmac_fast_update(3)(with the same pointer onstate,), thenmsgandmsglenshould be set toNULLand0, respectively.msglenβ the byte-size of the message part inmsg. It must only count the number of whole bytes, that is, the floor of the number of bits in the message divided by 8.bitsβ if the message is not comprised of a whole number of bytes, put the number of bits, modulus 8, in this parameter.suffixβ a NUL-terminated string of ASCII'1':sand'0':s, representing the bits that should be appended to the message. If this string is empty,NULLmay be used instead. This is used to select the hash algorithm. For pure Keccak,NULLor""is used. For the other algorithms the constantsLIBKECCAK_SHA3_SUFFIX(for SHA-3),LIBKECCAK_RAWSHAKE_SUFFIX(for RawSHAKE), andLIBKECCAK_SHAKE_SUFFIX(for SHAKE) are used.hashsumβ where the hash of the message will be stored, unlesshashsumisNULL(which increases the performance of the call.) A total of((state->n + 7) / 8)bytes will be written to the beginning ofhashsum. Therefore,hashsumneeds at least an allocation size of that number of bytes.
β οΈ heads up, bestie: libkeccak_hmac_fast_digest() may reallocate the stateβs message chunk buffer. When doing so, it attempts to do so as quickly as possible, rather than ensuring that the information in the old allocation is securely removed if a new allocation is required. Not the secure-wipe vibe β thatβs just the documented behavior. π
π RETURN VALUES π
The libkeccak_hmac_fast_digest() function returns 0 upon successful completion. On error, -1 is returned and errno is set to describe the error. π«Ά
πΈ ERRORS πΈ
The libkeccak_hmac_fast_digest() function may fail for any reason specified by the function realloc(3). π
π₯ SEE ALSO π₯
libkeccak_hmac_create(3)libkeccak_hmac_initialise(3)libkeccak_hmac_fast_update(3)libkeccak_hmac_fast_digest(3)
source/version: LIBKECCAK Β· footer title repeat: LIBKECCAK_...AST_DIGEST(3) Β· date: not printed on this page, bestie β mwah ππ
π¦ where this page comes from
- arch rolling: libkeccak 1.4.3-1 Β· custom:ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms