Lines Matching refs:ndigits
36 const void *value, size_t vlen, unsigned int ndigits) in ecdsa_get_signature_rs() argument
38 size_t keylen = ndigits * sizeof(u64); in ecdsa_get_signature_rs()
71 ecc_swap_digits((u64 *)rs, dest, ndigits); in ecdsa_get_signature_rs()
82 sig->curve->g.ndigits); in ecdsa_get_signature_r()
91 sig->curve->g.ndigits); in ecdsa_get_signature_s()
97 unsigned int ndigits = curve->g.ndigits; in _ecdsa_verify() local
103 struct ecc_point res = ECC_POINT_INIT(x1, y1, ndigits); in _ecdsa_verify()
106 if (vli_is_zero(r, ndigits) || vli_cmp(r, curve->n, ndigits) >= 0 || in _ecdsa_verify()
107 vli_is_zero(s, ndigits) || vli_cmp(s, curve->n, ndigits) >= 0) in _ecdsa_verify()
112 hash[ndigits - 1], hash[ndigits - 2], hash[0]); in _ecdsa_verify()
115 vli_mod_inv(s1, s, curve->n, ndigits); in _ecdsa_verify()
117 vli_mod_mult_slow(u1, hash, s1, curve->n, ndigits); in _ecdsa_verify()
119 vli_mod_mult_slow(u2, r, s1, curve->n, ndigits); in _ecdsa_verify()
124 if (unlikely(vli_cmp(res.x, curve->n, ndigits) == 1)) in _ecdsa_verify()
126 vli_sub(res.x, res.x, curve->n, ndigits); in _ecdsa_verify()
128 if (!vli_cmp(res.x, r, ndigits)) in _ecdsa_verify()
141 size_t keylen = ctx->curve->g.ndigits * sizeof(u64); in ecdsa_verify()
178 ecc_swap_digits((u64 *)rawhash, hash, ctx->curve->g.ndigits); in ecdsa_verify()
213 ctx->curve->g.ndigits); in ecdsa_ecc_ctx_reset()
227 unsigned int ndigits; in ecdsa_set_pub_key() local
241 ndigits = (keylen >> 1) / sizeof(u64); in ecdsa_set_pub_key()
242 if (ndigits != ctx->curve->g.ndigits) in ecdsa_set_pub_key()
245 ecc_swap_digits(digits, ctx->pub_key.x, ndigits); in ecdsa_set_pub_key()
246 ecc_swap_digits(&digits[ndigits], ctx->pub_key.y, ndigits); in ecdsa_set_pub_key()
265 return ctx->pub_key.ndigits << ECC_DIGITS_TO_BYTES_SHIFT; in ecdsa_max_size()