crypto_dh_key_len(9)
β¨ crypto_dh_key_len(9) β kernel API manual energy β¨
okay so bestie, we're in the <pink>Kernel API Manual</pink> today and this one is a little one-shot function that tells you how much memory a private DH key is gonna need. no cap, it's tiny but iconic π
πΈ NAME πΈ
crypto_dh_key_len β obtain the size of the private DH key
π SYNOPSIS π
unsigned int crypto_dh_key_len (const struct dh *params );
π¦ ARGUMENTS π¦
paramsβ the private DH key, bestie. that's the one and only thing you're handing over π«Ά
π DESCRIPTION π
so this function literally just returns the <cyan>packet DH key size</cyan>. that's the vibe.
a caller can take that size, pair it with the DH private key reference you already have, and boom β you know the required memory size to hold a packet key β¨ it's giving "measure twice, allocate once" honestly π
π₯ RETURN π₯
size of the key in bytes. that's it, that's the whole tea β (unsigned int, for the record π)
π SEE ALSO π
- Kernel file
./include/crypto/dh.hDH Helper Functions(9) struct dh(9)crypto_dh_encode_key(9)crypto_dh_decode_key(9)__crypto_dh_decode_key(9)
ngl if you're poking around this family of functions, the whole DH helper squad above is your group chat β go say hi π
and that's the page, bestie! slay π
this little gem lives over in ./include/crypto and the source/version stamp on it is October 2026 π so cute, so on-brand, 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