Lines Matching refs:curve
70 unsigned int *d, uECC_Curve curve) in uECC_make_key_with_d() argument
82 if (EccPoint_compute_public_key(_public, _private, curve)) { in uECC_make_key_with_d()
86 BITS_TO_BYTES(curve->num_n_bits), in uECC_make_key_with_d()
89 curve->num_bytes, in uECC_make_key_with_d()
91 uECC_vli_nativeToBytes(public_key + curve->num_bytes, in uECC_make_key_with_d()
92 curve->num_bytes, in uECC_make_key_with_d()
93 _public + curve->num_words); in uECC_make_key_with_d()
103 int uECC_make_key(uint8_t *public_key, uint8_t *private_key, uECC_Curve curve) in uECC_make_key() argument
120 uECC_vli_mmod(_private, _random, curve->n, BITS_TO_WORDS(curve->num_n_bits)); in uECC_make_key()
123 if (EccPoint_compute_public_key(_public, _private, curve)) { in uECC_make_key()
127 BITS_TO_BYTES(curve->num_n_bits), in uECC_make_key()
130 curve->num_bytes, in uECC_make_key()
132 uECC_vli_nativeToBytes(public_key + curve->num_bytes, in uECC_make_key()
133 curve->num_bytes, in uECC_make_key()
134 _public + curve->num_words); in uECC_make_key()
146 uint8_t *secret, uECC_Curve curve) in uECC_shared_secret() argument
156 wordcount_t num_words = curve->num_words; in uECC_shared_secret()
157 wordcount_t num_bytes = curve->num_bytes; in uECC_shared_secret()
163 BITS_TO_BYTES(curve->num_n_bits)); in uECC_shared_secret()
173 carry = regularize_k(_private, _private, tmp, curve); in uECC_shared_secret()
178 if (!uECC_generate_random_int(p2[carry], curve->p, num_words)) { in uECC_shared_secret()
185 EccPoint_mult(_public, _public, p2[!carry], initial_Z, curve->num_n_bits + 1, in uECC_shared_secret()
186 curve); in uECC_shared_secret()
189 r = !EccPoint_isZero(_public, curve); in uECC_shared_secret()