STRUCT BLK_CRYPTO_KEY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct blk_crypto_key(9) πŸ’–

okay bestie, so this is struct blk_crypto_key from the struct blk_crypto_key(9) page in the Kernel API Manual β€” it's literally the glow-up guide for an inline encryption key ✨


🌸 SYNOPSIS 🌸

like, here's the whole vibe, character for character:

struct blk_crypto_key {
    struct blk_crypto_config crypto_cfg;
    unsigned int data_unit_size_bits;
    unsigned int size;
    u8 bytes[BLK_CRYPTO_MAX_ANY_KEY_SIZE];
 };

πŸŽ€ Members πŸŽ€

  • crypto_cfg β€” this is the main character energy of the struct ngl πŸ’… it holds the crypto mode, the data unit size, the key type, and all the other little characteristics of this key and how it's gonna be used.
  • data_unit_size_bits β€” bestie this is just log2 of data_unit_size. that's it. that's the whole field. πŸ¦‹
  • size β€” the size of this key in bytes. and okay so for a raw key this is fixed for a given crypto mode, but a hardware-wrapped key can vary in size, so don't go assuming πŸ‘‘
  • bytes β€” the actual bytes of this key, fr fr. only the first size bytes are significant β€” the rest is just... there. πŸ™ˆ

πŸ’œ Description πŸ’œ

so like, a blk_crypto_key is immutable once created β€” no take-backs, no edits, periodt. and many bios can reference it at the same time, which is iconic of it honestly.

⚠️ okay but listen: it must not be freed until all bios using it have completed and it has been evicted from all devices on which it may have been used. that's the rule. don't be the girl who frees it early πŸ˜­πŸ’€

🌈 SEE ALSO 🌈


🫢 and that's the whole page! this one lives in ./include/linux, dated October 2026, and it's filed under struct blk_crypto_key(9). slay, go encrypt something inline βœ¨πŸ’–πŸŽ€

πŸ“¦ where this page comes from