crypto_dh_decode_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Hey bestie!! Welcome to the crypto_dh_decode_key(9) page from the Kernel API Manual ✨ β€” today we're decoding a private key and it's giving main-character energy πŸ’…

✨ NAME ✨

crypto_dh_decode_key β€” decode a private key πŸŽ€

πŸŽ€ SYNOPSIS πŸŽ€

int crypto_dh_decode_key (const char *buf , unsigned int len , struct dh
       *params );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • buf β€” Buffer holding a packet key that should be decoded. That's the input bestie 🫢
  • len β€” Length of the packet private key buffer. Literally how much buffer you're working with πŸ’œ
  • params β€” Buffer allocated by the caller that is filled with the unpacked DH private key. You bring the buffer, it gets filled ✨

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea: the unpacking obtains the private key by pointing p to the correct location in buf. Thus, both pointers refer to the same memory. No cap, that's the whole vibe β€” they're sharing the same memory space 🫢

πŸ”₯ RETURN πŸ”₯

It hands back -EINVAL if the buffer has insufficient size, and 0 on success. That's the mood 😭

🌈 SEE ALSO 🌈

Kernel file ./include/crypto/dh.h β€” plus DH Helper Functions(9), struct dh(9), crypto_dh_key_len(9), crypto_dh_encode_key(9), and __crypto_dh_decode_key(9). Go read those if you want the full lore πŸ“šπŸ’…


Later, bestie 🫢 β€” this page lives under ./include/crypto and it's the October 2026 version of crypto_dh_decode_key(9). Mwah πŸ’‹

πŸ“¦ where this page comes from