Home
last modified time | relevance | path

Searched refs:primes (Results 1 – 25 of 86) sorted by relevance

1234

/third_party/node/deps/openssl/openssl/crypto/bn/
Dbn_prime.pl32 my @primes = ( 2 );
34 loop: while ($#primes < $num-1) {
38 for (my $i = 0; defined($primes[$i]) && $primes[$i] <= $s; $i++) {
39 next loop if ($p % $primes[$i]) == 0;
41 push(@primes, $p);
48 for (my $i = 0; $i <= $#primes; $i++) {
50 printf " %5d,", $primes[$i];
Dbn_prime.c297 BN_ULONG mod = BN_mod_word(w, primes[i]); in bn_is_prime_int()
301 return BN_is_word(w, primes[i]); in bn_is_prime_int()
484 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime()
494 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
510 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime()
512 if (safe ? (mods[i] + delta) % primes[i] <= 1 in probable_prime()
513 : (mods[i] + delta) % primes[i] == 0) { in probable_prime()
544 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime_dh()
579 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime_dh()
589 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime_dh()
[all …]
/third_party/openssl/crypto/bn/
Dbn_prime.pl32 my @primes = ( 2 );
34 loop: while ($#primes < $num-1) {
38 for (my $i = 0; defined($primes[$i]) && $primes[$i] <= $s; $i++) {
39 next loop if ($p % $primes[$i]) == 0;
41 push(@primes, $p);
48 for (my $i = 0; $i <= $#primes; $i++) {
50 printf " %5d,", $primes[$i];
Dbn_prime.c297 BN_ULONG mod = BN_mod_word(w, primes[i]); in bn_is_prime_int()
301 return BN_is_word(w, primes[i]); in bn_is_prime_int()
484 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime()
494 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
510 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime()
512 if (safe ? (mods[i] + delta) % primes[i] <= 1 in probable_prime()
513 : (mods[i] + delta) % primes[i] == 0) { in probable_prime()
544 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime_dh()
579 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime_dh()
589 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime_dh()
[all …]
/third_party/openssl/crypto/rsa/
Drsa_gen.c31 static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
50 int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, in RSA_generate_multi_prime_key() argument
56 return rsa->meth->rsa_multi_prime_keygen(rsa, bits, primes, in RSA_generate_multi_prime_key()
65 if (primes == 2) in RSA_generate_multi_prime_key()
71 return rsa_keygen(rsa->libctx, rsa, bits, primes, e_value, cb, 0); in RSA_generate_multi_prime_key()
75 static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes, in rsa_multiprime_keygen() argument
100 if (primes < RSA_DEFAULT_PRIME_NUM || primes > ossl_rsa_multip_cap(bits)) { in rsa_multiprime_keygen()
117 quo = bits / primes; in rsa_multiprime_keygen()
118 rmd = bits % primes; in rsa_multiprime_keygen()
120 for (i = 0; i < primes; i++) in rsa_multiprime_keygen()
[all …]
Drsa_lib.c479 int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[], in RSA_set0_multi_prime_params() argument
486 if (primes == NULL || exps == NULL || coeffs == NULL || pnum == 0) in RSA_set0_multi_prime_params()
500 if (primes[i] != NULL && exps[i] != NULL && coeffs[i] != NULL) { in RSA_set0_multi_prime_params()
504 pinfo->r = primes[i]; in RSA_set0_multi_prime_params()
575 int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]) in RSA_get0_multi_prime_factors() argument
589 primes[i] = pinfo->r; in RSA_get0_multi_prime_factors()
743 int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes, in DEFINE_STACK_OF()
752 if (primes == NULL || exps == NULL || coeffs == NULL) in DEFINE_STACK_OF()
755 pnum = sk_BIGNUM_num(primes); in DEFINE_STACK_OF()
761 if (!RSA_set0_factors(r, sk_BIGNUM_value(primes, 0), in DEFINE_STACK_OF()
[all …]
/third_party/node/deps/openssl/openssl/crypto/rsa/
Drsa_gen.c31 static int rsa_keygen(OSSL_LIB_CTX *libctx, RSA *rsa, int bits, int primes,
50 int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, in RSA_generate_multi_prime_key() argument
56 return rsa->meth->rsa_multi_prime_keygen(rsa, bits, primes, in RSA_generate_multi_prime_key()
65 if (primes == 2) in RSA_generate_multi_prime_key()
71 return rsa_keygen(rsa->libctx, rsa, bits, primes, e_value, cb, 0); in RSA_generate_multi_prime_key()
75 static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes, in rsa_multiprime_keygen() argument
100 if (primes < RSA_DEFAULT_PRIME_NUM || primes > ossl_rsa_multip_cap(bits)) { in rsa_multiprime_keygen()
117 quo = bits / primes; in rsa_multiprime_keygen()
118 rmd = bits % primes; in rsa_multiprime_keygen()
120 for (i = 0; i < primes; i++) in rsa_multiprime_keygen()
[all …]
Drsa_lib.c479 int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[], in RSA_set0_multi_prime_params() argument
486 if (primes == NULL || exps == NULL || coeffs == NULL || pnum == 0) in RSA_set0_multi_prime_params()
500 if (primes[i] != NULL && exps[i] != NULL && coeffs[i] != NULL) { in RSA_set0_multi_prime_params()
504 pinfo->r = primes[i]; in RSA_set0_multi_prime_params()
575 int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]) in RSA_get0_multi_prime_factors() argument
589 primes[i] = pinfo->r; in RSA_get0_multi_prime_factors()
743 int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes, in DEFINE_STACK_OF()
752 if (primes == NULL || exps == NULL || coeffs == NULL) in DEFINE_STACK_OF()
755 pnum = sk_BIGNUM_num(primes); in DEFINE_STACK_OF()
759 if (!RSA_set0_factors(r, sk_BIGNUM_value(primes, 0), in DEFINE_STACK_OF()
[all …]
/third_party/openssl/test/recipes/
D15-test_mp_rsa.t23 primes => '3',
28 primes => '4',
33 primes => '5',
56 my $primes = $param->{primes};
58 my $name = ($evp ? "evp" : "") . "${bits}p${primes}";
63 '-pkeyopt', "rsa_keygen_primes:$primes",
79 '-primes', $primes, $bits])), "genrsa $name");
/third_party/openssl/doc/internal/man3/
Dossl_rsa_get0_all_params.pod12 int ossl_rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
15 int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
21 ossl_rsa_set0_all_params() sets all primes, CRT exponents and CRT coefficients
22 in the B<RSA> object I<r> to the contents of the stacks of BIGNUMs I<primes>,
26 ossl_rsa_get0_all_params() gets all primes, CRT exponents and CRT coefficients
28 I<primes>, I<exps> and I<coeffs>. The B<RSA> object retains ownership of the
39 the I<primes> stack contains I<p>, I<q>, and then the rest of the primes
54 The number of primes must always be equal to the number of exponents, and
55 the number of coefficients must be one less than the number of primes.
/third_party/openssl/test/
Drsa_mp_test.c202 STACK_OF(BIGNUM) *primes = NULL, *exps = NULL, *coeffs = NULL; in key2048p3_v2()
206 if (!TEST_ptr(primes = sk_BIGNUM_new_null()) in key2048p3_v2()
212 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0) in key2048p3_v2()
214 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0) in key2048p3_v2()
216 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0)) in key2048p3_v2()
233 if (!TEST_true(ossl_rsa_set0_all_params(key, primes, exps, coeffs))) in key2048p3_v2()
237 sk_BIGNUM_free(primes); in key2048p3_v2()
242 sk_BIGNUM_pop_free(primes, BN_free); in key2048p3_v2()
245 primes = exps = coeffs = NULL; in key2048p3_v2()
/third_party/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/
DCalendarCache.java77 if (pIndex < primes.length - 1) { in rehash()
78 arraySize = primes[++pIndex]; in rehash()
111 static private final int primes[] = { // 5, 17, 31, 47, // for testing field in CalendarCache
118 private int arraySize = primes[pIndex];
/third_party/icu/ohos_icu4j/src/main/java/ohos/global/icu/impl/
DCalendarCache.java79 if (pIndex < primes.length - 1) { in rehash()
80 arraySize = primes[++pIndex]; in rehash()
113 static private final int primes[] = { // 5, 17, 31, 47, // for testing field in CalendarCache
120 private int arraySize = primes[pIndex];
/third_party/openssl/doc/man3/
DRSA_generate_key.pod20 int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb);
41 it in the B<RSA> structure provided in I<rsa>. The number of primes is given by
42 the I<primes> parameter.
46 The modulus size will be of length I<bits>, the number of primes to form the
47 modulus will be I<primes>, and the public exponent will be I<e>. Key sizes
52 I<primes> depends on modulus bit length:
86 The process is then repeated for prime q and other primes (if any)
/third_party/skia/third_party/externals/swiftshader/third_party/marl/examples/
Dprimes.cpp65 std::vector<int> primes; in main() local
68 primes.push_back(i); in main()
78 for (auto prime : primes) { in main()
DBUILD.bazel36 name = "primes",
38 "primes.cpp",
/third_party/elfutils/tests/
Drun-readelf-dw-form-indirect.sh475 decl_file (data1) primes.c (1)
488 decl_file (data1) primes.c (1)
496 decl_file (data1) primes.c (1)
504 decl_file (data1) primes.c (1)
515 decl_file (data1) primes.c (1)
526 call_file (data1) primes.c (1)
537 call_file (data1) primes.c (1)
567 call_file (data1) primes.c (1)
593 decl_file (data1) primes.c (1)
602 decl_file (data1) primes.c (1)
[all …]
/third_party/openssl/doc/man7/
DEVP_PKEY-RSA.pod121 =item "primes" (B<OSSL_PKEY_PARAM_RSA_PRIMES>) <unsigned integer>
123 The value should be the number of primes for the generated B<RSA> key. The
124 default is 2. It isn't permitted to specify a larger number of primes than
125 10. Additionally, the number of primes is limited by the length of the key
181 The auxiliary probable primes.
203 OpenSSL default provider allows testing of the validity of multi-primes.
244 unsigned int primes = 3;
253 params[1] = OSSL_PARAM_construct_uint("primes", &primes);
/third_party/openssl/ohos_lite/include/openssl/
Drsa.h129 # define EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) \ argument
131 EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES, primes, NULL)
207 int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[],
213 int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]);
242 int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes,
503 (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb);
506 int primes, BIGNUM *e,
/third_party/openssl/apps/
Dgenrsa.c86 int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES; in genrsa_main() local
137 primes = opt_int_arg(); in genrsa_main()
201 if (EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) <= 0) { in genrsa_main()
/third_party/node/deps/openssl/openssl/apps/
Dgenrsa.c86 int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES; in genrsa_main() local
137 primes = opt_int_arg(); in genrsa_main()
201 if (EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) <= 0) { in genrsa_main()
/third_party/openssl/doc/man1/
Dopenssl-genrsa.pod.in29 [B<-primes> I<num>]
73 =item B<-primes> I<num>
75 Specify the number of primes to use while generating the RSA key. The I<num>
112 may vary somewhat. But in general, more primes lead to less generation time
/third_party/mbedtls/library/
Drsa_alt_helpers.c76 const unsigned char primes[] = { 2, in mbedtls_rsa_deduce_primes() local
85 const size_t num_primes = sizeof(primes) / sizeof(*primes); in mbedtls_rsa_deduce_primes()
129 mbedtls_mpi_lset(&K, primes[attempt]); in mbedtls_rsa_deduce_primes()
/third_party/openssl/include/openssl/
Drsa.h127 int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
213 BIGNUM *primes[],
224 const BIGNUM *primes[]);
264 int primes, BIGNUM *e,
591 int primes,
597 int primes, BIGNUM *e,
/third_party/node/deps/openssl/openssl/include/openssl/
Drsa.h127 int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
213 BIGNUM *primes[],
224 const BIGNUM *primes[]);
264 int primes, BIGNUM *e,
591 int primes,
597 int primes, BIGNUM *e,

1234