File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ impl Prime {
2525 /// When `add` is set but `rem` is not:
2626 /// - If safe is false, rem defaults to 1
2727 /// - If safe is true, rem defaults to 3
28+ ///
29+ /// This follows the same algorithm as OpenSSL's BN_generate_prime_ex():
30+ /// generate random candidates in [2^(n-1), 2^n), adjust to satisfy the
31+ /// add/rem constraint, then test with Miller-Rabin. For safe primes,
32+ /// also verify (p-1)/2 is prime.
2833 pub fn generate_with_options (
2934 n : usize ,
3035 safe : bool ,
Original file line number Diff line number Diff line change 412412 "parallel/test-crypto-psychic-signatures.js" : {},
413413 "parallel/test-crypto-randomfillsync-regression.js" : {},
414414 "parallel/test-crypto-randomuuid.js" : {},
415+ "parallel/test-crypto-prime.js" : {},
415416 "parallel/test-crypto-rsa-pss-default-salt-length.js" : {},
416417 "parallel/test-crypto-sec-level.js" : {},
417418 "parallel/test-crypto-secret-keygen.js" : {},
You can’t perform that action at this time.
0 commit comments