crypto_ecdh_key_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… crypto_ecdh_key_len(9)

okay so bestie, welcome to the Kernel API Manual ✨ this one's a lil baby function but she's lowkey carrying the whole ECDH handshake vibe, so let's give her the main character energy she deserves πŸŽ€


🌸 NAME 🌸

crypto_ecdh_key_len β€” Obtain the size of the private ECDH key πŸ’–

✨ SYNOPSIS ✨

unsigned int crypto_ecdh_key_len (const struct ecdh *params );

like, that's it. that's the whole call. iconic behavior honestly πŸ¦‹

🫢 ARGUMENTS 🫢

  • params β€” your private ECDH key, bestie. that's the struct pointer you're handing over so she can do her little size math πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

so what she does is: this function returns the packet ECDH key size πŸ’« and the way you use it is lowkey genius β€” a caller can take that number, pair it with the ECDH private key reference they already have (params, hiii), and boom πŸ’₯ that's the required memory size to hold a packet key. no guessing, no vibes-based malloc, just the exact amount of memory you need. she ate and left no crumbs fr fr πŸ“

🌈 RETURN 🌈

size of the key in bytes πŸ“βœ¨ (yes, in bytes. keep up bestie πŸ’…)

πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./include/crypto/ecdh.h β€” go read it, it's giving required reading πŸ“š
  • ECDH Helper Functions(9) 🧚
  • struct ecdh(9) πŸ¦‹
  • crypto_ecdh_encode_key(9) πŸ’–
  • crypto_ecdh_decode_key(9) ⭐

ngl bestie, if you're calling this before you allocate your packet key buffer, you're already winning πŸ’…βœ¨

okay that's the whole page!! sending you off with the cutest sign-off ever: this lil beauty lives in ./include/crypto πŸŽ€, she's tagged October 2026 πŸ—“οΈ, and her full glow-up name is crypto_ecdh_key_len(9) πŸ‘‘πŸ’– go forth and compute your key sizes, mwah!! 🫢🌸

πŸ“¦ where this page comes from