crypto_ecdh_key_len(9)
π 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
- 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