From 371103dae8b97264471e17de1989199ffcd2718e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 18 May 2018 11:05:20 +0200 Subject: crypto: add scrypt() and scryptSync() methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scrypt is a password-based key derivation function that is designed to be expensive both computationally and memory-wise in order to make brute-force attacks unrewarding. OpenSSL has had support for the scrypt algorithm since v1.1.0. Add a Node.js API modeled after `crypto.pbkdf2()` and `crypto.pbkdf2Sync()`. Changes: * Introduce helpers for copying buffers, collecting openssl errors, etc. * Add new infrastructure for offloading crypto to a worker thread. * Add a `AsyncWrap` JS class to simplify pbkdf2(), randomBytes() and scrypt(). Fixes: https://github.com/nodejs/node/issues/8417 PR-URL: https://github.com/nodejs/node/pull/20816 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/async_wrap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/async_wrap.h') diff --git a/src/async_wrap.h b/src/async_wrap.h index b2f96477b4..f696facd48 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -75,6 +75,7 @@ namespace node { #define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ V(PBKDF2REQUEST) \ V(RANDOMBYTESREQUEST) \ + V(SCRYPTREQUEST) \ V(TLSWRAP) #else #define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) -- cgit v1.2.3