mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
groups key generation bug fix
This commit is contained in:
21
WASignalGroup/keyhelper.js
Normal file
21
WASignalGroup/keyhelper.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const curve = require('libsignal/src/curve');
|
||||
const nodeCrypto = require('crypto');
|
||||
|
||||
exports.generateSenderKey = function() {
|
||||
return nodeCrypto.randomBytes(32);
|
||||
}
|
||||
|
||||
exports.generateSenderKeyId = function() {
|
||||
return nodeCrypto.randomInt(2147483647);
|
||||
}
|
||||
|
||||
exports.generateSenderSigningKey = function(key) {
|
||||
if (!key) {
|
||||
key = curve.generateKeyPair();
|
||||
}
|
||||
|
||||
return {
|
||||
public: key.pubKey,
|
||||
private: key.privKey,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user