ecc_make_pub_key(9)
π ecc_make_pub_key(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes, the actual kernel API manual, and yes we're about to talk about computing an ECC public key like it's the most iconic thing that's ever happened to us. this page lives in ecc_make_pub_key(9) land and it's short, it's sweet, and it's lowkey carrying half the crypto stack. π
πΈ NAME πΈ
ecc_make_pub_key β compute an ECC public key π
like, that's it. that's the whole gig. you give it a private key, it hands you back the corresponding public key. main character energy fr fr.
π¦ SYNOPSIS π¦
int ecc_make_pub_key (const unsigned int curve_id , unsigned int ndigits
, const u64 *private_key , u64 *public_key );
so the return type is int (we'll get to what it means, don't stress π«Ά), and it takes four things. four! we love a manageable function signature.
β¨ ARGUMENTS β¨
curve_idβ the id representing the curve to use π β like, which elliptic curve are we doing today bestie, pick onendigitsβ the curve's number of digits π’ β how many digits long the curve's numbers are, that's the vibeprivate_keyβ a pregenerated private key for the given curve π β key word pregenerated, meaning it's already been made before you got here, you're not generating it in this functionpublic_keyβ a buffer for storing the generated public key π¦ β this is where the output goes, it's your little gift bag
β RETURN β
0 if the public key was generated successfully π β slay, everything worked.
a negative value if an error occurred π β not slay, but at least it tells you.
ngl, "negative value" is the whole error story here. no fancy named error codes on this page. if it's below zero, something went sideways. periodt. π
π§ SEE ALSO π§
okay this is the group chat of related functions and i'm obsessed with how long this list is:
Kernel file ./include/crypto/internal/ecc.h
ecc_swap_digits(9), ecc_digits_from_bytes(9), ecc_is_key_valid(9), ecc_gen_privkey(9), crypto_ecdh_shared_secret(9), ecc_is_pubkey_valid_partial(9), ecc_is_pubkey_valid_full(9), vli_is_zero(9), vli_cmp(9), vli_sub(9), vli_from_be64(9), vli_from_le64(9), vli_mod_inv(9), vli_mod_mult_slow(9), vli_num_bits(9), ecc_alloc_point(9), ecc_free_point(9), ecc_point_is_zero(9), ecc_point_mult_shamir(9)
like genuinely go read those too, they're all doing their little part π
that's the whole page bestie, you ate it up π β this gem dropped from ./include/crypto/internal in October 2026, 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