KCAPI_MD_INIT(3)

✨ KCAPI_MD_INIT(3) ✨

okay bestie, welcome to kcapi_md_init(3) β€” the programming interface moment where we birth a message digest handle and introduce it to the kernel 🫢 this is from the libkcapi crew and it's literally the first step of your hash journey, no cap.


🌸 NAME 🌸

kcapi_md_init β€” initialize cipher handle πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int kcapi_md_init(struct kcapi_handle ** handle,
                  const char * ciphername, uint32_t flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • handle β€” [out] the cipher handle, filled in during the call. She's empty when you hand her over, she's full of possibilities when you get her back ✨
  • ciphername β€” [in] the kernel crypto API cipher name, exactly as it's specified in /proc/crypto. Not vibes-based, bestie, go look it up πŸ‘€
  • flags β€” [in]</in> flags that specify the type of cipher handle. You're telling the kernel what kind of girl she is πŸ’…

πŸ’– DESCRIPTION πŸ’–

So like, this function initializes a (keyed) message digest handle and establishes the connection to the kernel. That's the whole assignment. She sets it up, she links it up, done 🧚

On success, a pointer to the kcapi_handle object is returned in *handle. And then β€” and this is important, don't skip this β€” you should call kcapi_md_destroy afterwards to free the resources. Clean up after yourself, it's giving responsible. πŸŽ€

Return values, in order, because we love a full list:

  • 0 β€” upon success πŸŽ‰
  • -ENOENT β€” algorithm not available 😭
  • -EOPNOTSUPP β€” AF_ALG family not available πŸ’€
  • -EINVAL β€” accept syscall failed πŸ™ˆ
  • -ENOMEM β€” cipher handle cannot be allocated 😡

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de> β€” Author. The main character who wrote this fr fr πŸ’œ


That's the whole page, bestie! Sending you off with all the love and zero leaks: this was libkcapi Manual 1.5.0, dated July 2025 β€” periodt πŸŒˆπŸ’…πŸŒΈ

πŸ“¦ where this page comes from