blk_crypto_derive_sw_secret(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 of eph_key in 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 πŸ‘‘

  • 0 on success. Slay.
  • -EOPNOTSUPP if the block device doesn't support hardware-wrapped keys.
  • -EBADMSG if the key isn't a valid ephemerally-wrapped key.
  • or another -errno code.
bestie, keep these return codes in mind: 0, -EOPNOTSUPP, -EBADMSG, or another -errno code. That's the contract. πŸ’…

🌈 SEE ALSO 🌈

Kernel file: ./block/blk-crypto-profile.c

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