HMAC.H(3)

πŸ“¦ version 1.5.0, in opensuse-leap 16.0

πŸ¦‹ hmac.h(3) β€” the HMAC glow-up, bestie edition ✨

okay so real talk, this page lives at /home/abui.../zpc/hmac.h(3) and it's from the Library Functions Manual β€” yes, that's the vibe. it's the man page for the header file

/home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/hmac.h

and it's the HMAC API. πŸ’…


🌸 NAME 🌸

/home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/hmac.h β€” HMAC API. that's it, that's the whole name, path and all, no cap 😭 (yes the full build path is literally part of it, she ate and left no crumbs)


πŸ’– SYNOPSIS πŸ’–

functions (the whole squad) 🫢

int zpc_hmac_alloc (struct zpc_hmac **ctx)
int zpc_hmac_set_key (struct zpc_hmac *ctx, struct zpc_hmac_key *key)
int zpc_hmac_sign (struct zpc_hmac *ctx, unsigned char *mac, size_t
    maclen, const unsigned char *msg, size_t msglen)
int zpc_hmac_verify (struct zpc_hmac *ctx, const unsigned char *mac,
    size_t maclen, const unsigned char *msg, size_t msglen)
void zpc_hmac_free (struct zpc_hmac **ctx)

✨ Detailed Description ✨

HMAC API.

so this is the message authentication API for the Hash-based Message Authentication Code β€” HMAC, iykyk. it's literally the thing that makes sure nobody messed with your message. lowkey iconic. πŸ‘‘

Definition in file hmac.h.

πŸŽ€ Function Documentation πŸŽ€

int zpc_hmac_alloc (struct zpc_hmac ** ctx) 🌱

Allocate a shiny new context for an HMAC operation. fresh context, main character energy.

Parameters (the deets):

  • ctx β€” HMAC context

Returns: 0 on success. Otherwise, a non-zero error code is returned. bestie if it's not zero, something went sideways πŸ’€


int zpc_hmac_set_key (struct zpc_hmac * ctx, struct zpc_hmac_key * key) πŸ”‘

Set the key to be used in the context of an HMAC operation. give her the key and she'll do the rest ✨

Parameters:

  • ctx β€” HMAC context
  • key β€” HMAC key

Returns: 0 on success. Otherwise, a non-zero error code is returned. periodt.


int zpc_hmac_sign (struct zpc_hmac * ctx, unsigned char * mac, size_t maclen, const unsigned char * msg, size_t msglen) πŸ–ŠοΈ

Do an HMAC signing operation. we're signing things, we're THAT girl now.

Parameters:

  • ctx β€” HMAC context
  • mac β€” message authentication code. so here's the tea πŸ«–: when mac is set to NULL, this indicates that an internal intermediate MAC is calculated, and further intermediate calls with additional msg data may follow. If the mac parm is not NULL and the maclen is a valid MAC length (dependent on the underlying hash function of the key), the final MAC is computed.
  • maclen β€” message authentication code length [bytes]
  • msg β€” message
  • msglen β€” message length [bytes]

Returns: 0 on success. Otherwise, a non-zero error code is returned. slay πŸ’…


int zpc_hmac_verify (struct zpc_hmac * ctx, const unsigned char * mac, size_t maclen, const unsigned char * msg, size_t msglen) πŸ”

Do an HMAC verify operation. vibe check on the MAC, fr fr.

Parameters:

  • ctx β€” HMAC context
  • mac β€” message authentication code. if the mac parm is NULL, then an intermediate verify op is performed. If the mac parm is not NULL and the maclen is a valid MAC length (dependent on the underlying hash function of the key), then the given MAC is checked for correctness. πŸ‘€
  • maclen β€” message authentication code length [bytes]
  • msg β€” message
  • msglen β€” message length [bytes]

Returns: 0 on success. Otherwise, a non-zero error code is returned. no cap.


void zpc_hmac_free (struct zpc_hmac ** ctx) 🧹

Free an HMAC context. clean up after yourself, we love a responsible queen πŸ’œ (note: it returns void, so you're not getting an error code back, she just goes)

Parameters:

  • ctx β€” HMAC context

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libzpc from the source code. not a human, a whole robot wrote this, respect ✨


and that's the whole page bestie, go build something cute with it πŸ¦‹πŸ’–

objective: libzpc β€” Version 1.4 β€” dated /home/abui.../zpc/hmac.h(3). mwah, signing off πŸŽ€
πŸ“¦ where this page comes from