crypto_ecdh_decode_key(9)
π crypto_ecdh_decode_key(9) β like, the kernel API manual edition π
okay so bestie, welcome to the crypto_ecdh_decode_key page, straight out of the kernel API manual (section 9, ikyk) β¨ this one's short and sweet and honestly kinda iconic for it.
πΈ NAME πΈ
crypto_ecdh_decode_key β decode a private key π
like... that's the whole vibe. it decodes a private key. no cap.
β¨ SYNOPSIS β¨
int crypto_ecdh_decode_key (const char *buf , unsigned int len , struct
ecdh *p );
three args, one int back, we love a tidy little signature π«Ά
π¦ ARGUMENTS π¦
bufβ the buffer holding a packet key that should be decoded. it's giving "here's the raw material, go off" πlenβ the length of the packet private key buffer. yes, you gotta tell it how bigbufis, don't just hope for the best πpβ a buffer that the caller allocates, and it gets filled with the unpacked ECDH private key. literally you bring the memory, the function does the unpacking π
π DESCRIPTION π
so here's the main character plot twist: the unpacking gets the private key by pointing p to the correct location inside buf. which means both pointers refer to the same memory, fr fr. so like... buf and p are lowkey sharing, okay? no separate copy, no dupe, just vibes and shared memory π§
π₯ RETURN π₯
-EINVALβ if the buffer has insufficient size (aka not enough room, tragic π)0β on success, slay β
π SEE ALSO π
- Kernel file
./include/crypto/ecdh.hβ the source of truth, periodt ECDH Helper Functions(9)struct ecdh(9)crypto_ecdh_key_len(9)crypto_ecdh_encode_key(9)β the other direction, the sibling, the counterpart π
and that's the whole page, bestie π this came to you from ./include/crypto and it's dated October 2026 β the manual page is crypto_ecdh_decode_key(9), and yes, we ate. π
β¨π
π¦ 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