(feat): finish chat crypto migration
(wip): prep for full ECDH repo migration
This commit is contained in:
parent
ecca5241bc
commit
2cd326d0b1
10 changed files with 195 additions and 339 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue