Home
last modified time | relevance | path

Searched refs:primes (Results 1 – 25 of 55) 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.c306 BN_ULONG mod = BN_mod_word(w, primes[i]); in bn_is_prime_int()
310 return BN_is_word(w, primes[i]); in bn_is_prime_int()
493 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime()
503 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
519 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime()
521 if (safe ? (mods[i] + delta) % primes[i] <= 1 in probable_prime()
522 : (mods[i] + delta) % primes[i] == 0) { in probable_prime()
553 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime_dh()
588 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime_dh()
598 && 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/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/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()
82 int ossl_rsa_multiprime_derive(RSA *rsa, int bits, int primes, in DEFINE_STACK_OF()
265 static int rsa_multiprime_keygen(RSA *rsa, int bits, int primes, in rsa_multiprime_keygen() argument
295 if (primes < RSA_DEFAULT_PRIME_NUM || primes > ossl_rsa_multip_cap(bits)) { in rsa_multiprime_keygen()
323 quo = bits / primes; in rsa_multiprime_keygen()
324 rmd = bits % primes; in rsa_multiprime_keygen()
[all …]
H A Drsa_lib.c486 int RSA_set0_multi_prime_params(RSA *r, BIGNUM *primes[], BIGNUM *exps[], in RSA_set0_multi_prime_params() argument
493 if (primes == NULL || exps == NULL || coeffs == NULL || pnum == 0) in RSA_set0_multi_prime_params()
507 if (primes[i] != NULL && exps[i] != NULL && coeffs[i] != NULL) { in RSA_set0_multi_prime_params()
511 pinfo->r = primes[i]; in RSA_set0_multi_prime_params()
582 int RSA_get0_multi_prime_factors(const RSA *r, const BIGNUM *primes[]) in RSA_get0_multi_prime_factors() argument
596 primes[i] = pinfo->r; in RSA_get0_multi_prime_factors()
754 int ossl_rsa_set0_all_params(RSA *r, STACK_OF(BIGNUM) *primes, in DEFINE_STACK_OF()
763 if (primes == NULL || exps == NULL || coeffs == NULL) in DEFINE_STACK_OF()
766 pnum = sk_BIGNUM_num(primes); in DEFINE_STACK_OF()
772 if (!RSA_set0_factors(r, sk_BIGNUM_value(primes, 0), in DEFINE_STACK_OF()
[all …]
/freebsd/crypto/openssl/test/
H A Drsa_mp_test.c194 STACK_OF(BIGNUM) *primes = NULL, *exps = NULL, *coeffs = NULL; in key2048p3_v2()
198 if (!TEST_ptr(primes = sk_BIGNUM_new_null()) in key2048p3_v2()
204 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0) in key2048p3_v2()
206 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0) in key2048p3_v2()
208 || !TEST_int_ne(sk_BIGNUM_push(primes, num), 0)) in key2048p3_v2()
225 if (!TEST_true(ossl_rsa_set0_all_params(key, primes, exps, coeffs))) in key2048p3_v2()
229 sk_BIGNUM_free(primes); in key2048p3_v2()
234 sk_BIGNUM_pop_free(primes, BN_free); in key2048p3_v2()
237 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
190 The auxiliary probable primes.
212 OpenSSL default provider allows testing of the validity of multi-primes.
253 unsigned int primes = 3;
262 params[1] = OSSL_PARAM_construct_uint("primes", &primes);
/freebsd/crypto/openssl/apps/
H A Dgenrsa.c93 int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES; in genrsa_main() local
145 primes = opt_int_arg(); in genrsa_main()
210 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>]
71 =item B<-primes> I<num>
73 Specify the number of primes to use while generating the RSA key. The I<num>
115 may vary somewhat. But in general, more primes lead to less generation time
/freebsd/crypto/openssl/include/openssl/
H A Drsa.h130 int EVP_PKEY_CTX_set_rsa_keygen_primes(EVP_PKEY_CTX *ctx, int primes);
224 BIGNUM *primes[],
235 const BIGNUM *primes[]);
274 int primes, BIGNUM *e,
601 int primes,
607 int primes, BIGNUM *e,
/freebsd/crypto/openssh/
H A DMakefile.in482 echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
483 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.h65 int ossl_rsa_set0_all_params(RSA *r, STACK_OF(BIGNUM) *primes,
68 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