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

@cosmjs/crypto

Package Overview
Dependencies
Maintainers
2
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/crypto - npm Package Compare versions

Comparing version 0.25.2 to 0.25.3

1

build/bip39.d.ts

@@ -21,3 +21,2 @@ import { EnglishMnemonic } from "./englishmnemonic";

static mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise<Uint8Array>;
private static pbkdf2;
}

@@ -25,4 +25,2 @@ "use strict";

const bip39 = __importStar(require("bip39"));
const pbkdf2_1 = require("pbkdf2");
const unorm = __importStar(require("unorm"));
const englishmnemonic_1 = require("./englishmnemonic");

@@ -56,24 +54,6 @@ class Bip39 {

static async mnemonicToSeed(mnemonic, password) {
// reimplementation of bip39.mnemonicToSeed using the asynchronous
// interface of https://www.npmjs.com/package/pbkdf2
const mnemonicBytes = encoding_1.toUtf8(unorm.nfkd(mnemonic.toString()));
const salt = "mnemonic" + (password ? unorm.nfkd(password) : "");
const saltBytes = encoding_1.toUtf8(salt);
return this.pbkdf2(mnemonicBytes, saltBytes, 2048, 64, "sha512");
return new Uint8Array(await bip39.mnemonicToSeed(mnemonic.toString(), password));
}
// convert pbkdf2's callback interface to Promise interface
static async pbkdf2(secret, salt, iterations, keylen, digest) {
return new Promise((resolve, reject) => {
pbkdf2_1.pbkdf2(secret, salt, iterations, keylen, digest, (err, derivedKey) => {
if (err) {
reject(err);
}
else {
resolve(new Uint8Array(derivedKey));
}
});
});
}
}
exports.Bip39 = Bip39;
//# sourceMappingURL=bip39.js.map

18

package.json
{
"name": "@cosmjs/crypto",
"version": "0.25.2",
"version": "0.25.3",
"description": "Cryptography resources for blockchain projects",

@@ -44,5 +44,5 @@ "contributors": [

"dependencies": {
"@cosmjs/encoding": "^0.25.2",
"@cosmjs/math": "^0.25.2",
"@cosmjs/utils": "^0.25.2",
"@cosmjs/encoding": "^0.25.3",
"@cosmjs/math": "^0.25.3",
"@cosmjs/utils": "^0.25.3",
"bip39": "^3.0.2",

@@ -53,6 +53,4 @@ "bn.js": "^4.11.8",

"libsodium-wrappers": "^0.7.6",
"pbkdf2": "^3.1.2",
"ripemd160": "^2.0.2",
"sha.js": "^2.4.11",
"unorm": "^1.5.0"
"sha.js": "^2.4.11"
},

@@ -63,8 +61,6 @@ "devDependencies": {

"@types/libsodium-wrappers": "^0.7.7",
"@types/pbkdf2": "^3.1.0",
"@types/ripemd160": "^2.0.0",
"@types/sha.js": "^2.4.0",
"@types/unorm": "^1.3.27"
"@types/sha.js": "^2.4.0"
},
"gitHead": "dab008f2f524aab5063fdda3ad510376425dc50a"
"gitHead": "ba7fd927d73ea56f85d8ff841282b88e4baeb718"
}

Sorry, the diff of this file is not supported yet

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