/freebsd/crypto/libecc/src/curves/ |
H A D | prj_pt.c | 51 ret = ec_shortw_crv_check_initialized(curve); EG(ret, err); in prj_pt_init() 55 ret = fp_init(&(in->X), curve->a.ctx); EG(ret, err); in prj_pt_init() 56 ret = fp_init(&(in->Y), curve->a.ctx); EG(ret, err); in prj_pt_init() 57 ret = fp_init(&(in->Z), curve->a.ctx); EG(ret, err); in prj_pt_init() 75 ret = prj_pt_init(in, curve); EG(ret, err); in prj_pt_init_from_coords() 76 ret = fp_copy(&(in->X), xcoord); EG(ret, err); in prj_pt_init_from_coords() 77 ret = fp_copy(&(in->Y), ycoord); EG(ret, err); in prj_pt_init_from_coords() 113 ret = prj_pt_check_initialized(in); EG(ret, err); in prj_pt_iszero() 128 ret = prj_pt_check_initialized(out); EG(ret, err); in prj_pt_zero() 130 ret = fp_zero(&(out->X)); EG(ret, err); in prj_pt_zero() [all …]
|
H A D | aff_pt_edwards.c | 45 ret = ec_edwards_crv_check_initialized(curve); EG(ret, err); in aff_pt_edwards_init() 47 ret = fp_init(&(in->x), curve->a.ctx); EG(ret, err); in aff_pt_edwards_init() 48 ret = fp_init(&(in->y), curve->a.ctx); EG(ret, err); in aff_pt_edwards_init() 69 ret = aff_pt_edwards_init(in, curve); EG(ret, err); in aff_pt_edwards_init_from_coords() 70 ret = fp_copy(&(in->x), xcoord); EG(ret, err); in aff_pt_edwards_init_from_coords() 113 ret = ec_edwards_crv_check_initialized(curve); EG(ret, err); in is_on_edwards_curve() 115 ret = fp_check_initialized(x); EG(ret, err); in is_on_edwards_curve() 116 ret = fp_check_initialized(y); EG(ret, err); in is_on_edwards_curve() 121 ret = fp_init(&x2, x->ctx); EG(ret, err); in is_on_edwards_curve() 122 ret = fp_sqr(&x2, x); EG(ret, err); in is_on_edwards_curve() [all …]
|
H A D | aff_pt_montgomery.c | 41 ret = ec_montgomery_crv_check_initialized(curve); EG(ret, err); in aff_pt_montgomery_init() 43 ret = fp_init(&(in->u), curve->A.ctx); EG(ret, err); in aff_pt_montgomery_init() 44 ret = fp_init(&(in->v), curve->A.ctx); EG(ret, err); in aff_pt_montgomery_init() 65 ret = aff_pt_montgomery_init(in, curve); EG(ret, err); in aff_pt_montgomery_init_from_coords() 66 ret = fp_copy(&(in->u), ucoord); EG(ret, err); in aff_pt_montgomery_init_from_coords() 107 ret = ec_montgomery_crv_check_initialized(curve); EG(ret, err); in is_on_montgomery_curve() 109 ret = fp_check_initialized(u); EG(ret, err); in is_on_montgomery_curve() 110 ret = fp_check_initialized(v); EG(ret, err); in is_on_montgomery_curve() 115 ret = fp_init(&Bv2, v->ctx); EG(ret, err); in is_on_montgomery_curve() 116 ret = fp_sqr(&Bv2, v); EG(ret, err); in is_on_montgomery_curve() [all …]
|
H A D | ec_shortw.c | 47 ret = nn_check_initialized(order); EG(ret, err); in ec_shortw_crv_init() 48 ret = fp_check_initialized(a); EG(ret, err); in ec_shortw_crv_init() 49 ret = fp_check_initialized(b); EG(ret, err); in ec_shortw_crv_init() 54 ret = fp_init(&tmp, a->ctx); EG(ret, err); in ec_shortw_crv_init() 55 ret = fp_init(&tmp2, a->ctx); EG(ret, err); in ec_shortw_crv_init() 56 ret = fp_sqr(&tmp, a); EG(ret, err); in ec_shortw_crv_init() 57 ret = fp_mul(&tmp, &tmp, a); EG(ret, err); in ec_shortw_crv_init() 58 ret = fp_set_word_value(&tmp2, WORD(4)); EG(ret, err); in ec_shortw_crv_init() 59 ret = fp_mul(&tmp, &tmp, &tmp2); EG(ret, err); in ec_shortw_crv_init() 61 ret = fp_set_word_value(&tmp2, WORD(27)); EG(ret, err); in ec_shortw_crv_init() [all …]
|
H A D | aff_pt.c | 46 ret = ec_shortw_crv_check_initialized(curve); EG(ret, err); in aff_pt_init() 47 ret = fp_init(&(in->x), curve->a.ctx); EG(ret, err); in aff_pt_init() 48 ret = fp_init(&(in->y), curve->a.ctx); EG(ret, err); in aff_pt_init() 67 ret = aff_pt_init(in, curve); EG(ret, err); in aff_pt_init_from_coords() 68 ret = fp_copy(&(in->x), xcoord); EG(ret, err); in aff_pt_init_from_coords() 107 ret = ec_shortw_crv_check_initialized(curve); EG(ret, err); in aff_pt_y_from_x() 108 ret = fp_check_initialized(x); EG(ret, err); in aff_pt_y_from_x() 114 ret = fp_copy(y1, x); EG(ret, err); in aff_pt_y_from_x() 115 ret = fp_copy(y2, x); EG(ret, err); in aff_pt_y_from_x() 118 ret = fp_sqr(y1, y1); EG(ret, err); in aff_pt_y_from_x() [all …]
|
H A D | ec_params.c | 40 ret = local_memset(out_params, 0, sizeof(ec_params)); EG(ret, err); in import_params() 47 PARAM_BUF_LEN(in_str_params->p)); EG(ret, err); in import_params() 51 PARAM_BUF_LEN(in_str_params->p_bitlen)); EG(ret, err); in import_params() 54 PARAM_BUF_LEN(in_str_params->r)); EG(ret, err); in import_params() 58 PARAM_BUF_LEN(in_str_params->r_square)); EG(ret, err); in import_params() 62 PARAM_BUF_LEN(in_str_params->mpinv)); EG(ret, err); in import_params() 66 PARAM_BUF_LEN(in_str_params->p_shift)); EG(ret, err); in import_params() 70 PARAM_BUF_LEN(in_str_params->p_normalized)); EG(ret, err); in import_params() 74 PARAM_BUF_LEN(in_str_params->p_reciprocal)); EG(ret, err); in import_params() 81 &tmp_p_normalized, tmp_p_reciprocal.val[0]); EG(ret, err); in import_params() [all …]
|
/freebsd/crypto/libecc/src/fp/ |
H A D | fp_sqrt.c | 36 ret = fp_check_initialized(a); EG(ret, err); in legendre() 37 ret = fp_init(&pow, a->ctx); EG(ret, err); in legendre() 38 ret = fp_init(&one, a->ctx); EG(ret, err); in legendre() 39 ret = nn_init(&exp, 0); EG(ret, err); in legendre() 44 ret = fp_init(&pow, a->ctx); EG(ret, err); in legendre() 45 ret = fp_init(&one, a->ctx); EG(ret, err); in legendre() 46 ret = nn_init(&exp, 0); EG(ret, err); in legendre() 49 ret = fp_one(&one); EG(ret, err); in legendre() 55 ret = nn_dec(&exp, &(a->ctx->p)); EG(ret, err); in legendre() 56 ret = nn_rshift(&exp, &exp, 1); EG(ret, err); in legendre() [all …]
|
H A D | fp.c | 62 ret = nn_check_initialized(p); EG(ret, err); in fp_ctx_init() 63 ret = nn_check_initialized(r); EG(ret, err); in fp_ctx_init() 64 ret = nn_check_initialized(r_square); EG(ret, err); in fp_ctx_init() 65 ret = nn_check_initialized(p_normalized); EG(ret, err); in fp_ctx_init() 67 ret = nn_copy(&(ctx->p), p); EG(ret, err); in fp_ctx_init() 72 ret = nn_copy(&(ctx->p_normalized), p_normalized); EG(ret, err); in fp_ctx_init() 73 ret = nn_copy(&(ctx->r), r); EG(ret, err); in fp_ctx_init() 74 ret = nn_copy(&(ctx->r_square), r_square); EG(ret, err); in fp_ctx_init() 96 ret = nn_check_initialized(p_in); EG(ret, err); in fp_ctx_init_from_p() 98 ret = nn_init(&p, 0); EG(ret, err); in fp_ctx_init_from_p() [all …]
|
/freebsd/crypto/libecc/src/examples/basic/ |
H A D | nn_miller_rabin.c | 55 ret = nn_check_initialized(n); EG(ret, err); in miller_rabin() 60 ret = nn_init(&s, 0); EG(ret, err); in miller_rabin() 61 ret = nn_init(&q, 0); EG(ret, err); in miller_rabin() 62 ret = nn_init(&r, 0); EG(ret, err); in miller_rabin() 63 ret = nn_init(&d, 0); EG(ret, err); in miller_rabin() 64 ret = nn_init(&a, 0); EG(ret, err); in miller_rabin() 65 ret = nn_init(&y, 0); EG(ret, err); in miller_rabin() 66 ret = nn_init(&j, 0); EG(ret, err); in miller_rabin() 67 ret = nn_init(&one, 0); EG(ret, err); in miller_rabin() 68 ret = nn_init(&two, 0); EG(ret, err); in miller_rabin() [all …]
|
H A D | nn_pollard_rho.c | 66 ret = nn_init(&a, 0); EG(ret, err); in pollard_rho() 67 ret = nn_init(&b, 0); EG(ret, err); in pollard_rho() 68 ret = nn_init(&tmp, 0); EG(ret, err); in pollard_rho() 69 ret = nn_init(&one, 0); EG(ret, err); in pollard_rho() 70 ret = nn_init(&c_bignum, 0); EG(ret, err); in pollard_rho() 71 ret = nn_init(d, 0); EG(ret, err); in pollard_rho() 76 ret = nn_zero(d); EG(ret, err); in pollard_rho() 77 ret = nn_one(&one); EG(ret, err); in pollard_rho() 79 ret = nn_set_word_value(&a, WORD(2)); EG(ret, err); in pollard_rho() 80 ret = nn_set_word_value(&b, WORD(2)); EG(ret, err); in pollard_rho() [all …]
|
H A D | curve_basic_examples.c | 57 ret = fp_init(&x, ctx); EG(ret, err); in get_random_point_on_curve() 58 ret = fp_init(&y, ctx); EG(ret, err); in get_random_point_on_curve() 59 ret = fp_init(&fp_tmp1, ctx); EG(ret, err); in get_random_point_on_curve() 60 ret = fp_init(&fp_tmp2, ctx); EG(ret, err); in get_random_point_on_curve() 62 ret = nn_init(&nn_tmp, 0); EG(ret, err); in get_random_point_on_curve() 63 ret = nn_set_word_value(&nn_tmp, WORD(3)); EG(ret, err); in get_random_point_on_curve() 66 ret = fp_get_random(&x, ctx); EG(ret, err); in get_random_point_on_curve() 67 ret = fp_copy(&fp_tmp1, &x); EG(ret, err); in get_random_point_on_curve() 68 ret = fp_copy(&fp_tmp2, &x); EG(ret, err); in get_random_point_on_curve() 70 ret = fp_pow(&fp_tmp1, &fp_tmp1, &nn_tmp); EG(ret, err); in get_random_point_on_curve() [all …]
|
/freebsd/crypto/libecc/src/sig/ |
H A D | eddsa.c | 70 ret = h->hfunc_update(h_ctx, (const u8*)"SigEd25519 no Ed25519 collisions", 32); EG(ret, err); in dom() 73 ret = h->hfunc_update(h_ctx, (const u8*)"SigEd448", 8); EG(ret, err); in dom() 81 ret = h->hfunc_update(h_ctx, tmp, 2); EG(ret, err); in dom() 83 ret = h->hfunc_update(h_ctx, y, olen_y); EG(ret, err); in dom() 195 ret = priv_key_check_initialized(in_priv); EG(ret, err); in eddsa_priv_key_sanity_check() 208 ret = pub_key_check_initialized(in_pub); EG(ret, err); in eddsa_pub_key_sanity_check() 221 ret = eddsa_priv_key_sanity_check(&(key_pair->priv_key)); EG(ret, err); in eddsa_key_pair_sanity_check() 222 ret = eddsa_pub_key_sanity_check(&(key_pair->pub_key)); EG(ret, err); in eddsa_key_pair_sanity_check() 241 ret = nn_init(nn_out, 0); EG(ret, err); in eddsa_decode_integer() 243 ret = local_memset(buf_little_endian, 0, sizeof(buf_little_endian)); EG(ret, err); in eddsa_decode_integer() [all …]
|
H A D | bip0340.c | 54 ret = hash_mapping_callbacks_sanity_check(hm); EG(ret, err); in _bip0340_hash() 56 ret = hm->hfunc_init(h_ctx); EG(ret, err); in _bip0340_hash() 57 ret = hm->hfunc_update(h_ctx, tag, tag_len); EG(ret, err); in _bip0340_hash() 58 ret = hm->hfunc_finalize(h_ctx, hash); EG(ret, err); in _bip0340_hash() 61 ret = hm->hfunc_init(h_ctx); EG(ret, err); in _bip0340_hash() 62 ret = hm->hfunc_update(h_ctx, hash, hm->digest_size); EG(ret, err); in _bip0340_hash() 63 ret = hm->hfunc_update(h_ctx, hash, hm->digest_size); EG(ret, err); in _bip0340_hash() 64 ret = hm->hfunc_update(h_ctx, m, m_len); EG(ret, err); in _bip0340_hash() 81 ret = prj_pt_check_initialized(P); EG(ret, err); in _bip0340_set_scalar() 86 ret = nn_isone(&(P->Z.fp_val), &isone); EG(ret, err); in _bip0340_set_scalar() [all …]
|
H A D | bign_common.c | 165 ret = local_memcpy(&adata[4], oid, oid_len); EG(ret, err); in bign_set_adata() 173 ret = local_memcpy(&adata[4 + oid_len], t, t_len); EG(ret, err); in bign_set_adata() 220 ret = nn_check_initialized(q); EG(ret, err); in __bign_determinitic_nonce() 221 ret = nn_check_initialized(x); EG(ret, err); in __bign_determinitic_nonce() 223 ret = local_memset(theta, 0, sizeof(theta)); EG(ret, err); in __bign_determinitic_nonce() 224 ret = local_memset(FE2OS_D, 0, sizeof(FE2OS_D)); EG(ret, err); in __bign_determinitic_nonce() 225 ret = local_memset(r_bar, 0, sizeof(r_bar)); EG(ret, err); in __bign_determinitic_nonce() 233 ret = bign_get_oid_from_adata(adata, adata_len, &oid_ptr, &oid_len); EG(ret, err); in __bign_determinitic_nonce() 234 ret = bign_get_t_from_adata(adata, adata_len, &t_ptr, &t_len); EG(ret, err); in __bign_determinitic_nonce() 236 ret = belt_hash_init(&belt_hash_ctx); EG(ret, err); in __bign_determinitic_nonce() [all …]
|
H A D | ecfsdsa.c | 40 ret = local_memset(out_pub, 0, sizeof(ec_pub_key)); EG(ret, err); in ecfsdsa_init_pub_key() 42 ret = priv_key_check_initialized_and_type(in_priv, ECFSDSA); EG(ret, err); in ecfsdsa_init_pub_key() 51 ret = prj_pt_mul_blind(&(out_pub->y), &(in_priv->x), G); EG(ret, err); in ecfsdsa_init_pub_key() 134 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecfsdsa_sign_init() 137 ret = local_memset(&kG, 0, sizeof(prj_pt)); EG(ret, err); in _ecfsdsa_sign_init() 140 ret = key_pair_check_initialized_and_type(ctx->key_pair, ECFSDSA); EG(ret, err); in _ecfsdsa_sign_init() 173 ret = ctx->rand(k, q); EG(ret, err); in _ecfsdsa_sign_init() 178 ret = prj_pt_mul_blind(&kG, k, G); EG(ret, err); in _ecfsdsa_sign_init() 180 ret = prj_pt_mul(&kG, k, G); EG(ret, err); in _ecfsdsa_sign_init() 182 ret = prj_pt_unique(&kG, &kG); EG(ret, err); in _ecfsdsa_sign_init() [all …]
|
H A D | ecdsa_common.c | 66 ret = nn_check_initialized(q); EG(ret, err); in __ecdsa_rfc6979_nonce() 67 ret = nn_check_initialized(x); EG(ret, err); in __ecdsa_rfc6979_nonce() 74 ret = local_memset(V, 0x01, hsize); EG(ret, err); in __ecdsa_rfc6979_nonce() 75 ret = local_memset(K, 0x00, hsize); EG(ret, err); in __ecdsa_rfc6979_nonce() 77 ret = nn_export_to_buf(priv_key_buff, q_len, x); EG(ret, err); in __ecdsa_rfc6979_nonce() 81 ret = hmac_init(&hmac_ctx, K, hsize, hash_type); EG(ret, err); in __ecdsa_rfc6979_nonce() 82 ret = hmac_update(&hmac_ctx, V, hsize); EG(ret, err); in __ecdsa_rfc6979_nonce() 85 ret = hmac_update(&hmac_ctx, &tmp, 1); EG(ret, err); in __ecdsa_rfc6979_nonce() 86 ret = hmac_update(&hmac_ctx, priv_key_buff, q_len); EG(ret, err); in __ecdsa_rfc6979_nonce() 89 ret = nn_init_from_buf(k, hash, hsize); EG(ret, err); in __ecdsa_rfc6979_nonce() [all …]
|
H A D | sm2.c | 43 ret = priv_key_check_initialized_and_type(priv_key, SM2); EG(ret, err); in sm2_gen_priv_key() 46 ret = nn_init(&tmp, 0); EG(ret, err); in sm2_gen_priv_key() 47 ret = nn_dec(&tmp, &(priv_key->params->ec_gen_order)); EG(ret, err); in sm2_gen_priv_key() 65 ret = priv_key_check_initialized_and_type(in_priv, SM2); EG(ret, err); in sm2_init_pub_key() 72 ret = nn_init(&tmp, 0); EG(ret, err); in sm2_init_pub_key() 73 ret = nn_dec(&tmp, &in_priv->params->ec_gen_order); EG(ret, err); in sm2_init_pub_key() 81 ret = local_memset(out_pub, 0, sizeof(ec_pub_key)); EG(ret, err); in sm2_init_pub_key() 84 ret = prj_pt_mul_blind(&(out_pub->y), &(in_priv->x), G); EG(ret, err); in sm2_init_pub_key() 152 ret = pub_key_check_initialized_and_type(pub_key, SM2); EG(ret, err); in sm2_compute_Z() 154 ret = get_hash_by_type(hash_type, &hm); EG(ret, err); in sm2_compute_Z() [all …]
|
H A D | eckcdsa.c | 44 ret = priv_key_check_initialized_and_type(in_priv, ECKCDSA); EG(ret, err); in eckcdsa_init_pub_key() 50 ret = local_memset(out_pub, 0, sizeof(ec_pub_key)); EG(ret, err); in eckcdsa_init_pub_key() 60 ret = nn_modinv_fermat(&xinv, &(in_priv->x), q); EG(ret, err); in eckcdsa_init_pub_key() 63 ret = prj_pt_mul_blind(&(out_pub->y), &xinv, G); EG(ret, err); in eckcdsa_init_pub_key() 213 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _eckcdsa_sign_init() 216 ret = key_pair_check_initialized_and_type(ctx->key_pair, ECKCDSA); EG(ret, err); in _eckcdsa_sign_init() 241 ret = prj_pt_to_aff(&y_aff, &(pub_key->y)); EG(ret, err); in _eckcdsa_sign_init() 242 ret = local_memset(tmp_buf, 0, sizeof(tmp_buf)); EG(ret, err); in _eckcdsa_sign_init() 243 ret = fp_export_to_buf(tmp_buf, p_len, &(y_aff.x)); EG(ret, err); in _eckcdsa_sign_init() 244 ret = fp_export_to_buf(tmp_buf + p_len, p_len, &(y_aff.y)); EG(ret, err); in _eckcdsa_sign_init() [all …]
|
H A D | ecrdsa.c | 80 ret = local_memset(out_pub, 0, sizeof(ec_pub_key)); EG(ret, err); in ecrdsa_init_pub_key() 82 ret = priv_key_check_initialized_and_type(in_priv, ECRDSA); EG(ret, err); in ecrdsa_init_pub_key() 91 ret = prj_pt_mul_blind(&(out_pub->y), &(in_priv->x), G); EG(ret, err); in ecrdsa_init_pub_key() 154 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecrdsa_sign_init() 157 ret = key_pair_check_initialized_and_type(ctx->key_pair, ECRDSA); EG(ret, err); in _ecrdsa_sign_init() 166 ret = hash_mapping_callbacks_sanity_check(ctx->h); EG(ret, err); in _ecrdsa_sign_init() 167 ret = ctx->h->hfunc_init(&(ctx->sign_data.ecrdsa.h_ctx)); EG(ret, err); in _ecrdsa_sign_init() 185 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecrdsa_sign_update() 189 ret = hash_mapping_callbacks_sanity_check(ctx->h); EG(ret, err); in _ecrdsa_sign_update() 222 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecrdsa_sign_finalize() [all …]
|
H A D | ecgdsa.c | 42 ret = local_memset(out_pub, 0, sizeof(ec_pub_key)); EG(ret, err); in ecgdsa_init_pub_key() 44 ret = priv_key_check_initialized_and_type(in_priv, ECGDSA); EG(ret, err); in ecgdsa_init_pub_key() 55 ret = nn_modinv_fermat(&xinv, &(in_priv->x), &(in_priv->params->ec_gen_order)); EG(ret, err); in ecgdsa_init_pub_key() 57 ret = prj_pt_mul_blind(&(out_pub->y), &xinv, G); EG(ret, err); in ecgdsa_init_pub_key() 137 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecgdsa_sign_init() 140 ret = key_pair_check_initialized_and_type(ctx->key_pair, ECGDSA); EG(ret, err); in _ecgdsa_sign_init() 149 ret = hash_mapping_callbacks_sanity_check(ctx->h); EG(ret, err); in _ecgdsa_sign_init() 150 ret = ctx->h->hfunc_init(&(ctx->sign_data.ecgdsa.h_ctx)); EG(ret, err); in _ecgdsa_sign_init() 169 ret = sig_sign_check_initialized(ctx); EG(ret, err); in _ecgdsa_sign_update() 174 ret = hash_mapping_callbacks_sanity_check(ctx->h); EG(ret, err); in _ecgdsa_sign_update() [all …]
|
/freebsd/crypto/libecc/src/nn/ |
H A D | nn_modinv.c | 57 ret = nn_init(out, 0); EG(ret, err); in _nn_modinv_odd() 58 ret = nn_init(&a, (u16)(m->wlen * WORD_BYTES)); EG(ret, err); in _nn_modinv_odd() 59 ret = nn_init(&b, (u16)(m->wlen * WORD_BYTES)); EG(ret, err); in _nn_modinv_odd() 60 ret = nn_init(&u, (u16)(m->wlen * WORD_BYTES)); EG(ret, err); in _nn_modinv_odd() 61 ret = nn_init(&mp1d2, (u16)(m->wlen * WORD_BYTES)); EG(ret, err); in _nn_modinv_odd() 65 ret = nn_init(&tmp, (u16)(m->wlen * WORD_BYTES)); EG(ret, err); in _nn_modinv_odd() 82 ret = nn_copy(&a, x); EG(ret, err); in _nn_modinv_odd() 83 ret = nn_set_wlen(&a, m->wlen); EG(ret, err); in _nn_modinv_odd() 84 ret = nn_copy(&b, m); EG(ret, err); in _nn_modinv_odd() 85 ret = nn_one(&u); EG(ret, err); in _nn_modinv_odd() [all …]
|
H A D | nn_mod_pow.c | 49 ret = nn_init(out, 0); EG(ret, err); in _nn_exp_monty_ladder_ltr() 51 ret = nn_init(&T[0], 0); EG(ret, err); in _nn_exp_monty_ladder_ltr() 52 ret = nn_init(&T[1], 0); EG(ret, err); in _nn_exp_monty_ladder_ltr() 53 ret = nn_init(&T[2], 0); EG(ret, err); in _nn_exp_monty_ladder_ltr() 56 ret = nn_get_random_len(&mask, NN_MAX_BYTE_LEN); EG(ret, err); in _nn_exp_monty_ladder_ltr() 58 ret = nn_bitlen(exp, &explen); EG(ret, err); in _nn_exp_monty_ladder_ltr() 68 ret = nn_getbit(&mask, (bitcnt_t)(explen - 1), &rbit); EG(ret, err); in _nn_exp_monty_ladder_ltr() 71 ret = nn_cmp(base, mod, &cmp); EG(ret, err); in _nn_exp_monty_ladder_ltr() 74 ret = nn_mod(&T[rbit], base, mod); EG(ret, err); in _nn_exp_monty_ladder_ltr() 77 ret = nn_mul_redc1(&T[rbit], &T[rbit], r_square, mod, mpinv); EG(ret, err); in _nn_exp_monty_ladder_ltr() [all …]
|
/freebsd/crypto/libecc/src/examples/hash/ |
H A D | hash.c | 150 ret = get_hash_by_type(htype, hm); EG(ret, err); in get_libecc_hash() 151 ret = get_hash_sizes(htype, hlen, block_size); EG(ret, err); in get_libecc_hash() 224 … ret = get_libecc_hash(gen_hash_type, &hash_type, &hm, hlen, block_size); EG(ret, err); in gen_hash_get_hash_sizes() 239 ret = md2_scattered(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 243 ret = md4_scattered(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 247 ret = md5_scattered(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 251 ret = sha0_scattered(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 255 ret = sha1_scattered(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 259 ret = mdc2_scattered_padding1(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() 263 ret = mdc2_scattered_padding2(input, ilen, digest); EG(ret, err); in gen_hash_hfunc_scattered() [all …]
|
/freebsd/crypto/libecc/src/examples/sig/common/ |
H A D | common.h | 16 ret = nn_check_initialized(x); EG(ret, err); in _i2osp() 21 ret = nn_bitlen(x, &blen); EG(ret, err); in _i2osp() 97 ret = nn_check_initialized(m); EG(ret, err); in _fix_scalar_msb() 98 ret = nn_check_initialized(q); EG(ret, err); in _fix_scalar_msb() 99 ret = nn_check_initialized(m_msb_fixed); EG(ret, err); in _fix_scalar_msb() 101 ret = nn_init(&q_square, 0); EG(ret, err); in _fix_scalar_msb() 102 ret = nn_init(&_m_msb_fixed, 0); EG(ret, err); in _fix_scalar_msb() 105 ret = nn_sqr(&q_square, q); EG(ret, err); in _fix_scalar_msb() 107 ret = nn_cmp(m, q, &cmp); EG(ret, err); in _fix_scalar_msb() 112 ret = nn_add(&_m_msb_fixed, m, q); EG(ret, err); in _fix_scalar_msb() [all …]
|
/freebsd/crypto/libecc/src/examples/sig/rsa/ |
H A D | rsa.c | 89 ret = nn_init_from_buf(&(pub->n), n, nlen); EG(ret, err); in rsa_import_pub_key() 113 ret = nn_init_from_buf(&(priv->key.s.n), n, nlen); EG(ret, err); in rsa_import_simple_priv_key() 114 ret = nn_init_from_buf(&(priv->key.s.d), d, dlen); EG(ret, err); in rsa_import_simple_priv_key() 118 ret = nn_init_from_buf(&(priv->key.s_pq.n), n, nlen); EG(ret, err); in rsa_import_simple_priv_key() 119 ret = nn_init_from_buf(&(priv->key.s_pq.d), d, dlen); EG(ret, err); in rsa_import_simple_priv_key() 120 ret = nn_init_from_buf(&(priv->key.s_pq.p), p, plen); EG(ret, err); in rsa_import_simple_priv_key() 121 ret = nn_init_from_buf(&(priv->key.s_pq.q), q, qlen); EG(ret, err); in rsa_import_simple_priv_key() 146 ret = nn_init_from_buf(&(priv->key.crt.p), p, plen); EG(ret, err); in rsa_import_crt_priv_key() 147 ret = nn_init_from_buf(&(priv->key.crt.q), q, qlen); EG(ret, err); in rsa_import_crt_priv_key() 148 ret = nn_init_from_buf(&(priv->key.crt.dP), dP, dPlen); EG(ret, err); in rsa_import_crt_priv_key() [all …]
|