🐛 fix: Fixing issues with generating standard and quantum-resistant encryption keys

This commit is contained in:
web
2025-11-04 20:40:53 -08:00
parent 2182400adc
commit 5eac6a9f4a
32 changed files with 142 additions and 32 deletions
@@ -444,7 +444,16 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
placeholder: (t) => t('encryption_private_key_placeholder'),
group: 'encryption',
generate: {
function: generateMLKEM768KeyPair,
functions: [
{
label: (t) => t('generate_standard_encryption_key'),
function: generateRealityKeyPair,
},
{
label: (t) => t('generate_quantum_resistant_key'),
function: generateMLKEM768KeyPair,
},
],
updateFields: {
encryption_private_key: 'privateKey',
encryption_password: 'publicKey',
@@ -12,7 +12,11 @@ export type FieldConfig = {
step?: number;
suffix?: string;
generate?: {
function: () => Promise<string | Record<string, string>> | string | Record<string, string>;
function?: () => Promise<string | Record<string, string>> | string | Record<string, string>;
functions?: {
label: string | ((t: (key: string) => string, protocol: any) => string);
function: () => Promise<string | Record<string, string>> | string | Record<string, string>;
}[];
updateFields?: Record<string, string>;
};
condition?: (protocol: any, values: any) => boolean;