packages/cryptobox/src/demo/benchmark.js
async function initialSetup() {
  const alice = await createCryptobox('alice', 1);
  await alice.create();

  const bob = await createCryptobox('bob', 1);
  await bob.create();

  const bobBundle = Proteus.keys.PreKeyBundle.new(
    bob.identity.public_key,
    await bob.store.load_prekey(Proteus.keys.PreKey.MAX_PREKEY_ID)
  );

  const cipherMessage = await alice.encrypt(createSessionId(bob), 'Hello', bobBundle.serialise());
  await bob.decrypt(createSessionId(alice), cipherMessage);

  return {alice, bob};
}
async function initialSetup() {
  const alice = await createCryptobox('alice', 1);
  await alice.create();

  const bob = await createCryptobox('bob', 1);
  await bob.create();

  const bobBundle = Proteus.keys.PreKeyBundle.new(
    bob.identity.public_key,
    await bob.store.load_prekey(Proteus.keys.PreKey.MAX_PREKEY_ID)
  );

  const cipherMessage = await alice.encrypt(createSessionId(bob), 'Hello', bobBundle.serialise());
  await bob.decrypt(createSessionId(alice), cipherMessage);

  return {alice, bob};
}
async function initialSetup ( ) { const alice = await createCryptobox ( 'alice' , 1 ) ; await alice . create ( ) ; const bob = await createCryptobox ( 'bob' , 1 ) ; await bob . create ( ) ; const bobBundle = Proteus . keys . PreKeyBundle . new ( bob . identity . public_key , await bob . store . load_prekey ( Proteus . keys . PreKey . MAX_PREKEY_ID ) ) ; const cipherMessage = await alice . encrypt ( createSessionId ( bob ) , 'Hello' , bobBundle . serialise ( ) ) ; await bob . decrypt ( createSessionId ( alice ) , cipherMessage ) ; return { alice , bob } ; }
Creates participants and establishes sessions between them.
Creates participants and establishes sessions between them .