@taquito/signer
Advanced tools
Comparing version 6.4.0-ledger.0 to 7.0.0-beta.pre.0
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +13,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
@@ -7,7 +7,9 @@ (function (global, factory) { | ||
sodium = sodium && Object.prototype.hasOwnProperty.call(sodium, 'default') ? sodium['default'] : sodium; | ||
toBuffer = toBuffer && Object.prototype.hasOwnProperty.call(toBuffer, 'default') ? toBuffer['default'] : toBuffer; | ||
elliptic = elliptic && Object.prototype.hasOwnProperty.call(elliptic, 'default') ? elliptic['default'] : elliptic; | ||
pbkdf2 = pbkdf2 && Object.prototype.hasOwnProperty.call(pbkdf2, 'default') ? pbkdf2['default'] : pbkdf2; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var sodium__default = /*#__PURE__*/_interopDefaultLegacy(sodium); | ||
var toBuffer__default = /*#__PURE__*/_interopDefaultLegacy(toBuffer); | ||
var elliptic__default = /*#__PURE__*/_interopDefaultLegacy(elliptic); | ||
var pbkdf2__default = /*#__PURE__*/_interopDefaultLegacy(pbkdf2); | ||
/*! ***************************************************************************** | ||
@@ -94,7 +96,7 @@ Copyright (c) Microsoft Corporation. | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, sodium.ready]; | ||
case 0: return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 1: | ||
_b.sent(); | ||
if (this._key.length !== 64) { | ||
_a = sodium.crypto_sign_seed_keypair(new Uint8Array(this._key), 'uint8array'), publicKey = _a.publicKey, privateKey = _a.privateKey; | ||
_a = sodium__default['default'].crypto_sign_seed_keypair(new Uint8Array(this._key), 'uint8array'), publicKey = _a.publicKey, privateKey = _a.privateKey; | ||
this._publicKey = publicKey; | ||
@@ -121,4 +123,4 @@ this._key = privateKey; | ||
_a.sent(); | ||
signature = sodium.crypto_sign_detached(new Uint8Array(bytesHash), new Uint8Array(this._key)); | ||
signatureBuffer = toBuffer(signature); | ||
signature = sodium__default['default'].crypto_sign_detached(new Uint8Array(bytesHash), new Uint8Array(this._key)); | ||
signatureBuffer = toBuffer__default['default'](signature); | ||
sbytes = bytes + utils.buf2hex(signatureBuffer); | ||
@@ -160,6 +162,6 @@ return [2 /*return*/, { | ||
_a.sent(); | ||
return [4 /*yield*/, sodium.ready]; | ||
return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 2: | ||
_a.sent(); | ||
return [2 /*return*/, utils.b58cencode(sodium.crypto_generichash(20, new Uint8Array(this._publicKey)), utils.prefix.tz1)]; | ||
return [2 /*return*/, utils.b58cencode(sodium__default['default'].crypto_generichash(20, new Uint8Array(this._publicKey)), utils.prefix.tz1)]; | ||
} | ||
@@ -180,8 +182,8 @@ }); | ||
_a.sent(); | ||
return [4 /*yield*/, sodium.ready]; | ||
return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 2: | ||
_a.sent(); | ||
key = this._key; | ||
privateKey = sodium.crypto_sign_seed_keypair(new Uint8Array(key).slice(0, 32), 'uint8array').privateKey; | ||
key = toBuffer(privateKey); | ||
privateKey = sodium__default['default'].crypto_sign_seed_keypair(new Uint8Array(key).slice(0, 32), 'uint8array').privateKey; | ||
key = toBuffer__default['default'](privateKey); | ||
return [2 /*return*/, utils.b58cencode(key, utils.prefix["edsk"])]; | ||
@@ -228,6 +230,6 @@ } | ||
this._key = decrypt(utils.b58cdecode(this.key, utils.prefix[keyPrefix])); | ||
var keyPair = new elliptic.ec(this.curve).keyFromPrivate(this._key); | ||
var keyPair = new elliptic__default['default'].ec(this.curve).keyFromPrivate(this._key); | ||
var pref = keyPair.getPublic().getY().toArray()[31] % 2 ? 3 : 2; | ||
var pad = new Array(32).fill(0); | ||
this._publicKey = toBuffer(new Uint8Array([pref].concat(pad.concat(keyPair.getPublic().getX().toArray()).slice(-32)))); | ||
this._publicKey = toBuffer__default['default'](new Uint8Array([pref].concat(pad.concat(keyPair.getPublic().getX().toArray()).slice(-32)))); | ||
} | ||
@@ -243,3 +245,3 @@ /** | ||
return __generator(this, function (_a) { | ||
key = new elliptic.ec(this.curve).keyFromPrivate(this._key); | ||
key = new elliptic__default['default'].ec(this.curve).keyFromPrivate(this._key); | ||
sig = key.sign(bytesHash, { canonical: true }); | ||
@@ -274,6 +276,6 @@ signature = sig.r.toString('hex', 64) + sig.s.toString('hex', 64); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, sodium.ready]; | ||
case 0: return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, utils.b58cencode(sodium.crypto_generichash(20, new Uint8Array(this._publicKey)), pref[this.curve].pkh)]; | ||
return [2 /*return*/, utils.b58cencode(sodium__default['default'].crypto_generichash(20, new Uint8Array(this._publicKey)), pref[this.curve].pkh)]; | ||
} | ||
@@ -389,6 +391,6 @@ }); | ||
decrypt = function (constructedKey) { | ||
var salt = toBuffer(constructedKey.slice(0, 8)); | ||
var salt = toBuffer__default['default'](constructedKey.slice(0, 8)); | ||
var encryptedSk = constructedKey.slice(8); | ||
var encryptionKey = pbkdf2.pbkdf2Sync(passphrase, salt, 32768, 32, 'sha512'); | ||
return sodium.crypto_secretbox_open_easy(new Uint8Array(encryptedSk), new Uint8Array(24), new Uint8Array(encryptionKey)); | ||
var encryptionKey = pbkdf2__default['default'].pbkdf2Sync(passphrase, salt, 32768, 32, 'sha512'); | ||
return sodium__default['default'].crypto_secretbox_open_easy(new Uint8Array(encryptedSk), new Uint8Array(24), new Uint8Array(encryptionKey)); | ||
}; | ||
@@ -422,3 +424,3 @@ } | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, sodium.ready]; | ||
case 0: return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 1: | ||
@@ -447,7 +449,7 @@ _a.sent(); | ||
// Ensure sodium is ready before calling crypto_generichash otherwise the function do not exists | ||
return [4 /*yield*/, sodium.ready]; | ||
return [4 /*yield*/, sodium__default['default'].ready]; | ||
case 1: | ||
// Ensure sodium is ready before calling crypto_generichash otherwise the function do not exists | ||
_a.sent(); | ||
bytesHash = toBuffer(sodium.crypto_generichash(32, bb)); | ||
bytesHash = toBuffer__default['default'](sodium__default['default'].crypto_generichash(32, bb)); | ||
return [2 /*return*/, this._key.sign(bytes, bytesHash)]; | ||
@@ -454,0 +456,0 @@ } |
{ | ||
"name": "@taquito/signer", | ||
"version": "6.4.0-ledger.0", | ||
"version": "7.0.0-beta.pre.0", | ||
"description": "Provide signing functionality to be with taquito", | ||
@@ -69,4 +69,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@taquito/utils": "^6.4.0-ledger.0", | ||
"bignumber.js": "^9.0.0", | ||
"@taquito/utils": "^7.0.0-beta.pre.0", | ||
"bignumber.js": "^9.0.1", | ||
"bip39": "^3.0.2", | ||
@@ -80,5 +80,5 @@ "elliptic": "^6.5.3", | ||
"@types/elliptic": "^6.4.12", | ||
"@types/jest": "^26.0.8", | ||
"@types/libsodium-wrappers": "^0.7.7", | ||
"@types/node": "^14.0.27", | ||
"@types/jest": "^26.0.14", | ||
"@types/libsodium-wrappers": "^0.7.8", | ||
"@types/node": "^14.11.5", | ||
"@types/pbkdf2": "^3.1.0", | ||
@@ -88,24 +88,24 @@ "colors": "^1.4.0", | ||
"cross-env": "^7.0.2", | ||
"jest": "^26.2.2", | ||
"jest-config": "^26.2.2", | ||
"lint-staged": "^10.2.11", | ||
"jest": "^26.5.2", | ||
"jest-config": "^26.5.2", | ||
"lint-staged": "^10.4.0", | ||
"lodash.camelcase": "^4.3.0", | ||
"prettier": "^2.0.5", | ||
"prettier": "^2.1.2", | ||
"prompt": "^1.0.0", | ||
"replace-in-file": "^6.1.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.23.0", | ||
"rollup": "^2.28.2", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.2", | ||
"rollup-plugin-typescript2": "^0.27.1", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"rollup-plugin-typescript2": "^0.27.3", | ||
"shelljs": "^0.8.4", | ||
"ts-jest": "^26.1.4", | ||
"ts-node": "^8.10.2", | ||
"ts-jest": "^26.4.1", | ||
"ts-node": "^9.0.0", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typedoc": "^0.17.8", | ||
"typescript": "~3.9.7" | ||
"typedoc": "^0.19.2", | ||
"typescript": "^4.0.3" | ||
}, | ||
"gitHead": "551e35aeff7d6dcde1c72284238c0ed3c3aae77e" | ||
"gitHead": "15d0c13c52267818a25b0a1408f3e8a9a7b30538" | ||
} |
@@ -25,7 +25,7 @@ { | ||
"path": "dist/lib/taquito-signer.js", | ||
"sha512": "50382791406652a34d9f42eb8e6eef94131e24a4bb6533b47825f54cabef96f519352ce80a7b3fa8b0dc3e9d6781d5eff7cc15adfd977f4fddebbcc909a80836" | ||
"sha512": "8393ae84654047172e7425c38a657ea1947e6ef7fdc61cd03cf2dbdce23a47f3cae7db277b067c2acaab1036be53a3729f2949daea5f289b7cd500e1113ae2ad" | ||
}, | ||
{ | ||
"path": "dist/taquito-signer.umd.js", | ||
"sha512": "2174536ce51f4b1f31d56d0b0d61e3d5c158c535b1e52d2a7c3bb8d391cef98e41dfb4ba88397f62338973a1d16adfc586db4fb41d89dc1d1ca68ffa85966d7e" | ||
"sha512": "cb78a93ca519f8e1a05f573326fd7cf966db4eb5a5366dc48403ddd0c7480a7a5527debbbd72d14e32923df620354e03164b7357dba5acc9003cc35c939f07b9" | ||
}, | ||
@@ -54,3 +54,3 @@ { | ||
"path": "dist/taquito-signer.umd.js.map", | ||
"sha512": "5f678308c6032be3c1d5f296a840d1c216c454a49d1864fd8dab97e497cbb97e2843f58ae214b574cc35f7a7f6708b0f3f4b9256dc9e5454ee40303712165800" | ||
"sha512": "ed5c6213c076235ace3c0eb37eec7aad5c3ad85bcd086277361ab1b98781b4755ba4adfd612d1a2557599b127e4e3f53e80acf0468e03d49938aa38766343014" | ||
}, | ||
@@ -94,2 +94,3 @@ { | ||
"files", | ||
"gitHead", | ||
"jest", | ||
@@ -108,3 +109,3 @@ "keywords", | ||
], | ||
"sha512": "75ac66dc131d7c239afb08bc26efec9d2a992bb8c74ccec2203892e2dbe784eed9ba9a2b19d38ffb04b185ad63ce28f2b3be4893cb94b960d9e93d0ebbbef46a" | ||
"sha512": "12eda1756753a0af5cf7db64ea6620f4e92f4da0ee4b078bccd34c6afcf07cf5a4ce76a9446cadcdbbfe196e589a38b02b576567c26c92360b8a61583a1aa553" | ||
} | ||
@@ -117,3 +118,3 @@ }, | ||
"name": "@taquito/signer", | ||
"version": "6.4.0-ledger.0", | ||
"version": "7.0.0-beta.pre.0", | ||
"description": "Provide signing functionality to be with taquito", | ||
@@ -184,4 +185,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@taquito/utils": "^6.4.0-ledger.0", | ||
"bignumber.js": "^9.0.0", | ||
"@taquito/utils": "^7.0.0-beta.pre.0", | ||
"bignumber.js": "^9.0.1", | ||
"bip39": "^3.0.2", | ||
@@ -195,5 +196,5 @@ "elliptic": "^6.5.3", | ||
"@types/elliptic": "^6.4.12", | ||
"@types/jest": "^26.0.8", | ||
"@types/libsodium-wrappers": "^0.7.7", | ||
"@types/node": "^14.0.27", | ||
"@types/jest": "^26.0.14", | ||
"@types/libsodium-wrappers": "^0.7.8", | ||
"@types/node": "^14.11.5", | ||
"@types/pbkdf2": "^3.1.0", | ||
@@ -203,23 +204,24 @@ "colors": "^1.4.0", | ||
"cross-env": "^7.0.2", | ||
"jest": "^26.2.2", | ||
"jest-config": "^26.2.2", | ||
"lint-staged": "^10.2.11", | ||
"jest": "^26.5.2", | ||
"jest-config": "^26.5.2", | ||
"lint-staged": "^10.4.0", | ||
"lodash.camelcase": "^4.3.0", | ||
"prettier": "^2.0.5", | ||
"prettier": "^2.1.2", | ||
"prompt": "^1.0.0", | ||
"replace-in-file": "^6.1.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.23.0", | ||
"rollup": "^2.28.2", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.2", | ||
"rollup-plugin-typescript2": "^0.27.1", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"rollup-plugin-typescript2": "^0.27.3", | ||
"shelljs": "^0.8.4", | ||
"ts-jest": "^26.1.4", | ||
"ts-node": "^8.10.2", | ||
"ts-jest": "^26.4.1", | ||
"ts-node": "^9.0.0", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typedoc": "^0.17.8", | ||
"typescript": "~3.9.7" | ||
} | ||
"typedoc": "^0.19.2", | ||
"typescript": "^4.0.3" | ||
}, | ||
"gitHead": "551e35aeff7d6dcde1c72284238c0ed3c3aae77e" | ||
} | ||
@@ -229,3 +231,3 @@ } | ||
], | ||
"signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJfMhK5CRAD9Qy5GYHsngAA1voQAAj1XTLA4TB/EeLyt3rEoFpO\nmo09HjE5ezj6DCL+fiobrFA+w+BjA4lo6O4KAM0jqsgX/weBFdWte/Ztjckap5yo\nWB600DTFYeXt+WQLBFzwOHAgHrCJNq8zAN2giN4qBF8VaL8zTTqCTsYUl4JZJHWh\nninUGaCs16jI2O7kAFF7m5/PzHM/UaSyV/FaAdgdaewQtJPJnfO9JwzFJniG6jHp\nEeoVb7OcODgMnuX3eFvKussWCzggQzaql7v3HckaiNf898BNpL9pD6AOHu1tIbBr\nkUDM4QQRsfLRC7pod76jzAvQgsQhPT3SDIShJKVlePHjEQAGfQtfeOKyenh3CMQf\nfXSYX3vLItMVDg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Qm4gSNCD3PMSk9a0TN7SLJBwc8kJKkCL6tBkVGX1k\nmhqmxFA8N1ATUALIdHln\n=pwPI\n-----END PGP SIGNATURE-----\n" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136803
1912
+ Added@taquito/utils@7.0.0-beta-RC.0(transitive)
- Removed@taquito/utils@6.4.0-ledger.0(transitive)
Updatedbignumber.js@^9.0.1