ton-crypto
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -8,3 +8,3 @@ export { sha256 } from './primitives/sha256'; | ||
export { wordlist as mnemonicWordList } from './mnemonic/wordlist'; | ||
export { KeyPair, sealBox, openBox } from './primitives/nacl'; | ||
export { KeyPair, sealBox, openBox, keyPairFromSeed } from './primitives/nacl'; | ||
export { keyPairFromSecretKey, sign } from './primitives/nacl'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sign = exports.keyPairFromSecretKey = exports.openBox = exports.sealBox = exports.mnemonicWordList = exports.mnemonicToSeed = exports.mnemonicToWalletKey = exports.mnemonicToPrivateKey = exports.mnemonicValidate = exports.mnemonicNew = exports.getSecureRandomWords = exports.getSecureRandomBytes = exports.hmac_sha512 = exports.pbkdf2_sha512 = exports.sha512 = exports.sha256 = void 0; | ||
exports.sign = exports.keyPairFromSecretKey = exports.keyPairFromSeed = exports.openBox = exports.sealBox = exports.mnemonicWordList = exports.mnemonicToSeed = exports.mnemonicToWalletKey = exports.mnemonicToPrivateKey = exports.mnemonicValidate = exports.mnemonicNew = exports.getSecureRandomWords = exports.getSecureRandomBytes = exports.hmac_sha512 = exports.pbkdf2_sha512 = exports.sha512 = exports.sha256 = void 0; | ||
var sha256_1 = require("./primitives/sha256"); | ||
@@ -26,4 +26,5 @@ Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha256_1.sha256; } }); | ||
Object.defineProperty(exports, "openBox", { enumerable: true, get: function () { return nacl_1.openBox; } }); | ||
Object.defineProperty(exports, "keyPairFromSeed", { enumerable: true, get: function () { return nacl_1.keyPairFromSeed; } }); | ||
var nacl_2 = require("./primitives/nacl"); | ||
Object.defineProperty(exports, "keyPairFromSecretKey", { enumerable: true, get: function () { return nacl_2.keyPairFromSecretKey; } }); | ||
Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return nacl_2.sign; } }); |
@@ -7,4 +7,5 @@ /// <reference types="node" /> | ||
export declare function keyPairFromSecretKey(secretKey: Buffer): KeyPair; | ||
export declare function keyPairFromSeed(secretKey: Buffer): KeyPair; | ||
export declare function sign(data: Buffer, secretKey: Buffer): Buffer; | ||
export declare function sealBox(data: Buffer, nonce: Buffer, key: Buffer): Buffer; | ||
export declare function openBox(data: Buffer, nonce: Buffer, key: Buffer): Buffer | null; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.openBox = exports.sealBox = exports.sign = exports.keyPairFromSecretKey = void 0; | ||
exports.openBox = exports.sealBox = exports.sign = exports.keyPairFromSeed = exports.keyPairFromSecretKey = void 0; | ||
const tweetnacl_1 = __importDefault(require("tweetnacl")); | ||
@@ -17,2 +17,10 @@ function keyPairFromSecretKey(secretKey) { | ||
exports.keyPairFromSecretKey = keyPairFromSecretKey; | ||
function keyPairFromSeed(secretKey) { | ||
let res = tweetnacl_1.default.sign.keyPair.fromSeed(new Uint8Array(secretKey)); | ||
return { | ||
publicKey: Buffer.from(res.publicKey), | ||
secretKey: Buffer.from(res.secretKey), | ||
}; | ||
} | ||
exports.keyPairFromSeed = keyPairFromSeed; | ||
function sign(data, secretKey) { | ||
@@ -19,0 +27,0 @@ return Buffer.from(tweetnacl_1.default.sign.detached(new Uint8Array(data), new Uint8Array(secretKey))); |
{ | ||
"name": "ton-crypto", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"repository": "https://github.com/ex3ndr/ton-crypto.git", | ||
@@ -5,0 +5,0 @@ "author": "Steve Korshakov <steve@korshakov.com>", |
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
46921
602