Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/wa.picotech.app/public_html/node_modules/libsignal/src/ drwxr-xr-x |
Viewing file: Select action/file-type: // vim: ts=4:sw=4:expandtab const curve = require('./curve'); const nodeCrypto = require('crypto'); function isNonNegativeInteger(n) { return (typeof n === 'number' && (n % 1) === 0 && n >= 0); } exports.generateIdentityKeyPair = curve.generateKeyPair; exports.generateRegistrationId = function() { var registrationId = Uint16Array.from(nodeCrypto.randomBytes(2))[0]; return registrationId & 0x3fff; }; exports.generateSignedPreKey = function(identityKeyPair, signedKeyId) { if (!(identityKeyPair.privKey instanceof Buffer) || identityKeyPair.privKey.byteLength != 32 || !(identityKeyPair.pubKey instanceof Buffer) || identityKeyPair.pubKey.byteLength != 33) { throw new TypeError('Invalid argument for identityKeyPair'); } if (!isNonNegativeInteger(signedKeyId)) { throw new TypeError('Invalid argument for signedKeyId: ' + signedKeyId); } const keyPair = curve.generateKeyPair(); const sig = curve.calculateSignature(identityKeyPair.privKey, keyPair.pubKey); return { keyId: signedKeyId, keyPair: keyPair, signature: sig }; }; exports.generatePreKey = function(keyId) { if (!isNonNegativeInteger(keyId)) { throw new TypeError('Invalid argument for keyId: ' + keyId); } const keyPair = curve.generateKeyPair(); return { keyId, keyPair }; }; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0033 ]-- |