Home
last modified time | relevance | path

Searched refs:q (Results 1 – 25 of 41) sorted by relevance

12

/crypto/dsa/
A Ddsa.cc72 BN_clear_free(dsa->q); in DSA_free()
115 *out_q = dsa->q; in DSA_get0_pqg()
140 if ((dsa->p == NULL && p == NULL) || (dsa->q == NULL && q == NULL) || in DSA_set0_pqg()
149 if (q != NULL) { in DSA_set0_pqg()
150 BN_free(dsa->q); in DSA_set0_pqg()
151 dsa->q = q; in DSA_set0_pqg()
389 BN_free(dsa->q); in DSA_generate_parameters_ex()
392 dsa->q = BN_dup(q); in DSA_generate_parameters_ex()
413 ret->q = BN_dup(dsa->q); in DSAparams_dup()
823 if (dsa->q == NULL) { in DSA_size()
[all …]
A Ddsa_asn1.cc32 if (!dsa->p || !dsa->q || !dsa->g) { in dsa_check_key()
44 BN_is_zero(dsa->q) || !BN_is_odd(dsa->p) || !BN_is_odd(dsa->q) || in dsa_check_key()
46 BN_cmp(dsa->q, dsa->p) >= 0 || in dsa_check_key()
55 unsigned q_bits = BN_num_bits(dsa->q); in dsa_check_key()
82 constant_time_declassify_int(BN_cmp(dsa->priv_key, dsa->q) >= 0)) { in dsa_check_key()
147 !parse_integer(&child, &ret->q) || in DSA_parse_public_key()
164 !marshal_integer(&child, dsa->q) || in DSA_marshal_public_key()
181 !parse_integer(&child, &ret->q) || in DSA_parse_parameters()
197 !marshal_integer(&child, dsa->q) || in DSA_marshal_parameters()
226 !parse_integer(&child, &ret->q) || in DSA_parse_private_key()
[all …]
A Ddsa_test.cc134 bssl::UniquePtr<BIGNUM> q(BN_bin2bn(fips_q, sizeof(fips_q), nullptr)); in GetFIPSDSAGroup() local
136 if (!p || !q || !g || !DSA_set0_pqg(dsa.get(), p.get(), q.get(), g.get())) { in GetFIPSDSAGroup()
141 q.release(); in GetFIPSDSAGroup()
365 bssl::UniquePtr<BIGNUM> q(BN_bin2bn(fips_q, sizeof(fips_q), nullptr)); in TEST() local
366 ASSERT_TRUE(q); in TEST()
369 ASSERT_TRUE(DSA_set0_pqg(dsa.get(), p.get(), q.get(), g.get())); in TEST()
372 q.release(); in TEST()
/crypto/fipsmodule/bn/
A Dsqrt.cc.inc69 q = BN_CTX_get(ctx);
89 // now write |p| - 1 as 2^e*q where q is odd
106 q->neg = 0;
151 q->neg = 0;
182 if (!BN_copy(q, p)) {
185 q->neg = 0;
211 r = bn_jacobi(y, q, ctx); // here 'q' is |p|
232 if (!BN_rshift(q, q, e)) {
263 // t := (q-1)/2 (note that q is odd)
268 // x := a^((q-1)/2)
[all …]
A Ddiv.cc.inc69 th = q * dh;
70 tl = dl * q;
77 q--;
91 q--;
104 ret |= q;
231 // of wnum and sdiv. We must estimate such that q' = q or q' = q + 1.
264 // Estimate q' = floor(n0n1 / d0). Per Theorem B, q' - 2 <= q <= q', which
272 // q + 1, Knuth uses a loop. A loop will often also correct q + 1 to q,
314 // Knuth step D4 through D6: Now q' = q or q' = q + 1, and
315 // -sdiv < wnum - sdiv * q < sdiv. If q' = q + 1, the subtraction will
[all …]
A Ddiv_extra.cc.inc26 // computing |m| and |q| without architecture-specific code.
35 uint32_t q = ((uint64_t)m * n) >> 32;
37 uint32_t t = ((n - q) >> 1) + q;
A Dprime.cc.inc865 BIGNUM *q = BN_CTX_get(ctx);
875 if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) {
880 if (!BN_mod(t1, q, qadd, ctx)) {
884 if (!BN_sub(q, q, t1)) {
889 if (!BN_add_word(q, 1)) {
896 if (!BN_add(q, q, t1)) {
902 if (!BN_lshift1(p, q)) {
912 // check that p and q are prime
913 // check that for p and q
916 bn_mod_u16_consttime(q, kPrimes[i]) == 0) {
[all …]
/crypto/fipsmodule/dh/
A Dcheck.cc.inc29 // Most operations scale with p and q.
36 // q must be bounded by p.
37 if (dh->q != NULL && (BN_is_negative(dh->q) || BN_ucmp(dh->q, dh->p) > 0)) {
80 if (dh->q != NULL) {
83 // subgroup of size |dh->q|.
84 if (!BN_mod_exp_mont(tmp, pub_key, dh->q, dh->p, ctx.get(), NULL)) {
121 if (dh->q) {
127 // Check g^q == 1 mod p
143 // Check p == 1 mod q i.e. q divides p - 1
144 if (!BN_div(t1, t2, dh->p, dh->q, ctx.get())) {
[all …]
A Ddh.cc.inc53 BN_clear_free(dh->q);
69 const BIGNUM *DH_get0_q(const DH *dh) { return dh->q; }
103 *out_q = dh->q;
120 if (q != NULL) {
121 BN_free(dh->q);
122 dh->q = q;
182 if (dh->q) {
184 // from [1, min(2^N-1, q-1)].
189 if (!BN_rand_range_ex(priv_key, 1, dh->q)) {
202 // Compute M = min(2^N, q).
[all …]
/crypto/dh/
A Ddh_test.cc158 bssl::UniquePtr<BIGNUM> q_copy(q != nullptr ? BN_dup(q) : nullptr); in NewDHGroup()
175 bssl::UniquePtr<BIGNUM> q( in TEST() local
180 ASSERT_TRUE(q); in TEST()
515 bssl::UniquePtr<BIGNUM> q(BN_new()); in TEST() local
516 ASSERT_TRUE(q); in TEST()
520 EXPECT_EQ(BN_num_bits(q.get()), 2047u); in TEST()
537 EXPECT_LE(BN_num_bits(q.get()) - kMaxLeadingZeros, in TEST()
547 EXPECT_LE(BN_num_bits(q.get()) - kMaxLeadingZeros, in TEST()
563 bits = BN_num_bits(q.get()) - 1; in TEST()
573 DH_set_length(dh.get(), BN_num_bits(q.get())); in TEST()
[all …]
A Dparams.cc378 is_x942 = !!from->q; in int_dh_param_copy()
389 if (!int_dh_bn_cpy(&to->q, from->q)) { in int_dh_param_copy()
/crypto/x509/
A Dx509_obj.cc38 unsigned char *q; in X509_NAME_oneline() local
82 q = ne->value->data; in X509_NAME_oneline()
87 if (q[j] != 0) { in X509_NAME_oneline()
107 if ((q[j] < ' ') || (q[j] > '~')) { in X509_NAME_oneline()
133 q = ne->value->data; in X509_NAME_oneline()
139 n = q[j]; in X509_NAME_oneline()
A Dv3_utl.cc302 char *p, *q, c; in STACK_OF() local
326 q = p + 1; in STACK_OF()
330 q = p + 1; in STACK_OF()
356 q = p + 1; in STACK_OF()
393 char *p, *q; in strip_spaces() local
402 q = p + strlen(p) - 1; in strip_spaces()
403 while ((q != p) && OPENSSL_isspace((unsigned char)*q)) { in strip_spaces()
404 q--; in strip_spaces()
406 if (p != q) { in strip_spaces()
407 q[1] = 0; in strip_spaces()
[all …]
A Dx_name.cc149 const unsigned char *p = *in, *q; in x509_name_ex_d2i() local
160 q = p; in x509_name_ex_d2i()
181 if (!BUF_MEM_grow(nm->bytes, p - q)) { in x509_name_ex_d2i()
184 OPENSSL_memcpy(nm->bytes->data, q, p - q); in x509_name_ex_d2i()
A Dx_x509.cc341 const unsigned char *q = *pp; in d2i_X509_AUX() local
348 ret = d2i_X509(a, &q, length); in d2i_X509_AUX()
354 length -= q - *pp; in d2i_X509_AUX()
356 if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length)) { in d2i_X509_AUX()
359 *pp = q; in d2i_X509_AUX()
/crypto/fipsmodule/rsa/
A Drsa_impl.cc.inc672 // have I < p * q, so this follows if q < R. The caller should have checked
704 assert(rsa->q != NULL);
721 BIGNUM *q = &rsa->mont_q->N;
747 // r0 = r0 * q + m1 gives the final result. Reducing modulo q gives m1, so
1037 !ensure_bignum(&rsa->q) || //
1091 if (BN_cmp(rsa->p, rsa->q) < 0) {
1093 rsa->p = rsa->q;
1094 rsa->q = tmp;
1126 // Calculate d mod (q-1)
1137 // Calculate q^-1 mod p.
[all …]
A Drsa.cc.inc76 !bn_dup_into(&rsa->q, q) || //
151 !bn_dup_into(&rsa->q, q) || //
224 BN_free(rsa->q);
275 *out_q = rsa->q;
321 if ((rsa->p == NULL && p == NULL) || (rsa->q == NULL && q == NULL)) {
329 if (q != NULL) {
330 BN_free(rsa->q);
331 rsa->q = q;
740 if ((key->p != NULL) != (key->q != NULL)) {
774 // Check that p * q == n. Before we multiply, we check that p and q are in
[all …]
/crypto/rsa/
A Drsa_test.cc639 EXPECT_FALSE(rsa->q); in TEST()
800 ASSERT_TRUE(BN_hex2bn(&rsa->q, kQ)); in TEST()
904 ASSERT_TRUE(BN_add(rsa->dmq1, rsa->dmq1, rsa->q)); in TEST()
907 ASSERT_TRUE(BN_sub(rsa->dmq1, rsa->dmq1, rsa->q)); in TEST()
938 EXPECT_FALSE(rsa->q); in TEST()
1071 ASSERT_TRUE(q); in TEST()
1188 const BIGNUM *q = RSA_get0_q(key.get()); in TEST() local
1189 bssl::UniquePtr<BIGNUM> neg_q = dup_neg(q); in TEST()
1222 const BIGNUM *q = RSA_get0_q(key.get()); in TEST() local
1384 rsa->q = BN_dup(rsa_template->q); in TEST()
[all …]
/crypto/evp/
A Dp_dh_asn1.cc52 BIGNUM *q = q_old == NULL ? NULL : BN_dup(q_old); in dh_param_copy() local
54 if (p == NULL || (q_old != NULL && q == NULL) || g == NULL || in dh_param_copy()
55 !DH_set0_pqg(reinterpret_cast<DH *>(to->pkey), p, q, g)) { in dh_param_copy()
57 BN_free(q); in dh_param_copy()
A Dp_dsa_asn1.cc56 dsa->p != nullptr && dsa->q != nullptr && dsa->g != nullptr; in dsa_pub_encode()
172 !dup_bn_into(&to_dsa->q, from_dsa->q) || in dsa_copy_parameters()
/crypto/conf/
A Dconf.cc167 int q, to = 0, len = 0; in str_copy() local
183 q = *from; in str_copy()
185 while (*from != '\0' && *from != q) { in str_copy()
194 if (*from == q) { in str_copy()
323 int q = *p; in scan_quote() local
326 while (*p != '\0' && *p != q) { in scan_quote()
335 if (*p == q) { in scan_quote()
/crypto/asn1/
A Dtasn_dec.cc154 const unsigned char *p = NULL, *q; in asn1_item_ex_d2i() local
371 q = p; in asn1_item_ex_d2i()
393 len -= p - q; in asn1_item_ex_d2i()
463 const unsigned char *p, *q; in asn1_template_ex_d2i() local
479 q = p; in asn1_template_ex_d2i()
497 len -= p - q; in asn1_template_ex_d2i()
572 const unsigned char *q = p; in asn1_template_noexp_d2i() local
579 len -= p - q; in asn1_template_noexp_d2i()
/crypto/curve25519/
A Dcurve25519.cc611 ge_p2 q; in ge_p3_dbl() local
612 ge_p3_to_p2(&q, p); in ge_p3_dbl()
613 ge_p2_dbl(r, &q); in ge_p3_dbl()
622 fe_mul_tll(&trZ, &r->X, &q->yplusx); in ge_madd()
624 fe_mul_tlt(&trT, &q->xy2d, &p->T); in ge_madd()
640 fe_mul_tll(&trY, &r->Y, &q->yplusx); in ge_msub()
641 fe_mul_tlt(&trT, &q->xy2d, &p->T); in ge_msub()
658 fe_mul_tlt(&trT, &q->T2d, &p->T); in x25519_ge_add()
659 fe_mul_ttl(&trX, &p->Z, &q->Z); in x25519_ge_add()
676 fe_mul_tlt(&trT, &q->T2d, &p->T); in x25519_ge_sub()
[all …]
A Dinternal.h129 void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
130 void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q);
/crypto/fipsmodule/ec/
A Dec_test.cc521 bssl::UniquePtr<EC_POINT> q(EC_POINT_new(group.get())); in TEST() local
522 ASSERT_TRUE(q); in TEST()
524 EC_POINT_mul(group.get(), q.get(), d.get(), nullptr, nullptr, nullptr)); in TEST()
525 ASSERT_TRUE(EC_POINT_get_affine_coordinates_GFp(group.get(), q.get(), x.get(), in TEST()
644 bssl::UniquePtr<EC_POINT> q(EC_POINT_new(group())); in TEST_P() local
645 ASSERT_TRUE(q); in TEST_P()
646 ASSERT_TRUE(EC_POINT_copy(q.get(), pub2)); in TEST_P()
647 ASSERT_TRUE(EC_POINT_invert(group(), q.get(), nullptr)); in TEST_P()
648 EXPECT_EQ(1, EC_POINT_cmp(group(), q.get(), pub2, nullptr)); in TEST_P()
651 ASSERT_TRUE(EC_POINT_add(group(), p.get(), p.get(), q.get(), nullptr)); in TEST_P()
[all …]

Completed in 42 milliseconds

12