crypto_ecdh_encode_key(9)
π crypto_ecdh_encode_key(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for crypto_ecdh_encode_key, and it's literally the glow-up step where your private key gets turned into its packet form π
πΈ NAME πΈ
crypto_ecdh_encode_key β encode the private key π
β¨ SYNOPSIS β¨
int crypto_ecdh_encode_key (char *buf , unsigned int len , const struct
ecdh *p );
like, that's the whole signature, no cap π«Ά
π¦ ARGUMENTS π¦
bufβ the buffer your caller-self allocated to hold the packet ECDH private key π and listen, it should be at leastcrypto_ecdh_key_lenbytes in size, so don't be out here under-sizing it bestie πlenβ the length of the packet private key buffer πpβ the buffer holding the caller-specified private key π
β DESCRIPTION β
so the tea is: the ECDH implementations operate on a packet representation of the private key π₯ that's it, that's the vibe β this is the function that gets you there π«
π RETURN π
-EINVALβ returned if the buffer has insufficient size π (the vibe check failed, the buffer was too small)0β on success π slay
π SEE ALSO π
- Kernel file
./include/crypto/ecdh.hπ ECDH Helper Functions(9)struct ecdh(9)crypto_ecdh_key_len(9)crypto_ecdh_decode_key(9)β the reverse icon, iykyk π
ngl this one's short and sweet β just make sure your buf is big enough before you call it, fr fr π§
and that's the page!! π from ./include/crypto, October 2026, crypto_ecdh_encode_key(9), Kernel API Manual β mwah, go encode those keys bestie ππ¦β¨
π¦ 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