STRUCT SA_ALG_TMPL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to struct sa_alg_tmpl β€” it's literally a generic template that wraps around crypto/aead algorithms πŸ’… one struct to hold 'em all, no cap.

(this is the struct sa_alg_tmpl(9) page from the Kernel API Manual, bestie β€” section 9, we're in the big-leagues part of the docs ✨)


✨ SYNOPSIS ✨

here's the whole vibe, copy it exactly, character for character, because I am not about to let you typo a kernel struct 🫢

struct sa_alg_tmpl {
    u32 type;
    union {
      struct skcipher_alg skcipher;
      struct ahash_alg ahash;
      struct aead_alg aead;
    } alg;
    bool registered;
 };

it's giving "one container, three possible algorithm flavours, and a little flag to remember whether we've registered yet" 😌 iconic honestly.


πŸŽ€ Members πŸŽ€

  • type β€” the type of the crypto algorithm. like, which kind of algorithm are we even talking about here. that's the whole job. keep it πŸ’–
  • alg β€” a union of crypto algorithm definitions. so it's one of skcipher, ahash, or aead β€” the union means those bad boys all share the same space, so only one of them is living there at a time. main character energy, but only one main character ✨
  • registered β€” a flag indicating if the crypto algorithm is already registered. true = we're already in the group chat, false = not yet bestie, hold on 🌈
lowkey important: it's a bool, so don't go stuffing arbitrary numbers in there and expecting the universe to sort it out πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

go read the kernel file ./drivers/crypto/sa2ul.c and then spiral with me through the whole friend group:

  • struct sa_cmdl_cfg(9)
  • struct algo_data(9)
  • struct sa_mapped_sg(9)
  • struct sa_rx_data(9)
  • struct sa_req(9)

that's the whole page bestie, you ate it up πŸ“ the source is in ./drivers/crypto and this drop is dated October 2026 β€” struct sa_alg_tmpl(9), out now, streaming everywhere πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from