Home
last modified time | relevance | path

Searched refs:fp_val (Results 1 – 25 of 27) sorted by relevance

12

/freebsd/crypto/libecc/src/fp/
H A Dfp_add.c36 SHOULD_HAVE(!nn_cmp(&in1->fp_val, &(in1->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_add()
37 SHOULD_HAVE(!nn_cmp(&in2->fp_val, &(in2->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_add()
39 ret = nn_mod_add(&(out->fp_val), &(in1->fp_val), in fp_add()
40 &(in2->fp_val), &(in1->ctx->p)); in fp_add()
61 SHOULD_HAVE(!nn_cmp(&in->fp_val, &(in->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_inc()
63 ret = nn_mod_inc(&(out->fp_val), &(in->fp_val), &(in->ctx->p)); in fp_inc()
86 SHOULD_HAVE(!nn_cmp(&in1->fp_val, &(in1->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_sub()
87 SHOULD_HAVE(!nn_cmp(&in2->fp_val, &(in2->ctx->p), &cmp) && (cmp < 0), ret, err); in fp_sub()
89 ret = nn_mod_sub(&(out->fp_val), &(in1->fp_val), in fp_sub()
90 &(in2->fp_val), &(in1->ctx->p)); in fp_sub()
[all …]
H A Dfp.c157 ret = nn_init(&(in->fp_val), (u16)((fpctx->p.wlen) * WORD_BYTES)); EG(ret, err); in fp_init()
192 nn_uninit(&in->fp_val); in fp_uninit()
212 ret = nn_copy(&(out->fp_val), in); EG(ret, err); in fp_set_nn()
213 ret = nn_cmp(&(out->fp_val), &(out->ctx->p), &cmp); EG(ret, err); in fp_set_nn()
218 ret = nn_set_wlen(&(out->fp_val), out->ctx->p.wlen); in fp_set_nn()
233 ret = nn_set_word_value(&(out->fp_val), 0); EG(ret, err); in fp_zero()
235 ret = nn_set_wlen(&(out->fp_val), out->ctx->p.wlen); in fp_zero()
256 ret = nn_set_word_value(&(out->fp_val), val); EG(ret, err); in fp_one()
259 ret = nn_set_wlen(&(out->fp_val), out->ctx->p.wlen); in fp_one()
277 ret = nn_set_word_value(&(out->fp_val), val); EG(ret, err); in fp_set_word_value()
[all …]
H A Dfp_mul_redc1.c50 ret = _fp_mul_redc1(&(out->fp_val), &(in1->fp_val), &(in2->fp_val), in fp_mul_redc1()
83 ret = _fp_mul_redc1(&(out->fp_val), &(in->fp_val), &(out->ctx->r_square), in fp_redcify()
106 ret = _fp_mul_redc1(&(out->fp_val), &(in->fp_val), &one, out->ctx); in fp_unredcify()
H A Dfp_mul.c41 ret = nn_mul(&(out->fp_val), &(in1->fp_val), &(in2->fp_val)); EG(ret, err); in fp_mul()
42 ret = nn_mod_unshifted(&(out->fp_val), &(out->fp_val), &(in1->ctx->p_normalized), in fp_mul()
79 …ret = nn_modinv_fermat_redc(&(out->fp_val), &(in->fp_val), &(in->ctx->p), &(in->ctx->r), &(in->ctx… in fp_inv()
95 ret = nn_modinv_word(&(out->fp_val), w, &(out->ctx->p)); in fp_inv_word()
H A Dfp_pow.c31 …return nn_mod_pow_redc(&(out->fp_val), &(base->fp_val), exp, &(out->ctx->p), &(out->ctx->r), &(out… in _fp_pow()
H A Dfp_rand.c30 ret = nn_get_random_mod(&(out->fp_val), &(ctx->p)); in fp_get_random()
/freebsd/crypto/libecc/src/utils/
H A Dprint_curves.c37 nn_print("x", &(y_aff.x.fp_val)); in ec_point_print()
39 nn_print("y", &(y_aff.y.fp_val)); in ec_point_print()
54 nn_print("u", &(pt->u.fp_val)); in ec_montgomery_point_print()
56 nn_print("v", &(pt->v.fp_val)); in ec_montgomery_point_print()
70 nn_print("x", &(pt->x.fp_val)); in ec_edwards_point_print()
72 nn_print("y", &(pt->y.fp_val)); in ec_edwards_point_print()
H A Dprint_fp.c45 nn_print(msg, &(a->fp_val)); in fp_print()
60 nn_print("\t fp_val", &(a->fp_val)); in fp_print_all()
/freebsd/crypto/libecc/src/sig/
H A Dfuzzing_ecgdsa.c165 dbg_nn_print("W_x", &(kG.X.fp_val)); in ecgdsa_sign_raw()
166 dbg_nn_print("W_y", &(kG.Y.fp_val)); in ecgdsa_sign_raw()
169 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in ecgdsa_sign_raw()
346 dbg_nn_print("W'_x", &(Wprime->X.fp_val)); in ecgdsa_verify_raw()
347 dbg_nn_print("W'_y", &(Wprime->Y.fp_val)); in ecgdsa_verify_raw()
348 ret = nn_mod(&r_prime, &(Wprime->X.fp_val), q); EG(ret, err); in ecgdsa_verify_raw()
H A Dfuzzing_ecdsa.c166 dbg_nn_print("W_x", &(kG.X.fp_val)); in ecdsa_sign_raw()
167 dbg_nn_print("W_y", &(kG.Y.fp_val)); in ecdsa_sign_raw()
170 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in ecdsa_sign_raw()
389 dbg_nn_print("W'_x", &(W_prime->X.fp_val)); in ecdsa_verify_raw()
390 dbg_nn_print("W'_y", &(W_prime->Y.fp_val)); in ecdsa_verify_raw()
391 ret = nn_mod(&r_prime, &(W_prime->X.fp_val), q); EG(ret, err); in ecdsa_verify_raw()
H A Dfuzzing_ecrdsa.c167 dbg_nn_print("W_x", &(kG.X.fp_val)); in ecrdsa_sign_raw()
168 dbg_nn_print("W_y", &(kG.Y.fp_val)); in ecrdsa_sign_raw()
171 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in ecrdsa_sign_raw()
378 dbg_nn_print("W'_x", &(Wprime->X.fp_val)); in ecrdsa_verify_raw()
379 dbg_nn_print("W'_y", &(Wprime->Y.fp_val)); in ecrdsa_verify_raw()
382 ret = nn_mod(&r_prime, &(Wprime->X.fp_val), q); EG(ret, err); in ecrdsa_verify_raw()
H A Decrdsa.c281 dbg_nn_print("W_x", &(kG.X.fp_val)); in _ecrdsa_sign_finalize()
282 dbg_nn_print("W_y", &(kG.Y.fp_val)); in _ecrdsa_sign_finalize()
285 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in _ecrdsa_sign_finalize()
577 dbg_nn_print("W'_x", &(Wprime->X.fp_val)); in _ecrdsa_verify_finalize()
578 dbg_nn_print("W'_y", &(Wprime->Y.fp_val)); in _ecrdsa_verify_finalize()
581 ret = nn_mod(&r_prime, &(Wprime->X.fp_val), q); EG(ret, err); in _ecrdsa_verify_finalize()
H A Decgdsa.c304 dbg_nn_print("W_x", &(kG.X.fp_val)); in _ecgdsa_sign_finalize()
305 dbg_nn_print("W_y", &(kG.Y.fp_val)); in _ecgdsa_sign_finalize()
308 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in _ecgdsa_sign_finalize()
579 dbg_nn_print("W'_x", &(Wprime->X.fp_val)); in _ecgdsa_verify_finalize()
580 dbg_nn_print("W'_y", &(Wprime->Y.fp_val)); in _ecgdsa_verify_finalize()
581 ret = nn_mod(&r_prime, &(Wprime->X.fp_val), q); EG(ret, err); in _ecgdsa_verify_finalize()
H A Dbip0340.c86 ret = nn_isone(&(P->Z.fp_val), &isone); EG(ret, err); in _bip0340_set_scalar()
90 ret = nn_isodd(&(P->Y.fp_val), &isodd); EG(ret, err); in _bip0340_set_scalar()
326 dbg_nn_print("r", &(kG.X.fp_val)); in _bip0340_sign()
433 dbg_nn_print("r", &(rx->fp_val)); in _bip0340_verify_init()
543 ret = nn_isodd(&(Y.Y.fp_val), &isodd); EG(ret, err); in _bip0340_verify_finalize()
559 ret = nn_isodd(&(sG.Y.fp_val), &isodd); EG(ret, err); in _bip0340_verify_finalize()
563 ret = nn_cmp(&(r->fp_val), &(sG.X.fp_val), &cmp); EG(ret, err); in _bip0340_verify_finalize()
923 dbg_nn_print("r", &(rx.fp_val)); in _bip0340_verify_batch_no_memory()
940 ret = nn_isodd(&(R->Y.fp_val), &isodd); EG(ret, err); in _bip0340_verify_batch_no_memory()
962 ret = nn_isodd(&(Y->Y.fp_val), &isodd); EG(ret, err); in _bip0340_verify_batch_no_memory()
[all …]
H A Dsm2.c389 dbg_nn_print("W_x", &(kG.X.fp_val)); in _sm2_sign_finalize()
390 dbg_nn_print("W_y", &(kG.Y.fp_val)); in _sm2_sign_finalize()
396 ret = nn_add(&tmp2, &tmp, &(kG.X.fp_val)); EG(ret, err); in _sm2_sign_finalize()
680 dbg_nn_print("W'_x", &(W_prime->X.fp_val)); in _sm2_verify_finalize()
681 dbg_nn_print("W'_y", &(W_prime->Y.fp_val)); in _sm2_verify_finalize()
684 ret = nn_mod(&r_prime, &(W_prime->X.fp_val), q); EG(ret, err); in _sm2_verify_finalize()
H A Decdsa_common.c483 dbg_nn_print("W_x", &(kG.X.fp_val)); in __ecdsa_sign_finalize()
484 dbg_nn_print("W_y", &(kG.Y.fp_val)); in __ecdsa_sign_finalize()
487 ret = nn_mod(&r, &(kG.X.fp_val), q); EG(ret, err); in __ecdsa_sign_finalize()
804 dbg_nn_print("W'_x", &(W_prime->X.fp_val)); in __ecdsa_verify_finalize()
805 dbg_nn_print("W'_y", &(W_prime->Y.fp_val)); in __ecdsa_verify_finalize()
806 ret = nn_mod(&r_prime, &(W_prime->X.fp_val), q); EG(ret, err); in __ecdsa_verify_finalize()
H A Deckcdsa.c402 dbg_nn_print("W_x", &(kG.X.fp_val)); in _eckcdsa_sign_finalize()
403 dbg_nn_print("W_y", &(kG.Y.fp_val)); in _eckcdsa_sign_finalize()
774 dbg_nn_print("W'_x", &(Wprime->X.fp_val)); in _eckcdsa_verify_finalize()
775 dbg_nn_print("W'_y", &(Wprime->Y.fp_val)); in _eckcdsa_verify_finalize()
H A Decsdsa_common.c200 dbg_nn_print("W_x", &(kG.X.fp_val)); in __ecsdsa_sign_init()
201 dbg_nn_print("W_y", &(kG.Y.fp_val)); in __ecsdsa_sign_init()
H A Dbign_common.c623 dbg_nn_print("W_x", &(kG.X.fp_val)); in __bign_sign_finalize()
624 dbg_nn_print("W_y", &(kG.Y.fp_val)); in __bign_sign_finalize()
/freebsd/crypto/libecc/src/curves/
H A Dprj_pt.c292 ret = nn_one(&(out->Z).fp_val); /* Z = 1 */ in ec_shortw_aff_to_prj()
1423 ret = nn_copy(&(T[rbit_next].X.fp_val), &(T[mbit ^ rbit].X.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_dbl_add_always()
1424 ret = nn_copy(&(T[rbit_next].Y.fp_val), &(T[mbit ^ rbit].Y.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_dbl_add_always()
1425 ret = nn_copy(&(T[rbit_next].Z.fp_val), &(T[mbit ^ rbit].Z.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_dbl_add_always()
1546 ret = nn_cnd_swap(!mbit, &(out->X.fp_val), &(dbl.X.fp_val)); EG(ret, err2); in _prj_pt_mul_ltr_monty_dbl_add_always()
1547 ret = nn_cnd_swap(!mbit, &(out->Y.fp_val), &(dbl.Y.fp_val)); EG(ret, err2); in _prj_pt_mul_ltr_monty_dbl_add_always()
1548 ret = nn_cnd_swap(!mbit, &(out->Z.fp_val), &(dbl.Z.fp_val)); EG(ret, err2); in _prj_pt_mul_ltr_monty_dbl_add_always()
1688 ret = nn_copy(&(T[0].X.fp_val), &(T[2-(mbit ^ rbit_next)].X.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_ladder()
1689 ret = nn_copy(&(T[0].Y.fp_val), &(T[2-(mbit ^ rbit_next)].Y.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_ladder()
1690 ret = nn_copy(&(T[0].Z.fp_val), &(T[2-(mbit ^ rbit_next)].Z.fp_val)); EG(ret, err); in _prj_pt_mul_ltr_monty_ladder()
[all …]
/freebsd/crypto/libecc/src/arithmetic_tests/
H A Darithmetic_tests_generator.py1883 fp_val = get_random_bigint(wlen, MAX_INPUT_PARAM_WLEN) % nn_p
1886 fp_exp_res = pow(fp_val, nn_exp, nn_p)
1889 …text(nn_p, wlen), format_int_string(fp_exp_res, wlen), format_int_string(fp_val, wlen), format_int…
1902 fp_val = get_random_bigint(wlen, MAX_INPUT_PARAM_WLEN) % nn_p
1905 fp_sqrt1 = mod_sqrt(fp_val, nn_p)
1912 …_int_string(fp_sqrt1, wlen), format_int_string(fp_sqrt2, wlen), format_int_string(fp_val, wlen), 0)
1914 …wlen), format_int_string(0, wlen), format_int_string(0, wlen), format_int_string(fp_val, wlen), -1)
H A Darithmetic_tests.c418 nn_print(&(parameters_string_names[str_pos]), &(FP_T_GENERIC_IN(j)->fp_val)); \
447 nn_print(real_modified_string_names, &(fp_out_ptr[j]->fp_val)); \
448 nn_print(expected_modified_string_names, &(FP_T_GENERIC_IN(j)->fp_val)); \
531 n_len = (FP_T_GENERIC_IN(i))->fp_val.wlen;\
1137 tmp = &(fp_tmp->fp_val); in main()
/freebsd/crypto/libecc/include/libecc/fp/
H A Dfp.h74 nn fp_val; member
/freebsd/crypto/libecc/src/examples/basic/
H A Dfp_square_residue.c73 nn_print("x^2", &(x.fp_val)); in main()
/freebsd/crypto/libecc/src/ecdh/
H A Dx25519_448.c208 v_coord_nn = &(v_coord->fp_val); in x25519_448_core()

12