blk_crypto_derive_sw_secret(9)
π NAME π
okay so this is the blk_crypto_derive_sw_secret(9) manual page, bestie, and it's the kernel API entry for deriving a software secret from a wrapped key. That's the whole vibe: hardware-wrapped key goes in, software secret comes out, no cap. β¨
π οΈ SYNOPSIS π οΈ
int blk_crypto_derive_sw_secret (struct block_device *bdev , const u8
*eph_key , size_t eph_key_size , u8 sw_secret[BLK_CRYPTO_SW_SECRET_SIZE]
);
π ARGUMENTS π
bdevβ a block device that supports hardware-wrapped keys. Like, it has to have the hardware-wrapped-key glow-up already, okay?eph_keyβ a hardware-wrapped key in ephemerally-wrapped form. This is the same form it's used in for I/O, iykyk.eph_key_sizeβ size ofeph_keyin bytes.sw_secretβ (output) the software secret. This is where the derived secret lands, bestie.
πΈ DESCRIPTION πΈ
Given a hardware-wrapped key in ephemerally-wrapped form β the same form that it is used for I/O β you ask the hardware to derive the secret which software can use for cryptographic tasks other than inline encryption. It's giving βhardware does the secret math, software gets a safe little secret for other stuff.β π¦
This secret is guaranteed to be cryptographically isolated from the inline encryption key, i.e. derived with a different KDF context. No cap, that isolation is the whole point: different KDF context, separate secret vibe. π₯
π RETURN π
0on success. Slay.-EOPNOTSUPPif the block device doesn't support hardware-wrapped keys.-EBADMSGif the key isn't a valid ephemerally-wrapped key.- or another
-errnocode.
bestie, keep these return codes in mind:0,-EOPNOTSUPP,-EBADMSG, or another-errnocode. That's the contract. π
π SEE ALSO π
Kernel file: ./block/blk-crypto-profile.c
blk-crypto profiles(9)blk_crypto_profile_init(9)devm_blk_crypto_profile_init(9)blk_crypto_keyslot_index(9)blk_crypto_get_keyslot(9)blk_crypto_put_keyslot(9)blk_crypto_reprogram_all_keys(9)blk_crypto_intersect_capabilities(9)blk_crypto_has_capabilities(9)blk_crypto_update_capabilities(9)
these are the supporting cast, go read them too π«Ά
Bye bestie! π This page's source/version is ./block, dated October 2026, and the manual name is blk_crypto_derive_sw_secret(9) β periodt. π
π¦ 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