ton-crypto
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -8,3 +8,3 @@ export { sha256 } from './primitives/sha256'; | ||
export { wordlist as mnemonicWordList } from './mnemonic/wordlist'; | ||
export { KeyPair } from './primitives/nacl'; | ||
export { KeyPair, sealBox, openBox } from './primitives/nacl'; | ||
export { keyPairFromSecretKey, sign } from './primitives/nacl'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sign = exports.keyPairFromSecretKey = exports.mnemonicWordList = 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.openBox = exports.sealBox = exports.mnemonicWordList = 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"); | ||
@@ -23,3 +23,6 @@ Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha256_1.sha256; } }); | ||
var nacl_1 = require("./primitives/nacl"); | ||
Object.defineProperty(exports, "keyPairFromSecretKey", { enumerable: true, get: function () { return nacl_1.keyPairFromSecretKey; } }); | ||
Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return nacl_1.sign; } }); | ||
Object.defineProperty(exports, "sealBox", { enumerable: true, get: function () { return nacl_1.sealBox; } }); | ||
Object.defineProperty(exports, "openBox", { enumerable: true, get: function () { return nacl_1.openBox; } }); | ||
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; } }); |
@@ -8,1 +8,3 @@ /// <reference types="node" /> | ||
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.sign = exports.keyPairFromSecretKey = void 0; | ||
exports.openBox = exports.sealBox = exports.sign = exports.keyPairFromSecretKey = void 0; | ||
const tweetnacl_1 = __importDefault(require("tweetnacl")); | ||
@@ -21,1 +21,13 @@ function keyPairFromSecretKey(secretKey) { | ||
exports.sign = sign; | ||
function sealBox(data, nonce, key) { | ||
return Buffer.from(tweetnacl_1.default.secretbox(data, nonce, key)); | ||
} | ||
exports.sealBox = sealBox; | ||
function openBox(data, nonce, key) { | ||
let res = tweetnacl_1.default.secretbox.open(data, nonce, key); | ||
if (!res) { | ||
return null; | ||
} | ||
return Buffer.from(res); | ||
} | ||
exports.openBox = openBox; |
{ | ||
"name": "ton-crypto", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"repository": "https://github.com/ex3ndr/ton-crypto.git", | ||
@@ -33,4 +33,4 @@ "author": "Steve Korshakov <steve@korshakov.com>", | ||
"dependencies": { | ||
"tweetnacl": "^1.0.3" | ||
"tweetnacl": "1.0.3" | ||
} | ||
} |
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
45768
586
Updatedtweetnacl@1.0.3