ecc_is_key_valid(9)
π ecc_is_key_valid(9) π
okay bestie, welcome to the Kernel API Manual page for ecc_is_key_valid β yes it's a section 9 page, yes it's kernel-internal, and yes we're gonna get into it π
β¨ NAME β¨
ecc_is_key_valid β Validate a given ECDH private key
no like literally that's the whole job, it checks whether your ECDH private key is acceptable, and that's it, that's the function π
πΈ SYNOPSIS πΈ
int ecc_is_key_valid (unsigned int curve_id , unsigned int ndigits ,
const u64 *private_key , unsigned int private_key_len );
look at her, four args, one int return, iconic signature ngl π¦
π«Ά ARGUMENTS π«Ά
curve_idβ id representing the curve to use. it's giving "which curve are we on" energy, you gotta tell it πndigitsβ curve's number of digits. how many digits the curve has, so the function knows how much to look at β¨private_keyβ private key to be used for the given curve. this is the actual secret, handle with care fr fr π₯private_key_lenβ private key length. the length of said private key, so she knows how big it is π
π RETURN π
0 if the key is acceptable β slay, key ate, we're so back π
a negative value otherwise β not slay, key is a no, try again bestie π
π§ SEE ALSO π§
linked from the Kernel file ./include/crypto/internal/ecc.h, and honestly the whole friend group showed up:
ecc_swap_digits(9)ecc_digits_from_bytes(9)ecc_gen_privkey(9)ecc_make_pub_key(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)
heads up bestie: this is kernel-internal stuff from ./include/crypto/internal β it's not some chill userspace API, so don't go calling it from your lil app okay? π
and that's the whole page, no cap π signing off from the ./include/crypto/internal source, October 2026 version β stay valid, stay iconic, 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