Lines Matching refs:ndigits

227 	u32 op_size = (curve->g.ndigits > ECC_CURVE_NIST_P256_DIGITS) ?  in kmb_ecc_point_mult()
229 size_t nbytes = digits_to_bytes(curve->g.ndigits); in kmb_ecc_point_mult()
308 unsigned int ndigits, const u32 inst) in kmb_ecc_do_scalar_op() argument
310 u32 op_size = (ndigits > ECC_CURVE_NIST_P256_DIGITS) ? in kmb_ecc_do_scalar_op()
312 size_t nbytes = digits_to_bytes(ndigits); in kmb_ecc_do_scalar_op()
342 if (vli_is_zero(scalar_out, ndigits)) in kmb_ecc_do_scalar_op()
358 if (WARN_ON(pk->ndigits != curve->g.ndigits)) in kmb_ocs_ecc_is_pubkey_valid_partial()
366 if (vli_cmp(curve->p, pk->x, pk->ndigits) != 1) in kmb_ocs_ecc_is_pubkey_valid_partial()
369 if (vli_cmp(curve->p, pk->y, pk->ndigits) != 1) in kmb_ocs_ecc_is_pubkey_valid_partial()
376 rc = kmb_ecc_do_scalar_op(ecc_dev, yy, pk->y, pk->y, curve, pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
385 rc = kmb_ecc_do_scalar_op(ecc_dev, xxx, pk->x, w, curve, pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
392 pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
399 pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
405 rc = kmb_ecc_do_scalar_op(ecc_dev, w, xxx, w, curve, pk->ndigits, in kmb_ocs_ecc_is_pubkey_valid_partial()
411 rc = vli_cmp(yy, w, pk->ndigits); in kmb_ocs_ecc_is_pubkey_valid_partial()
437 nQ = ecc_alloc_point(pk->ndigits); in kmb_ocs_ecc_is_pubkey_valid_full()
457 size_t ndigits = curve->g.ndigits; in kmb_ecc_is_key_valid() local
461 if (private_key_len != digits_to_bytes(ndigits)) in kmb_ecc_is_key_valid()
468 if (vli_cmp(one, private_key, ndigits) != -1) in kmb_ecc_is_key_valid()
471 vli_sub(res, curve->n, one, ndigits); in kmb_ecc_is_key_valid()
472 vli_sub(res, res, one, ndigits); in kmb_ecc_is_key_valid()
473 if (vli_cmp(res, private_key, ndigits) != 1) in kmb_ecc_is_key_valid()
493 size_t nbytes = digits_to_bytes(curve->g.ndigits); in kmb_ecc_gen_privkey()
498 nbits = vli_num_bits(curve->n, curve->g.ndigits); in kmb_ecc_gen_privkey()
501 if (nbits < 160 || curve->g.ndigits > ARRAY_SIZE(priv)) in kmb_ecc_gen_privkey()
527 ecc_swap_digits(priv, privkey, curve->g.ndigits); in kmb_ecc_gen_privkey()
547 if (params.key_size > digits_to_bytes(tctx->curve->g.ndigits)) { in kmb_ocs_ecdh_set_secret()
564 tctx->curve->g.ndigits); in kmb_ocs_ecdh_set_secret()
586 nbytes = digits_to_bytes(curve->g.ndigits); in kmb_ecc_do_shared_secret()
599 pk = ecc_alloc_point(curve->g.ndigits); in kmb_ecc_do_shared_secret()
603 ecc_swap_digits(pubk_buf, pk->x, curve->g.ndigits); in kmb_ecc_do_shared_secret()
604 ecc_swap_digits(&pubk_buf[curve->g.ndigits], pk->y, curve->g.ndigits); in kmb_ecc_do_shared_secret()
617 result = ecc_alloc_point(pk->ndigits); in kmb_ecc_do_shared_secret()
634 ecc_swap_digits(result->x, shared_secret, result->ndigits); in kmb_ecc_do_shared_secret()
669 pubk_len = 2 * digits_to_bytes(curve->g.ndigits); in kmb_ecc_do_public_key()
671 pk = ecc_alloc_point(curve->g.ndigits); in kmb_ecc_do_public_key()
688 ecc_swap_digits(pk->x, pubk_buf, pk->ndigits); in kmb_ecc_do_public_key()
689 ecc_swap_digits(pk->y, &pubk_buf[pk->ndigits], pk->ndigits); in kmb_ecc_do_public_key()
737 if (req->dst_len < (2 * digits_to_bytes(curve->g.ndigits))) in kmb_ocs_ecdh_generate_public_key()
769 if (req->src_len != 2 * digits_to_bytes(curve->g.ndigits)) in kmb_ocs_ecdh_compute_shared_secret()
821 return digits_to_bytes(tctx->curve->g.ndigits) * 2; in kmb_ocs_ecdh_max_size()