UNPKG

@tonappchain/adnl

Version:

ADNL TypeScript implementation

34 lines 880 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ADNLAESParams = void 0; const hash_1 = require("./hash"); const utils_1 = require("@noble/hashes/utils"); class ADNLAESParams { constructor() { this._bytes = new Uint8Array((0, utils_1.randomBytes)(160)); } get bytes() { return new Uint8Array(this._bytes); } get rxKey() { return this.bytes.slice(0, 32); } get txKey() { return this.bytes.slice(32, 64); } get rxNonce() { return this.bytes.slice(64, 80); } get txNonce() { return this.bytes.slice(80, 96); } get padding() { return this.bytes.slice(96, 160); } get hash() { const hash = (0, hash_1.sha256)(this._bytes); return hash; } } exports.ADNLAESParams = ADNLAESParams; //# sourceMappingURL=params.js.map