Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-crypto-hkdf

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-crypto-hkdf - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

14

dist/hkdf.js

@@ -74,22 +74,18 @@ "use strict";

return __awaiter(void 0, void 0, void 0, function () {
var webCrypto, msCrypto, key, masterObj, hkdfCtrParams, e_1;
var env, key, masterObj, hkdfCtrParams, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
webCrypto = util.getWebCrypto();
msCrypto = util.getMsCrypto();
env = util.getCrypto();
if (!salt)
salt = js_crypto_random_1.default.getRandomBytes(length);
if (!(typeof webCrypto !== 'undefined'
&& typeof webCrypto.importKey === 'function'
&& typeof webCrypto.deriveBits === 'function'
&& typeof msCrypto === 'undefined')) return [3 /*break*/, 7];
if (!(env.name === 'webCrypto' && typeof env.crypto.importKey === 'function' && typeof env.crypto.deriveBits === 'function')) return [3 /*break*/, 7];
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 6]);
return [4 /*yield*/, webCrypto.importKey('raw', master, { name: 'HKDF' }, false, ['deriveKey', 'deriveBits'])];
return [4 /*yield*/, env.crypto.importKey('raw', master, { name: 'HKDF' }, false, ['deriveKey', 'deriveBits'])];
case 2:
masterObj = _a.sent();
hkdfCtrParams = { name: 'HKDF', salt: salt, info: js_encoding_utils_1.default.encoder.stringToArrayBuffer(info), hash: hash };
return [4 /*yield*/, webCrypto.deriveBits(hkdfCtrParams, masterObj, length * 8)];
return [4 /*yield*/, env.crypto.deriveBits(hkdfCtrParams, masterObj, length * 8)];
case 3:

@@ -96,0 +92,0 @@ key = _a.sent();

{
"name": "js-crypto-hkdf",
"version": "0.7.1",
"version": "0.7.2",
"description": "Universal Module for HKDF (Hash-based Key Derivation Function) in JavaScript",

@@ -41,7 +41,7 @@ "main": "dist/index.js",

"dependencies": {
"js-crypto-env": "^0.3.0",
"js-crypto-hmac": "^0.6.1",
"js-crypto-random": "^0.4.1",
"js-crypto-env": "^0.3.1",
"js-crypto-hmac": "^0.6.2",
"js-crypto-random": "^0.4.2",
"js-encoding-utils": "0.5.6"
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc