KCAPI_AKCIPHER_SIGN_(3)

πŸ’– KCAPI_AKCIPHER_SIGN_AIO β€” bestie's guide to signing data πŸ’–

okay so this is a page from the libkcapi manual, section 3 (that's the programming interface girlies, iykyk). it's all about kcapi_akcipher_sign_aio and honestly? it's giving ✨one shot✨ energy.


✨ NAME ✨

kcapi_akcipher_sign_aio β€” sign data (asynchronous one shot) πŸ’…


🌸 SYNOPSIS 🌸

ssize_t kcapi_akcipher_sign_aio(struct kcapi_handle * handle,
                                struct iovec * iniov,
                                struct iovec * outiov, size_t iovlen,
                                int access);

πŸŽ€ ARGUMENTS πŸŽ€

  • handle β€” [in] your cipher handle, the main character of this whole situation 🫢
  • iniov β€” [in] head of the scatter-gather list array holding the plaintext, so like, the stuff going in πŸ’Œ
  • outiov β€” [out] head of the scatter-gather list of the destination buffers filled with ciphertext, aka where the signed stuff lands πŸ¦‹
  • iovlen β€” [in] number of scatter-gather list entries, count 'em bestie πŸ”’
  • access β€” [in] the kernel access type, and you've got choices:
    • KCAPI_ACCESS_HEURISTIC β€” use internal heuristic for fastest kernel access (the "let the algorithm pick for me" vibe 🧚)
    • KCAPI_ACCESS_VMSPLICE β€” use vmsplice access
    • KCAPI_ACCESS_SENDMSG β€” sendmsg access

🌈 DESCRIPTION 🌈

The individual scatter-gather list entries are processed with separate invocations of the the given cipher. (yes, "the the" β€” that's literally what it says, no cap 😭)

The memory should be aligned at the page boundary using posix_memalign(sysconf(_SC_PAGESIZE)). If it is not aligned at the page boundary, the vmsplice call may not send all data to the kernel.

⚠️ okay this one matters: page-boundary alignment is not optional vibes, it's a whole thing. misaligned memory + vmsplice = the kernel might not get all your data. not slay. πŸ’€

return number of bytes signed upon success; a negative errno-style error code if an error occurred. so like, if you get a negative number back, something went wrong bestie β€” that's your error right there πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de>

  • Author. (he did that. periodt. πŸ’œ)

and that's the whole page, fr fr. this was libkcapi Manual 1.5.0, dated July 2025 β€” shoutout to the KCAPI_AKCIPHER_SIGN_(3) girlies, go sign something iconic πŸŒŸπŸ’…

πŸ“¦ where this page comes from