Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: low-level support for v1 messaging #6

Merged
merged 1 commit into from
Nov 30, 2022
Merged

Conversation

dmccartney
Copy link
Contributor

This includes the low-level bits required for V1 messaging.

It includes

  • a refactor of how the auth uses private key bundles to more closely track the JS lib (i.e. storing/loading V1 bundles)
  • adapters for converting between v1 PublicKeys and v2 SignedPublicKeys
  • an implementation of our variation on X3DH for message encryption keys

Comment on lines +221 to +229
// This creates 2 users connected to the API and sends DMs
// back and forth using message API V1.
test(
skip: "manual testing only",
"v1 messaging: intros, reading, writing, streaming",
() async {
// Setup the API clients.
var aliceApi = Api.create(host: '127.0.0.1', port: 5556, isSecure: false);
var bobApi = Api.create(host: '127.0.0.1', port: 5556, isSecure: false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test walks through the core of the functionality added.

@dmccartney dmccartney force-pushed the daniel-v1-messaging branch 2 times, most recently from b9d2033 to 20b68a8 Compare November 30, 2022 17:09
/// This performs a variation of the X3DH protocol to establish a shared secret
/// between "me" and "peer".
/// NOTE: it varies based on whether "me" is the recipient (vs sender).
Uint8List compute3DHSecret(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the careful crypto bits.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @mkobetic in case you want to follow along on the crypto pieces!

@dmccartney dmccartney marked this pull request as ready for review November 30, 2022 17:46
@dmccartney dmccartney requested review from elisealix22 and a team November 30, 2022 17:46
lib/src/auth.dart Show resolved Hide resolved
/// This performs a variation of the X3DH protocol to establish a shared secret
/// between "me" and "peer".
/// NOTE: it varies based on whether "me" is the recipient (vs sender).
Uint8List compute3DHSecret(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @mkobetic in case you want to follow along on the crypto pieces!

@dmccartney dmccartney merged commit f96fc35 into main Nov 30, 2022
@dmccartney dmccartney deleted the daniel-v1-messaging branch November 30, 2022 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants