(feat): finish chat crypto migration
Some checks failed
/ build-web (push) Failing after 4m36s
/ build-desktop (linux) (push) Failing after 4m47s
/ build-mobile (push) Failing after 6m34s
/ release (push) Has been skipped

(wip): prep for full ECDH repo migration
This commit is contained in:
Alois 2026-07-06 19:23:37 +02:00
commit 2cd326d0b1
10 changed files with 195 additions and 339 deletions

View file

@ -32,6 +32,12 @@ const chatSecretResponse = z.object({
UpdatedAt: z.number(),
});
const chatSecretRecipient = z.object({
UserId: z.string(),
EncryptedSecret: protocolBytes,
KemCiphertext: protocolBytes,
});
export const Message = z.object({
NotEncrypted: z.boolean().optional(),
SentBySelf: z.boolean().optional(),
@ -267,14 +273,12 @@ export const mtp = {
},
SetChatSecret: {
request: z.object({
UserId: z.string(),
ChatId: z.string(),
SecretId: z.string(),
VersionNumber: z.number(),
EncryptedSecret: protocolBytes,
KemCiphertext: protocolBytes,
WrappingScheme: z.string(),
CreatedAt: z.number(),
Recipients: z.array(chatSecretRecipient).min(1),
}),
response: z.object({}),
},
@ -308,6 +312,10 @@ export const mtp = {
request: z.object({}).optional(),
response: z.object({}),
},
ErrorNotSet: {
request: z.object({}).optional(),
response: z.object({}),
},
} satisfies Record<string, { request: z.ZodType; response: z.ZodType }>;
export type MTP = typeof mtp;