/freebsd/contrib/wpa/src/common/ |
H A D | dragonfly.c | 53 int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime, in dragonfly_get_random_qr_qnr() argument 64 if (!tmp || crypto_bignum_rand(tmp, prime) < 0) { in dragonfly_get_random_qr_qnr() 69 res = crypto_bignum_legendre(tmp, prime); in dragonfly_get_random_qr_qnr() 91 dragonfly_get_rand_1_to_p_1(const struct crypto_bignum *prime) in dragonfly_get_rand_1_to_p_1() argument 99 crypto_bignum_sub(prime, one, pm1) < 0 || in dragonfly_get_rand_1_to_p_1() 119 const struct crypto_bignum *prime; in dragonfly_is_quadratic_residue_blind() local 123 prime = crypto_ec_get_prime(ec); in dragonfly_is_quadratic_residue_blind() 135 r = dragonfly_get_rand_1_to_p_1(prime); in dragonfly_is_quadratic_residue_blind() 141 crypto_bignum_mulmod(val, r, prime, num) < 0 || in dragonfly_is_quadratic_residue_blind() 142 crypto_bignum_mulmod(num, r, prime, num) < 0) in dragonfly_is_quadratic_residue_blind() [all …]
|
H A D | sae.c | 51 tmp->prime = crypto_ec_get_prime(tmp->ec); in sae_set_group() 69 tmp->prime_buf = crypto_bignum_init_set(tmp->dh->prime, in sae_set_group() 75 tmp->prime = tmp->prime_buf; in sae_set_group() 148 const u8 *prime, const u8 *qr, const u8 *qnr, in sae_test_pwd_seed_ecc() argument 162 prime, sae->tmp->prime_len, pwd_value, bits) < 0) in sae_test_pwd_seed_ecc() 169 cmp_prime = const_time_memcmp(pwd_value, prime, sae->tmp->prime_len); in sae_test_pwd_seed_ecc() 210 sae->tmp->dh->prime, sae->tmp->prime_len, pwd_value, in sae_test_pwd_seed_ffc() 217 res = const_time_memcmp(pwd_value, sae->tmp->dh->prime, in sae_test_pwd_seed_ffc() 251 crypto_bignum_sub(sae->tmp->prime, b, b) < 0 || in sae_test_pwd_seed_ffc() 259 res = crypto_bignum_exptmod(a, b, sae->tmp->prime, pwe); in sae_test_pwd_seed_ffc() [all …]
|
/freebsd/crypto/libecc/scripts/ |
H A D | gen_curves_tests.sh | 45 $PYTHON $EXPAND_LIBECC --name="SECP192R1" --prime=6277101735386680763835789423207666416083908700390… 49 $PYTHON $EXPAND_LIBECC --name="SECP224R1" --prime=2695994666715063979466701508701963067355791626002… 53 $PYTHON $EXPAND_LIBECC --name="SECP256R1" --prime=1157920892103562487626974469494075735300861434152… 57 $PYTHON $EXPAND_LIBECC --name="SECP384R1" --prime=3940200619639447921227904010014361380507973927046… 61 $PYTHON $EXPAND_LIBECC --name="SECP521R1" --prime=6864797660130609714981900799081393217269435300143… 65 $PYTHON $EXPAND_LIBECC --name="BRAINPOOL160R1" --prime=13322975984400448748270855588024917437571937… 69 $PYTHON $EXPAND_LIBECC --name="BRAINPOOL192R1" --prime=47816689839061662429550018943449237732591196… 73 $PYTHON $EXPAND_LIBECC --name="BRAINPOOL224R1" --prime=22721622932454352787552537995910928073340732… 77 $PYTHON $EXPAND_LIBECC --name="BRAINPOOL256R1" --prime=76884956397045344220809746629001649093037950… 81 $PYTHON $EXPAND_LIBECC --name="BRAINPOOL320R1" --prime=17635933222391663541619098424460195208895127… [all …]
|
H A D | expand_libecc.py | 62 def compute_monty_coef(prime, pbitlen, wlen): argument 68 r = (1 << int(pbitlen)) % prime 69 r_square = (1 << (2 * int(pbitlen))) % prime 70 mpinv = 2**wlen - (modinv(prime, 2**wlen)) 73 def compute_div_coef(prime, pbitlen, wlen): argument 77 tmp = prime 83 primenorm = prime << pshift 175 def __init__(self, a, b, prime, order, cofactor, gx, gy, npoints, name, oid): argument 178 self.p = prime 1297 prime = stringtoint(P) [all …]
|
/freebsd/crypto/openssl/doc/man1/ |
H A D | openssl-prime.pod.in | 6 openssl-prime - compute prime numbers 10 B<openssl prime> 22 This command checks if the specified numbers are prime. 42 Generate a prime number. 46 Generate a prime with I<num> bits. 50 When used with B<-generate>, generates a "safe" prime. If the number 51 generated is I<n>, then check that C<(I<n>-1)/2> is also prime.
|
H A D | openssl-genrsa.pod.in | 74 If I<num> is greater than 2, then the generated key is called a 'multi-prime' 101 prime numbers. When generating a private key various symbols will be output to 104 round of the Miller-Rabin primality test, B<*> means the current prime starts 106 has passed all the prime tests (the actual number depends on the key size).
|
/freebsd/usr.bin/primes/ |
H A D | pr_tbl.c | 48 const ubig prime[] = { variable 540 const ubig *const pr_limit = &prime[(sizeof(prime)/sizeof(prime[0]))-1];
|
H A D | primes.c | 234 for (p = &prime[0], factor = prime[0]; in primes() 279 p = &prime[7]; /* 19 is next prime, pi(19)=7 */ in primes()
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | crypto_internal-modexp.c | 16 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument 23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init() 29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init() 42 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument 53 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 70 bignum_set_unsigned_bin(p, prime, prime_len) < 0 || in crypto_dh_derive_secret() 82 prime, prime_len, secret, len); in crypto_dh_derive_secret()
|
H A D | crypto_nettle.c | 307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument 314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init() 320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init() 333 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument 344 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 358 mpz_import(p, prime_len, 1, 1, 1, 0, prime); in crypto_dh_derive_secret() 368 prime, prime_len, secret, len); in crypto_dh_derive_secret()
|
H A D | crypto_gnutls.c | 286 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument 293 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init() 299 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init() 312 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument 323 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret() 338 gcry_mpi_scan(&p, GCRYMPI_FMT_USG, prime, prime_len, in crypto_dh_derive_secret() 354 prime, prime_len, secret, len); in crypto_dh_derive_secret()
|
/freebsd/crypto/openssl/doc/man7/ |
H A D | EVP_PKEY-DH.pod | 12 approved named safe-prime groups, and a class of "FIPS186-type" domain 15 approved safe-prime groups. 36 Sets or gets a string that associates a B<DH> or B<DHX> named safe prime group 70 Used for DH generation of safe primes using the old safe prime generator code. 72 It is recommended to use a named safe prime group instead, if domain parameter 76 for the OpenSSL FIPS provider will instead choose a named safe prime group 105 This specifies that a named safe prime name will be chosen using the "pbits" 110 A safe prime generator. See the "safeprime-generator" type above. 117 Sets the size (in bits) of the prime 'p'. 142 B<DH> parameters with named safe prime group instead. [all …]
|
/freebsd/contrib/wpa/src/eap_common/ |
H A D | eap_pwd_common.c | 139 const struct crypto_bignum *prime; in compute_password_element() local 150 prime = crypto_ec_get_prime(grp->group); in compute_password_element() 153 if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin), in compute_password_element() 164 if (dragonfly_get_random_qr_qnr(prime, &qr, &qnr) < 0 || in compute_password_element() 275 crypto_bignum_sub(prime, y, y) < 0 || in compute_password_element() 407 static int eap_pwd_element_coord_ok(const struct crypto_bignum *prime, in eap_pwd_element_coord_ok() argument 415 crypto_bignum_cmp(val, prime) >= 0) in eap_pwd_element_coord_ok() 426 const struct crypto_bignum *prime; in eap_pwd_get_element() local 429 prime = crypto_ec_get_prime(group->group); in eap_pwd_get_element() 433 if (!eap_pwd_element_coord_ok(prime, buf, prime_len) || in eap_pwd_get_element() [all …]
|
/freebsd/crypto/openssl/doc/man3/ |
H A D | BN_generate_prime.pod | 63 BN_generate_prime_ex2() generates a pseudo-random prime number of 67 The returned number is probably prime with a negligible error. 69 It's 2^-287 for a 512 bit prime, 2^-435 for a 1024 bit prime, 70 2^-648 for a 2048 bit prime, and lower than 2^-882 for primes larger 73 If B<add> is B<NULL> the returned prime number will have exact bit 85 potential prime number. 94 When a prime has been found, B<BN_GENCB_call(cb, 2, i)> is called. 103 The prime may have to fulfill additional requirements for use in 106 If B<add> is not B<NULL>, the prime will fulfill the condition p % B<add> 110 If B<safe> is true, it will be a safe prime (i.e. a prime p so [all …]
|
H A D | DH_generate_parameters.pod | 49 B<prime_len> is the length in bits of the safe prime to be generated. 54 called as described in L<BN_generate_prime(3)> while a random prime 55 number is generated, and when a prime has been found, B<BN_GENCB_call(cb, 3, 0)> 75 The parameter B<p> has been determined to not being an odd prime. 77 prime. 83 suitable, unless B<p> is known to be a strong prime. 103 The parameter B<p> is not prime. 107 The parameter B<p> is not a safe prime and no B<q> value is present. 119 The parameter B<q> is not prime.
|
H A D | RSA_generate_key.pod | 37 RSA_generate_key_ex() generates a 2-prime RSA key pair and stores it in the 40 RSA_generate_multi_prime_key() generates a multi-prime RSA key pair and stores 71 While a random prime number is generated, it is called as 76 When the n-th randomly generated prime is rejected as not 81 When a random p has been found with p-1 relatively prime to I<e>, 86 The process is then repeated for prime q and other primes (if any) 87 with I<BN_GENCB_call(cb, 3, i)> where I<i> indicates the i-th prime.
|
H A D | RSA_get0_key.pod | 68 For multi-prime RSA (defined in RFC 8017), there are also one or more 70 and B<t>. B<r> is the additional prime besides B<p> and B<q>. B<d> and 99 For multi-prime RSA, RSA_get0_multi_prime_factors() and RSA_get0_multi_prime_params() 102 sets a collect of multi-prime 'triplet' members (prime, exponent and coefficient) 138 RSA_set0_multi_prime_params() always clears the original multi-prime 158 multi-prime RSA. 160 RSA_get_version() returns B<RSA_ASN1_VERSION_MULTI> for multi-prime RSA and 161 B<RSA_ASN1_VERSION_DEFAULT> for normal two-prime RSA, as defined in RFC 8017.
|
H A D | DH_size.pod | 5 DH_size, DH_bits, DH_security_bits - get Diffie-Hellman prime size and 32 DH_size() returns the Diffie-Hellman prime size in bytes. It can be used 44 DH_size() returns the prime size of Diffie-Hellman in bytes, or -1 if
|
H A D | DSA_generate_parameters.pod | 37 B<bits> is the length of the prime p to be generated. 71 (once for each witness that confirms that the candidate may be prime); 76 When a prime q has been found, B<BN_GENCB_call(cb, 2, 0)> and 90 (once for each witness that confirms that the candidate may be prime).
|
/freebsd/crypto/openssl/crypto/rsa/ |
H A D | rsa_gen.c | 78 BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *tmp, *prime; in rsa_multiprime_keygen() local 180 prime = rsa->p; in rsa_multiprime_keygen() 182 prime = rsa->q; in rsa_multiprime_keygen() 185 prime = pinfo->r; in rsa_multiprime_keygen() 187 BN_set_flags(prime, BN_FLG_CONSTTIME); in rsa_multiprime_keygen() 191 if (!BN_generate_prime_ex2(prime, bitsr[i] + adj, 0, NULL, NULL, in rsa_multiprime_keygen() 212 if (!BN_cmp(prime, prev_prime)) { in rsa_multiprime_keygen() 217 if (!BN_sub(r2, prime, BN_value_one())) in rsa_multiprime_keygen() 246 if (!BN_mul(r1, rsa->n, prime, ctx)) in rsa_multiprime_keygen()
|
/freebsd/contrib/unbound/services/ |
H A D | mesh.h | 397 uint16_t qflags, int prime, int valrec, struct module_qstate** newq); 425 uint16_t qflags, int prime, int valrec, struct module_qstate** newq, 481 uint16_t qflags, int prime, int valrec); 518 uint16_t qflags, int prime, int valrec); 614 uint16_t flags, int prime, int valrec);
|
/freebsd/contrib/unbound/util/ |
H A D | fptr_wlist.h | 236 uint16_t qflags, int prime, int valrec, struct module_qstate** newq)); 245 struct query_info* qinfo, uint16_t qflags, int prime, int valrec, 263 uint16_t flags, int prime, int valrec));
|
/freebsd/crypto/openssh/ |
H A D | dh.c | 64 char *strsize, *gen, *prime; in parse_prime() local 120 prime = strsep(&cp, " "); /* prime */ in parse_prime() 121 if (cp != NULL || *prime == '\0') { in parse_prime() 136 if (BN_hex2bn(&dhg->p, prime) == 0) { in parse_prime()
|
H A D | kexgex.c | 55 const BIGNUM *prime, in kexgex_hash() argument 82 (r = sshbuf_put_bignum2(b, prime)) != 0 || in kexgex_hash()
|
/freebsd/crypto/openssl/doc/internal/man3/ |
H A D | ossl_rsa_get0_all_params.pod | 40 if the B<RSA> object is a multi-prime RSA key. 45 if the B<RSA> object is a multi-prime RSA key. 50 if the B<RSA> object is a multi-prime RSA key.
|