Home
last modified time | relevance | path

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

123

/freebsd/crypto/openssl/crypto/bn/
H A 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];
H A 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 …]
H A Dbn_prime.h16 static const prime_t primes[2048] = { variable
/freebsd/crypto/openssl/crypto/rsa/
H A 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 …]
H A 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 …]
/freebsd/crypto/openssl/test/recipes/
H A 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");
/freebsd/crypto/openssl/doc/internal/man3/
H A 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.
/freebsd/crypto/openssl/test/
H A 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()
/freebsd/usr.bin/factor/tests/
H A Dprimes_tests.sh34 …atf_check -s not-exit:0 -e inline:"primes: start value must be less than stop value.\n" primes -- …
44 atf_check -s not-exit:0 -e inline:"primes: negative numbers aren't permitted.\n" primes -- -1 0
55 atf_check primes 20 22
66 atf_check -o inline:"23\n29\n31\n37\n41\n43\n47\n" primes 20 50
/freebsd/sys/kern/
H A Dsubr_hash.c99 static const int primes[] = { 1, 13, 31, 61, 127, 251, 509, 761, 1021, 1531, variable
102 #define NPRIMES nitems(primes)
119 for (i = 1, hashsize = primes[1]; hashsize <= elements;) { in phashinit_flags()
123 hashsize = primes[i]; in phashinit_flags()
125 hashsize = primes[i - 1]; in phashinit_flags()
/freebsd/usr.bin/factor/
H A DMakefile5 CFLAGS+=-I${SRCTOP}/usr.bin/primes
13 MLINKS+=factor.6 primes.6
14 .PATH: ${SRCTOP}/usr.bin/primes
/freebsd/crypto/openssl/doc/man3/
H A 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)
H A DRSA_get0_key.pod46 int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]);
49 int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[],
100 can be used to obtain other primes and related CRT parameters. The
156 RSA_get_multi_prime_extra_count() returns two less than the number of primes
157 in use, which is 0 for traditional RSA and the number of extra primes for
/freebsd/usr.bin/primes/
H A DMakefile1 PROG= primes
2 SRCS= pattern.c pr_tbl.c primes.c spsp.c
H A Dprimes.c78 static void primes(ubig, ubig);
156 primes(start, stop); in main()
195 primes(ubig start, ubig stop) in primes() function
/freebsd/crypto/openssl/doc/man7/
H A 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);
/freebsd/crypto/openssl/apps/
H A 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()
/freebsd/crypto/openssl/doc/man1/
H A Dopenssl-genrsa.pod.in29 [B<-primes> I<num>]
70 =item B<-primes> I<num>
72 Specify the number of primes to use while generating the RSA key. The I<num>
109 may vary somewhat. But in general, more primes lead to less generation time
/freebsd/crypto/openssl/include/openssl/
H A 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,
/freebsd/crypto/openssh/
H A DMakefile.in449 echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
450 mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \
/freebsd/contrib/ofed/opensm/opensm/
H A Dst.c118 static long primes[] = { variable
164 i < sizeof(primes) / sizeof(primes[0]); i++, newsize <<= 1) { in new_size()
166 return primes[i]; in new_size()
/freebsd/crypto/openssl/demos/pkey/
H A DEVP_PKEY_RSA_keygen.c39 unsigned int primes = 2; in generate_rsa_key_long() local
71 if (EVP_PKEY_CTX_set_rsa_keygen_primes(genctx, primes) <= 0) { in generate_rsa_key_long()
/freebsd/crypto/openssl/include/crypto/
H A Drsa.h59 int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
62 int ossl_rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
/freebsd/crypto/openssl/test/recipes/30-test_evp_pkey_provided/
H A DRSA.priv.txt1 Private-Key: (32 bit, 2 primes)
/freebsd/targets/pseudo/userland/games/
H A DMakefile.depend14 usr.bin/primes \

123