Support for loading, storing, and using kyber keys in decryption
This commit is contained in:
parent
c1580a5eb3
commit
b6445a6af0
49 changed files with 2260 additions and 806 deletions
|
@ -109,21 +109,35 @@ export type MessageType = MessageAttributesType;
|
|||
export type MessageTypeUnhydrated = {
|
||||
json: string;
|
||||
};
|
||||
|
||||
export type PreKeyIdType = `${UUIDStringType}:${number}`;
|
||||
export type KyberPreKeyType = {
|
||||
id: PreKeyIdType;
|
||||
|
||||
createdAt: number;
|
||||
data: Uint8Array;
|
||||
isConfirmed: boolean;
|
||||
isLastResort: boolean;
|
||||
keyId: number;
|
||||
ourUuid: UUIDStringType;
|
||||
};
|
||||
export type StoredKyberPreKeyType = KyberPreKeyType & {
|
||||
data: string;
|
||||
};
|
||||
export type PreKeyType = {
|
||||
id: `${UUIDStringType}:${number}`;
|
||||
id: PreKeyIdType;
|
||||
|
||||
createdAt: number;
|
||||
keyId: number;
|
||||
ourUuid: UUIDStringType;
|
||||
privateKey: Uint8Array;
|
||||
publicKey: Uint8Array;
|
||||
};
|
||||
export type StoredPreKeyType = {
|
||||
id: `${UUIDStringType}:${number}`;
|
||||
keyId: number;
|
||||
ourUuid: UUIDStringType;
|
||||
|
||||
export type StoredPreKeyType = PreKeyType & {
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
};
|
||||
export type PreKeyIdType = PreKeyType['id'];
|
||||
export type ServerSearchResultMessageType = {
|
||||
json: string;
|
||||
|
||||
|
@ -410,16 +424,24 @@ export type DataInterface = {
|
|||
removeIdentityKeyById: (id: IdentityKeyIdType) => Promise<void>;
|
||||
removeAllIdentityKeys: () => Promise<void>;
|
||||
|
||||
removePreKeyById: (id: PreKeyIdType) => Promise<void>;
|
||||
removeKyberPreKeyById: (
|
||||
id: PreKeyIdType | Array<PreKeyIdType>
|
||||
) => Promise<void>;
|
||||
removeKyberPreKeysByUuid: (uuid: UUIDStringType) => Promise<void>;
|
||||
removeAllKyberPreKeys: () => Promise<void>;
|
||||
|
||||
removePreKeyById: (id: PreKeyIdType | Array<PreKeyIdType>) => Promise<void>;
|
||||
removePreKeysByUuid: (uuid: UUIDStringType) => Promise<void>;
|
||||
removeAllPreKeys: () => Promise<void>;
|
||||
|
||||
removeSignedPreKeyById: (id: SignedPreKeyIdType) => Promise<void>;
|
||||
removeSignedPreKeyById: (
|
||||
id: SignedPreKeyIdType | Array<SignedPreKeyIdType>
|
||||
) => Promise<void>;
|
||||
removeSignedPreKeysByUuid: (uuid: UUIDStringType) => Promise<void>;
|
||||
removeAllSignedPreKeys: () => Promise<void>;
|
||||
|
||||
removeAllItems: () => Promise<void>;
|
||||
removeItemById: (id: ItemKeyType) => Promise<void>;
|
||||
removeItemById: (id: ItemKeyType | Array<ItemKeyType>) => Promise<void>;
|
||||
|
||||
createOrUpdateSenderKey: (key: SenderKeyType) => Promise<void>;
|
||||
getSenderKeyById: (id: SenderKeyIdType) => Promise<SenderKeyType | undefined>;
|
||||
|
@ -822,6 +844,13 @@ export type ServerInterface = DataInterface & {
|
|||
bulkAddIdentityKeys: (array: Array<StoredIdentityKeyType>) => Promise<void>;
|
||||
getAllIdentityKeys: () => Promise<Array<StoredIdentityKeyType>>;
|
||||
|
||||
createOrUpdateKyberPreKey: (data: StoredKyberPreKeyType) => Promise<void>;
|
||||
getKyberPreKeyById: (
|
||||
id: PreKeyIdType
|
||||
) => Promise<StoredKyberPreKeyType | undefined>;
|
||||
bulkAddKyberPreKeys: (array: Array<StoredKyberPreKeyType>) => Promise<void>;
|
||||
getAllKyberPreKeys: () => Promise<Array<StoredKyberPreKeyType>>;
|
||||
|
||||
createOrUpdatePreKey: (data: StoredPreKeyType) => Promise<void>;
|
||||
getPreKeyById: (id: PreKeyIdType) => Promise<StoredPreKeyType | undefined>;
|
||||
bulkAddPreKeys: (array: Array<StoredPreKeyType>) => Promise<void>;
|
||||
|
@ -901,6 +930,13 @@ export type ClientExclusiveInterface = {
|
|||
bulkAddIdentityKeys: (array: Array<IdentityKeyType>) => Promise<void>;
|
||||
getAllIdentityKeys: () => Promise<Array<IdentityKeyType>>;
|
||||
|
||||
createOrUpdateKyberPreKey: (data: KyberPreKeyType) => Promise<void>;
|
||||
getKyberPreKeyById: (
|
||||
id: PreKeyIdType
|
||||
) => Promise<KyberPreKeyType | undefined>;
|
||||
bulkAddKyberPreKeys: (array: Array<KyberPreKeyType>) => Promise<void>;
|
||||
getAllKyberPreKeys: () => Promise<Array<KyberPreKeyType>>;
|
||||
|
||||
createOrUpdatePreKey: (data: PreKeyType) => Promise<void>;
|
||||
getPreKeyById: (id: PreKeyIdType) => Promise<PreKeyType | undefined>;
|
||||
bulkAddPreKeys: (array: Array<PreKeyType>) => Promise<void>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue