STRUCT BLK_CRYPTO_KEY(9)
π 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 justlog2ofdata_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 firstsizebytes 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 π
- Kernel file
./include/linux/blk-crypto.h struct blk_crypto_config(9)struct bio_crypt_ctx(9)blk_crypto_submit_bio(9)bio_crypt_clone(9)
π«Ά 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms