Home
last modified time | relevance | path

Searched refs:CRYPT_OK (Results 1 – 25 of 262) sorted by relevance

1234567891011

/external/dropbear/libtomcrypt/src/pk/ecc/
Dltc_ecc_projective_add_point.c46 if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) { in ltc_ecc_projective_add_point()
51 if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
60 if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
61 if ((err = mp_copy(P->y, y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
62 if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
67 if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
68 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
70 if ((err = mp_mul(t1, x, x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
71 if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
73 if ((err = mp_mul(Q->z, t1, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point()
[all …]
Dltc_ecc_projective_dbl_point.c44 if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { in ltc_ecc_projective_dbl_point()
49 if ((err = mp_copy(P->x, R->x)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
50 if ((err = mp_copy(P->y, R->y)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
51 if ((err = mp_copy(P->z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
55 if ((err = mp_sqr(R->z, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
56 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
58 if ((err = mp_mul(R->z, R->y, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
59 if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
61 if ((err = mp_add(R->z, R->z, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
63 if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point()
[all …]
Dltc_ecc_mulmod.c53 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mulmod()
56 if ((err = mp_init(&mu)) != CRYPT_OK) { in ltc_ecc_mulmod()
60 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mulmod()
85 if ((err = mp_copy(G->x, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
86 if ((err = mp_copy(G->y, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
87 if ((err = mp_copy(G->z, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
89 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
90 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
91 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
98 if ((err = ltc_mp.ecc_ptdbl(tG, M[0], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
[all …]
Decc_verify_hash.c70 if ((err = mp_init_multi(&r, &s, &v, &w, &u1, &u2, &p, &e, &m, NULL)) != CRYPT_OK) { in ecc_verify_hash()
86 LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { in ecc_verify_hash()
91 …if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) … in ecc_verify_hash()
94 …if ((err = mp_read_radix(m, (char *)key->dp->prime, 16)) != CRYPT_OK) … in ecc_verify_hash()
103 …if ((err = mp_read_unsigned_bin(e, (unsigned char *)hash, (int)hashlen)) != CRYPT_OK) … in ecc_verify_hash()
106 …if ((err = mp_invmod(s, p, w)) != CRYPT_OK) … in ecc_verify_hash()
109 …if ((err = mp_mulmod(e, w, p, u1)) != CRYPT_OK) … in ecc_verify_hash()
112 …if ((err = mp_mulmod(r, w, p, u2)) != CRYPT_OK) … in ecc_verify_hash()
115 …if ((err = mp_read_radix(mG->x, (char *)key->dp->Gx, 16)) != CRYPT_OK) … in ecc_verify_hash()
116 …if ((err = mp_read_radix(mG->y, (char *)key->dp->Gy, 16)) != CRYPT_OK) … in ecc_verify_hash()
[all …]
Decc_import.c31 if ((err = mp_init_multi(&prime, &b, &t1, &t2, NULL)) != CRYPT_OK) { in is_point()
36 …if ((err = mp_read_radix(prime, key->dp->prime, 16)) != CRYPT_OK) { goto … in is_point()
37 …if ((err = mp_read_radix(b, key->dp->B, 16)) != CRYPT_OK) { goto … in is_point()
40 …if ((err = mp_sqr(key->pubkey.y, t1)) != CRYPT_OK) { goto … in is_point()
43 …if ((err = mp_sqr(key->pubkey.x, t2)) != CRYPT_OK) { goto … in is_point()
44 …if ((err = mp_mod(t2, prime, t2)) != CRYPT_OK) { goto … in is_point()
45 …if ((err = mp_mul(key->pubkey.x, t2, t2)) != CRYPT_OK) { goto … in is_point()
48 …if ((err = mp_sub(t1, t2, t1)) != CRYPT_OK) { goto … in is_point()
51 …if ((err = mp_add(t1, key->pubkey.x, t1)) != CRYPT_OK) { goto … in is_point()
52 …if ((err = mp_add(t1, key->pubkey.x, t1)) != CRYPT_OK) { goto … in is_point()
[all …]
Dltc_ecc_mulmod_timing.c51 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mulmod()
54 if ((err = mp_init(&mu)) != CRYPT_OK) { in ltc_ecc_mulmod()
58 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mulmod()
82 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
83 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
84 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
90 if ((err = mp_copy(tG->x, M[0]->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
91 if ((err = mp_copy(tG->y, M[0]->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
92 if ((err = mp_copy(tG->z, M[0]->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
94 if ((err = ltc_mp.ecc_ptdbl(tG, M[1], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod()
[all …]
Dltc_ecc_map.c42 if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { in ltc_ecc_map()
47 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
50 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
53 if ((err = mp_sqr(t1, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
54 if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
55 if ((err = mp_mul(t1, t2, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
56 if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
59 if ((err = mp_mul(P->x, t2, P->x)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
60 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
61 if ((err = mp_mul(P->y, t1, P->y)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
[all …]
Dltc_ecc_mul2add.c97 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mul2add()
100 if ((err = mp_init(&mu)) != CRYPT_OK) { in ltc_ecc_mul2add()
103 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mul2add()
108 …if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) … in ltc_ecc_mul2add()
109 …if ((err = mp_mulmod(A->y, mu, modulus, precomp[1]->y)) != CRYPT_OK) … in ltc_ecc_mul2add()
110 …if ((err = mp_mulmod(A->z, mu, modulus, precomp[1]->z)) != CRYPT_OK) … in ltc_ecc_mul2add()
112 …if ((err = mp_mulmod(B->x, mu, modulus, precomp[1<<2]->x)) != CRYPT_OK) … in ltc_ecc_mul2add()
113 …if ((err = mp_mulmod(B->y, mu, modulus, precomp[1<<2]->y)) != CRYPT_OK) … in ltc_ecc_mul2add()
114 …if ((err = mp_mulmod(B->z, mu, modulus, precomp[1<<2]->z)) != CRYPT_OK) … in ltc_ecc_mul2add()
117 …if ((err = ltc_mp.ecc_ptdbl(precomp[1], precomp[2], modulus, mp)) != CRYPT_OK) … in ltc_ecc_mul2add()
[all …]
Decc_sign_hash.c60 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in ecc_sign_hash()
66 if ((err = mp_init_multi(&r, &s, &p, &e, NULL)) != CRYPT_OK) { in ecc_sign_hash()
69 …if ((err = mp_read_radix(p, (char *)key->dp->order, 16)) != CRYPT_OK) { goto … in ecc_sign_hash()
70 …if ((err = mp_read_unsigned_bin(e, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto … in ecc_sign_hash()
74 if ((err = ecc_make_key_ex(prng, wprng, &pubkey, key->dp)) != CRYPT_OK) { in ecc_sign_hash()
79 if ((err = mp_mod(pubkey.pubkey.x, p, r)) != CRYPT_OK) { goto error; } in ecc_sign_hash()
85 … if ((err = mp_invmod(pubkey.k, p, pubkey.k)) != CRYPT_OK) { goto error; } /* k = 1/k */ in ecc_sign_hash()
86 … if ((err = mp_mulmod(key->k, r, p, s)) != CRYPT_OK) { goto error; } /* s = xr */ in ecc_sign_hash()
87 …if ((err = mp_add(e, s, s)) != CRYPT_OK) { goto error; } /* s = e + x… in ecc_sign_hash()
88 …if ((err = mp_mod(s, p, s)) != CRYPT_OK) { goto error; } /* s = e + x… in ecc_sign_hash()
[all …]
/external/dropbear/libtomcrypt/src/pk/asn1/der/choice/
Dder_decode_choice.c55 if (der_decode_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice()
56 if (der_length_integer(data, &z) == CRYPT_OK) { in der_decode_choice()
59 return CRYPT_OK; in der_decode_choice()
65 if (der_decode_short_integer(in, *inlen, data) == CRYPT_OK) { in der_decode_choice()
66 if (der_length_short_integer(size, &z) == CRYPT_OK) { in der_decode_choice()
69 return CRYPT_OK; in der_decode_choice()
75 if (der_decode_bit_string(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
76 if (der_length_bit_string(size, &z) == CRYPT_OK) { in der_decode_choice()
80 return CRYPT_OK; in der_decode_choice()
86 if (der_decode_octet_string(in, *inlen, data, &size) == CRYPT_OK) { in der_decode_choice()
[all …]
/external/dropbear/libtomcrypt/src/pk/rsa/
Drsa_make_key.c45 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in rsa_make_key()
49 if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, &tmp3, NULL)) != CRYPT_OK) { in rsa_make_key()
54 … if ((err = mp_set_int(tmp3, e)) != CRYPT_OK) { goto errkey; } /* tmp3 = e */ in rsa_make_key()
58 if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } in rsa_make_key()
59 … if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = p-1 */ in rsa_make_key()
60 …if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(p-1,… in rsa_make_key()
65 if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } in rsa_make_key()
66 … if ((err = mp_sub_d( q, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = q-1 */ in rsa_make_key()
67 …if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(q-1, … in rsa_make_key()
71 …if ((err = mp_sub_d( p, 1, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = p-1 */ in rsa_make_key()
[all …]
Drsa_exptmod.c54 …if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, NULL)) != CRYPT_OK) … in rsa_exptmod()
55 …if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) … in rsa_exptmod()
66 …if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { go… in rsa_exptmod()
69 …if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { go… in rsa_exptmod()
72 …if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { go… in rsa_exptmod()
73 …if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { got… in rsa_exptmod()
76 …if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { go… in rsa_exptmod()
77 …if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { go… in rsa_exptmod()
80 …if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { got… in rsa_exptmod()
100 …if ((err = mp_to_unsigned_bin(tmp, out+(x-mp_unsigned_bin_size(tmp)))) != CRYPT_OK) … in rsa_exptmod()
[all …]
/external/dropbear/libtomcrypt/src/math/fp/
Dltc_ecc_fp_mulmod.c641 if ((mp_copy(g->x, fp_cache[idx].g->x) != CRYPT_OK) || in add_entry()
642 (mp_copy(g->y, fp_cache[idx].g->y) != CRYPT_OK) || in add_entry()
643 (mp_copy(g->z, fp_cache[idx].g->z) != CRYPT_OK)) { in add_entry()
664 return CRYPT_OK; in add_entry()
694 if ((err = mp_init_copy(&fp_cache[idx].mu, mu)) != CRYPT_OK) { in build_lut()
699 if ((mp_mulmod(fp_cache[idx].g->x, mu, modulus, fp_cache[idx].LUT[1]->x) != CRYPT_OK) || in build_lut()
700 (mp_mulmod(fp_cache[idx].g->y, mu, modulus, fp_cache[idx].LUT[1]->y) != CRYPT_OK) || in build_lut()
701 …(mp_mulmod(fp_cache[idx].g->z, mu, modulus, fp_cache[idx].LUT[1]->z) != CRYPT_OK)) { goto E… in build_lut()
705 if ((mp_copy(fp_cache[idx].LUT[1<<(x-1)]->x, fp_cache[idx].LUT[1<<x]->x) != CRYPT_OK) || in build_lut()
706 (mp_copy(fp_cache[idx].LUT[1<<(x-1)]->y, fp_cache[idx].LUT[1<<x]->y) != CRYPT_OK) || in build_lut()
[all …]
/external/dropbear/libtomcrypt/src/pk/asn1/der/sequence/
Dder_decode_sequence_ex.c99 if ((err = der_decode_boolean(in + x, z, ((int *)data))) != CRYPT_OK) { in der_decode_sequence_ex()
102 if ((err = der_length_boolean(&z)) != CRYPT_OK) { in der_decode_sequence_ex()
109 if ((err = der_decode_integer(in + x, z, data)) != CRYPT_OK) { in der_decode_sequence_ex()
113 if ((err = der_length_integer(data, &z)) != CRYPT_OK) { in der_decode_sequence_ex()
120 if ((err = der_decode_short_integer(in + x, z, data)) != CRYPT_OK) { in der_decode_sequence_ex()
124 if ((err = der_length_short_integer(((unsigned long*)data)[0], &z)) != CRYPT_OK) { in der_decode_sequence_ex()
132 if ((err = der_decode_bit_string(in + x, z, data, &size)) != CRYPT_OK) { in der_decode_sequence_ex()
137 if ((err = der_length_bit_string(size, &z)) != CRYPT_OK) { in der_decode_sequence_ex()
144 if ((err = der_decode_octet_string(in + x, z, data, &size)) != CRYPT_OK) { in der_decode_sequence_ex()
149 if ((err = der_length_octet_string(size, &z)) != CRYPT_OK) { in der_decode_sequence_ex()
[all …]
Dder_encode_sequence_ex.c55 if ((err = der_length_boolean(&x)) != CRYPT_OK) { in der_encode_sequence_ex()
62 if ((err = der_length_integer(data, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
69 if ((err = der_length_short_integer(*((unsigned long*)data), &x)) != CRYPT_OK) { in der_encode_sequence_ex()
76 if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
83 if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
94 if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
101 if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
108 if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
115 if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
122 if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { in der_encode_sequence_ex()
[all …]
Dder_decode_sequence_flexi.c112 if ((err = der_decode_boolean(in, *inlen, l->data)) != CRYPT_OK) { in der_decode_sequence_flexi()
116 if ((err = der_length_boolean(&len)) != CRYPT_OK) { in der_decode_sequence_flexi()
125 if ((err = mp_init(&l->data)) != CRYPT_OK) { in der_decode_sequence_flexi()
130 if ((err = der_decode_integer(in, *inlen, l->data)) != CRYPT_OK) { in der_decode_sequence_flexi()
135 if ((err = der_length_integer(l->data, &len)) != CRYPT_OK) { in der_decode_sequence_flexi()
150 if ((err = der_decode_bit_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { in der_decode_sequence_flexi()
154 if ((err = der_length_bit_string(l->size, &len)) != CRYPT_OK) { in der_decode_sequence_flexi()
170 if ((err = der_decode_octet_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { in der_decode_sequence_flexi()
174 if ((err = der_length_octet_string(l->size, &len)) != CRYPT_OK) { in der_decode_sequence_flexi()
206 if ((err = der_decode_object_identifier(in, *inlen, l->data, &l->size)) != CRYPT_OK) { in der_decode_sequence_flexi()
[all …]
Dder_length_sequence.c50 if ((err = der_length_boolean(&x)) != CRYPT_OK) { in der_length_sequence()
57 if ((err = der_length_integer(data, &x)) != CRYPT_OK) { in der_length_sequence()
64 if ((err = der_length_short_integer(*((unsigned long *)data), &x)) != CRYPT_OK) { in der_length_sequence()
71 if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { in der_length_sequence()
78 if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) { in der_length_sequence()
89 if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) { in der_length_sequence()
96 if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence()
103 if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence()
110 if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { in der_length_sequence()
117 if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { in der_length_sequence()
[all …]
/external/dropbear/libtomcrypt/src/pk/katja/
Dkatja_make_key.c40 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in katja_make_key()
44 if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, NULL)) != CRYPT_OK) { in katja_make_key()
52 if ((err = rand_prime(q, -size, prng, wprng)) != CRYPT_OK) { goto done; } in katja_make_key()
53 if ((err = mp_sub_d(q, 1, tmp1)) != CRYPT_OK) { goto done; } in katja_make_key()
57 if ((err = rand_prime(p, size+1, prng, wprng)) != CRYPT_OK) { goto done; } in katja_make_key()
58 if ((err = mp_gcd(p, tmp1, tmp2)) != CRYPT_OK) { goto done; } in katja_make_key()
63 &key->qP, &key->p, &key->q, &key->pq, NULL)) != CRYPT_OK) { in katja_make_key()
68 if ((err = mp_copy( p, key->p)) != CRYPT_OK) { goto error2; } in katja_make_key()
69 if ((err = mp_copy( q, key->q)) != CRYPT_OK) { goto error2; } in katja_make_key()
70 …if ((err = mp_mul(key->p, key->q, key->pq)) != CRYPT_OK) { goto error2; } /* tmp1 = pq … in katja_make_key()
[all …]
/external/dropbear/libtomcrypt/src/pk/dsa/
Ddsa_verify_key.c38 if ((err = mp_prime_is_prime(key->q, 8, &res)) != CRYPT_OK) { in dsa_verify_key()
42 return CRYPT_OK; in dsa_verify_key()
45 if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { in dsa_verify_key()
49 return CRYPT_OK; in dsa_verify_key()
54 return CRYPT_OK; in dsa_verify_key()
56 if ((err = mp_init_multi(&tmp, &tmp2, NULL)) != CRYPT_OK) { return err; } in dsa_verify_key()
57 if ((err = mp_sub_d(key->p, 1, tmp)) != CRYPT_OK) { goto error; } in dsa_verify_key()
59 err = CRYPT_OK; in dsa_verify_key()
65 err = CRYPT_OK; in dsa_verify_key()
70 if ((err = mp_div(tmp, key->q, tmp, tmp2)) != CRYPT_OK) { goto error; } in dsa_verify_key()
[all …]
Ddsa_make_key.c39 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in dsa_make_key()
56 …err = mp_init_multi(&tmp, &tmp2, &key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != CRYPT_OK) { in dsa_make_key()
62 …if ((err = rand_prime(key->q, group_size, prng, wprng)) != CRYPT_OK) { goto error; } in dsa_make_key()
65 …if ((err = mp_add(key->q, key->q, tmp)) != CRYPT_OK) { goto error; } in dsa_make_key()
79 …if ((err = mp_read_unsigned_bin(tmp2, buf, modulus_size - group_size)) != CRYPT_OK) { goto error; } in dsa_make_key()
80 …if ((err = mp_mul(key->q, tmp2, key->p)) != CRYPT_OK) { goto error; } in dsa_make_key()
81 …if ((err = mp_add_d(key->p, 1, key->p)) != CRYPT_OK) { goto error; } in dsa_make_key()
85 … if ((err = mp_prime_is_prime(key->p, 8, &res)) != CRYPT_OK) { goto error; } in dsa_make_key()
89 … if ((err = mp_add(tmp, key->p, key->p)) != CRYPT_OK) { goto error; } in dsa_make_key()
90 … if ((err = mp_add_d(tmp2, 2, tmp2)) != CRYPT_OK) { goto error; } in dsa_make_key()
[all …]
Ddsa_sign_hash.c44 if ((err = prng_is_valid(wprng)) != CRYPT_OK) { in dsa_sign_hash_raw()
62 …if ((err = mp_init_multi(&k, &kinv, &tmp, NULL)) != CRYPT_OK) { goto ERRBUF;… in dsa_sign_hash_raw()
74 … if ((err = mp_read_unsigned_bin(k, buf, key->qord)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
80 … if ((err = mp_gcd(k, key->q, tmp)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
84 …if ((err = mp_invmod(k, key->q, kinv)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
87 …if ((err = mp_exptmod(key->g, k, key->p, r)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
88 …if ((err = mp_mod(r, key->q, r)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
93 …if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, inlen)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
94 …if ((err = mp_mul(key->x, r, s)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
95 …if ((err = mp_add(s, tmp, s)) != CRYPT_OK) { goto error; } in dsa_sign_hash_raw()
[all …]
Ddsa_verify_hash.c47 if ((err = mp_init_multi(&w, &v, &u1, &u2, NULL)) != CRYPT_OK) { in dsa_verify_hash_raw()
58 …if ((err = mp_invmod(s, key->q, w)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
61 …if ((err = mp_read_unsigned_bin(u1, (unsigned char *)hash, hashlen)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
62 …if ((err = mp_mulmod(u1, w, key->q, u1)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
65 …if ((err = mp_mulmod(r, w, key->q, u2)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
68 …if ((err = mp_exptmod(key->g, u1, key->p, u1)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
69 …if ((err = mp_exptmod(key->y, u2, key->p, u2)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
70 …if ((err = mp_mulmod(u1, u2, key->p, v)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
71 …if ((err = mp_mod(v, key->q, v)) != CRYPT_OK) { goto erro… in dsa_verify_hash_raw()
78 err = CRYPT_OK; in dsa_verify_hash_raw()
[all …]
/external/dropbear/libtomcrypt/src/math/
Dgmp_desc.c29 return CRYPT_OK; in init()
44 return CRYPT_OK; in neg()
52 return CRYPT_OK; in copy()
57 if (init(a) != CRYPT_OK) { in init_copy()
68 return CRYPT_OK; in set_int()
136 return CRYPT_OK; in twoexpt()
147 return CRYPT_OK; in read_radix()
156 return CRYPT_OK; in write_radix()
175 return CRYPT_OK; in unsigned_write()
184 return CRYPT_OK; in unsigned_read()
[all …]
/external/dropbear/libtomcrypt/src/prngs/
Dfortuna.c76 if ((err = sha256_process(&md, prng->fortuna.K, 32)) != CRYPT_OK) { in fortuna_reseed()
84 if ((err = sha256_done(&prng->fortuna.pool[x], tmp)) != CRYPT_OK) { in fortuna_reseed()
89 if ((err = sha256_process(&md, tmp, 32)) != CRYPT_OK) { in fortuna_reseed()
94 if ((err = sha256_init(&prng->fortuna.pool[x])) != CRYPT_OK) { in fortuna_reseed()
104 if ((err = sha256_done(&md, prng->fortuna.K)) != CRYPT_OK) { in fortuna_reseed()
107 if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { in fortuna_reseed()
122 return CRYPT_OK; in fortuna_reseed()
139 if ((err = sha256_init(&prng->fortuna.pool[x])) != CRYPT_OK) { in fortuna_start()
151 if ((err = rijndael_setup(prng->fortuna.K, 32, 0, &prng->fortuna.skey)) != CRYPT_OK) { in fortuna_start()
161 return CRYPT_OK; in fortuna_start()
[all …]
/external/dropbear/libtomcrypt/src/encauth/eax/
Deax_init.c50 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) { in eax_init()
71 if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) { in eax_init()
76 if ((err = omac_process(omac, buf, blklen)) != CRYPT_OK) { in eax_init()
80 if ((err = omac_process(omac, nonce, noncelen)) != CRYPT_OK) { in eax_init()
85 if ((err = omac_done(omac, eax->N, &len)) != CRYPT_OK) { in eax_init()
93 if ((err = omac_init(&eax->headeromac, cipher, key, keylen)) != CRYPT_OK) { in eax_init()
98 if ((err = omac_process(&eax->headeromac, buf, blklen)) != CRYPT_OK) { in eax_init()
103 if ((err = omac_process(&eax->headeromac, header, headerlen)) != CRYPT_OK) { in eax_init()
111 …(err = ctr_start(cipher, eax->N, key, keylen, 0, CTR_COUNTER_BIG_ENDIAN, &eax->ctr)) != CRYPT_OK) { in eax_init()
116 if ((err = omac_init(&eax->ctomac, cipher, key, keylen)) != CRYPT_OK) { in eax_init()
[all …]

1234567891011