From 10012c2fe312a4f7ddc5217adaa6718c91bfb819 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 28 Mar 2023 16:26:38 +0530 Subject: feat(ext/node): add `crypto.checkPrime` API (#18465) Towards #18455 This commit implements `checkPrimeSync` and `checkPrime` in node:crypto using the Miller-Rabin primality test (fun fact: it actually is a test for composite numbers) It first compares the candidate against many known small primes and if not, proceeds to run the Miller-Rabin primality test. http://nickle.org/examples/miller-rabin.5c used as reference implementation. --- cli/tests/node_compat/config.json | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/tests/node_compat/config.json') diff --git a/cli/tests/node_compat/config.json b/cli/tests/node_compat/config.json index b6541c489..90e7edcd4 100644 --- a/cli/tests/node_compat/config.json +++ b/cli/tests/node_compat/config.json @@ -230,6 +230,7 @@ "test-console-sync-write-error.js", "test-console-table.js", "test-crypto-hmac.js", + "test-crypto-prime.js", "test-dgram-close-during-bind.js", "test-dgram-close-signal.js", "test-diagnostics-channel-has-subscribers.js", -- cgit v1.2.3