77 CredentialType ,
88 DatabaseKey ,
99 type HistorySecret ,
10- MlsTransportData ,
10+ type MlsTransportData ,
1111 type GroupInfoBundle ,
1212 type MlsTransport ,
1313 type MlsTransportResponse ,
@@ -27,7 +27,7 @@ const CC_INSTANCES: CoreCrypto[] = [];
2727const logLevel = Number ( process . env [ "CC_TEST_LOG_LEVEL" ] || "0" ) ;
2828
2929const DEFAULT_CIPHERSUITE =
30- Ciphersuite . MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519 ;
30+ Ciphersuite . Mls128Dhkemx25519Chacha20poly1305Sha256Ed25519 ;
3131
3232interface DeliveryService extends MlsTransport {
3333 getLatestCommitBundle : ( ) => Promise < CommitBundle > ;
@@ -49,7 +49,7 @@ class TestDeliveryService implements DeliveryService {
4949
5050 prepareForTransport ( secret : HistorySecret ) : Promise < MlsTransportData > {
5151 return Promise . resolve (
52- new MlsTransportData ( secret . clientId . copyBytes ( ) )
52+ secret . clientId . copyBytes ( )
5353 ) ;
5454 }
5555
@@ -94,12 +94,12 @@ export async function teardown() {
9494 */
9595export async function ccInit ( clientName : string ) : Promise < CoreCrypto > {
9696 const encoder = new TextEncoder ( ) ;
97- const clientId = new ClientId ( encoder . encode ( clientName ) ) ;
97+ const clientId = new ClientId ( encoder . encode ( clientName ) . buffer ) ;
9898
9999 const key = new Uint8Array ( 32 ) ;
100100 crypto . getRandomValues ( key ) ;
101101
102- const database = await openDatabase ( clientName , new DatabaseKey ( key ) ) ;
102+ const database = await openDatabase ( clientName , new DatabaseKey ( key . buffer ) ) ;
103103
104104 const instance = await CoreCrypto . init ( database ) ;
105105 await instance . transaction ( async ( ctx ) => {
@@ -177,8 +177,8 @@ export async function roundTripMessage(
177177 cc1 : CoreCrypto ,
178178 cc2 : CoreCrypto ,
179179 conversationId : ConversationId ,
180- message : Uint8Array
181- ) : Promise < ( Uint8Array | null ) [ ] > {
180+ message : ArrayBuffer
181+ ) : Promise < ( ArrayBuffer | null ) [ ] > {
182182 const encryptedByClient1 = await cc1 . transaction ( async ( ctx ) => {
183183 return await ctx . encryptMessage ( conversationId , message ) ;
184184 } ) ;
@@ -216,7 +216,7 @@ export async function proteusInit(clientName: string): Promise<CoreCrypto> {
216216 const key = new Uint8Array ( 32 ) ;
217217 crypto . getRandomValues ( key ) ;
218218
219- const database = await openDatabase ( clientName , new DatabaseKey ( key ) ) ;
219+ const database = await openDatabase ( clientName , new DatabaseKey ( key . buffer ) ) ;
220220
221221 const instance = await CoreCrypto . init ( database ) ;
222222 await instance . transaction ( async ( ctx ) => {
@@ -271,8 +271,8 @@ export async function newProteusSessionFromMessage(
271271 cc1 : CoreCrypto ,
272272 cc2 : CoreCrypto ,
273273 sessionId : string ,
274- messageBytes : Uint8Array
275- ) : Promise < Uint8Array > {
274+ messageBytes : ArrayBuffer
275+ ) : Promise < ArrayBuffer > {
276276 const encrypted = await cc1 . transaction ( async ( ctx ) => {
277277 return await ctx . proteusEncrypt ( sessionId , messageBytes ) ;
278278 } ) ;
0 commit comments