summaryrefslogtreecommitdiff
path: root/ext/node/lib.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-28 16:26:38 +0530
committerGitHub <noreply@github.com>2023-03-28 10:56:38 +0000
commit10012c2fe312a4f7ddc5217adaa6718c91bfb819 (patch)
treea5e5124a43465e5a5fed4e32771e92356b37aa5f /ext/node/lib.rs
parent67e21e71ce6a9c7d0f261219609de61f6dd0c7a3 (diff)
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.
Diffstat (limited to 'ext/node/lib.rs')
-rw-r--r--ext/node/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/node/lib.rs b/ext/node/lib.rs
index 79ab9ed23..b83a86a5b 100644
--- a/ext/node/lib.rs
+++ b/ext/node/lib.rs
@@ -113,6 +113,10 @@ deno_core::extension!(deno_node,
crypto::op_node_private_encrypt,
crypto::op_node_private_decrypt,
crypto::op_node_public_encrypt,
+ crypto::op_node_check_prime,
+ crypto::op_node_check_prime_async,
+ crypto::op_node_check_prime_bytes,
+ crypto::op_node_check_prime_bytes_async,
crypto::op_node_pbkdf2,
crypto::op_node_pbkdf2_async,
winerror::op_node_sys_to_uv_error,