feat: Implement core chat application UI, including chat, voice, members, DMs, and shared components.
Some checks failed
Build and Release / build-and-release (push) Failing after 0s
Some checks failed
Build and Release / build-and-release (push) Failing after 0s
This commit is contained in:
@@ -174,9 +174,27 @@ async function decryptBatch(items) {
|
||||
}));
|
||||
}
|
||||
|
||||
// --- Ed25519 Support Detection ---
|
||||
|
||||
let ed25519Supported = null;
|
||||
async function checkEd25519Support() {
|
||||
if (ed25519Supported !== null) return ed25519Supported;
|
||||
try {
|
||||
await crypto.subtle.generateKey('Ed25519', false, ['sign', 'verify']);
|
||||
ed25519Supported = true;
|
||||
} catch {
|
||||
ed25519Supported = false;
|
||||
}
|
||||
return ed25519Supported;
|
||||
}
|
||||
|
||||
// --- Batch Verify ---
|
||||
|
||||
async function verifyBatch(items) {
|
||||
const supported = await checkEd25519Support();
|
||||
if (!supported) {
|
||||
return items.map(() => ({ success: true, verified: null }));
|
||||
}
|
||||
return Promise.all(items.map(async ({ publicKey, message, signature }) => {
|
||||
try {
|
||||
const verified = await verifySignature(publicKey, message, signature);
|
||||
|
||||
Reference in New Issue
Block a user