STRUCT BLK_CRYPTO_PROFILE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so bestie, welcome to the kernel API manual, and today's main character is struct blk_crypto_profile β€” literally the inline encryption profile for a device. yes. we're doing cryptography. put your hair up, we're getting into it πŸŽ€


✨ NAME ✨

struct blk_crypto_profile β€” inline encryption profile for a device πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct blk_crypto_profile {
    struct blk_crypto_ll_ops ll_ops;
    unsigned int max_dun_bytes_supported;
    unsigned int key_types_supported;
    unsigned int modes_supported[BLK_ENCRYPTION_MODE_MAX];
    struct device *dev;
 };

like, that's the whole vibe of it. five fields. she's compact. she's iconic. πŸ‘‘


🌸 Members 🌸

  • ll_ops β€” these are the driver-provided functions that control the inline encryption hardware β€” think programming keys and evicting keys. your driver brings the moves, this field holds them. 🫢
  • max_dun_bytes_supported β€” the maximum number of bytes supported for specifying the data unit number (DUN). and specifically, the range of supported DUNs is 0 through (1 << (8 * max_dun_bytes_supported)) - 1. math is math, bestie, don't fight it. πŸ”₯
  • key_types_supported β€” a bitmask of the supported key types: BLK_CRYPTO_KEY_TYPE_RAW and/or BLK_CRYPTO_KEY_TYPE_HW_WRAPPED. bitmask girlies rise 🌈
  • modes_supported β€” array of bitmasks that specifies whether each combination of crypto mode and data unit size is supported. specifically, the i'th bit of modes_supported[crypto_mode] is set if crypto_mode can be used with a data unit size of (1 << i). and note that only data unit sizes that are powers of 2 can be supported ✨ (so like, don't come at her with 3, she will not be entertaining it πŸ’€)
  • dev β€” an optional device for runtime power management. and if the driver provides this device, it will be runtime-resumed before any function in ll_ops is called, and will remain resumed during the call. she wakes up for the function call and stays up through the whole thing β€” main character energy fr fr 😭

πŸ’œ Description πŸ’œ

so what's actually in here? this struct contains three-ish things, and they're all doing their own little job:

  • a storage device's inline encryption capabilities (e.g. the supported crypto algorithms)
  • driver-provided functions to control the inline encryption hardware (e.g. programming and evicting keys)
  • optional device-independent keyslot management data

that's the whole package. capabilities, control functions, and the optional keyslot-management situation. slay 🧚


⭐ SEE ALSO ⭐

  • Kernel file ./include/linux/blk-crypto-profile.h
  • struct blk_crypto_ll_ops(9)

lowkey a reminder: keep the fields exactly as they are up there in the synopsis, BLK_ENCRYPTION_MODE_MAX included, because that array size is not vibes-based, it's real πŸ’€

aaaand that's the page!! this whole thing lives in ./include/linux, from the October 2026 Kernel API Manual, and it's all about struct blk_crypto_profile(9). go forth and encrypt inline, bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from