diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-08-26 16:18:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 12:48:07 +0200 |
commit | 23a9bc099d21ef7d45fe0f76e2fc53740ca98f6a (patch) | |
tree | 1fffaf83c0b6582acf33b042275e1b792a42e3e1 /ext/crypto/01_webidl.js | |
parent | 5d7d9d64434bd0a9f1fcf391dabc51693e8cf1ae (diff) |
feat(ext/crypto): implement importKey and deriveBits for PBKDF2 (#11642)
Diffstat (limited to 'ext/crypto/01_webidl.js')
-rw-r--r-- | ext/crypto/01_webidl.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/crypto/01_webidl.js b/ext/crypto/01_webidl.js index 4216cb524..43bc5e822 100644 --- a/ext/crypto/01_webidl.js +++ b/ext/crypto/01_webidl.js @@ -178,6 +178,29 @@ webidl.converters.HmacImportParams = webidl .createDictionaryConverter("HmacImportParams", dictHmacImportParams); + const dictPbkdf2Params = [ + ...dictAlgorithm, + { + key: "hash", + converter: webidl.converters.HashAlgorithmIdentifier, + required: true, + }, + { + key: "iterations", + converter: (V, opts) => + webidl.converters["unsigned long"](V, { ...opts, enforceRange: true }), + required: true, + }, + { + key: "salt", + converter: webidl.converters["BufferSource"], + required: true, + }, + ]; + + webidl.converters.Pbkdf2Params = webidl + .createDictionaryConverter("Pbkdf2Params", dictPbkdf2Params); + webidl.converters.CryptoKey = webidl.createInterfaceConverter( "CryptoKey", CryptoKey, |