STRUCT ALGINFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ struct alginfo(9) πŸ‘‘

okay so welcome to the Kernel API Manual bestie, and today's main character is struct alginfo β€” literally just a container for algorithm details. that's it. that's the vibe. it holds all the little facts about your algorithm so the rest of the kernel doesn't have to go hunting for them πŸ’…


✨ NAME ✨

struct alginfo β€” the container for algorithm details, no cap πŸŽ€


🌸 SYNOPSIS 🌸

struct alginfo {
    u32 algtype;
    unsigned int keylen;
    unsigned int keylen_pad;
    dma_addr_t key_dma;
    dma_addr_t protected_key_dma;
    const void *key_virt;
    bool key_inline;
    u32 plain_keylen;
    u32 key_cmd_opt;
 };

like, look at her. nine fields. perfectly curated. iconic ✨


πŸ¦‹ Members πŸ¦‹

so each of these fields is doing its own little job and honestly? they all ate πŸ“

  • algtype β€” the algorithm selector. for what the valid values actually are, go read the documentation of whichever function is using it (iykyk, it's context-dependent bestie) πŸ”₯
  • keylen β€” length of the provided algorithm key, in bytes.
  • keylen_pad β€” the padded length of the provided algorithm key, in bytes. yes, padded. like a cozy little key πŸŽ€
  • key_dma β€” the dma (bus) address where the algorithm key resides.
  • protected_key_dma β€” the dma (bus) address where the protected key resides. fancy.
  • key_virt β€” the virtual address where the algorithm key resides.
  • key_inline β€” true means the key can be inlined right there in the descriptor; false means the key is referenced by the descriptor instead. two paths, both valid, choose your fighter πŸ’€
  • plain_keylen β€” size of the key to be loaded by the CAAM.
  • key_cmd_opt β€” optional parameters for the KEY command. optional! but lowkey important.

πŸ’œ SEE ALSO πŸ’œ

go check out the kernel file ./drivers/crypto/caam/desc_constr.h, plus desc_inline_query(9) and append_proto_dkp(9) β€” they're all in the same friend group fr fr 🫢


and that's the whole page bestie 🧚 sign-off time: this lil beauty lives in ./drivers/crypto/caam, dated October 2026, and it's struct alginfo(9) forever and always. periodt. πŸ’–

πŸ“¦ where this page comes from