-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from mls_rs_uniffi import Client, CipherSuite, generate_signature_keypair, client_config_default | ||
|
||
client_config = client_config_default() | ||
alice = Client(b'alice', generate_signature_keypair(CipherSuite.CURVE25519_AES128), client_config) | ||
bob = Client(b'bob', generate_signature_keypair(CipherSuite.CURVE25519_AES128), client_config) | ||
carla = Client(b'carla', generate_signature_keypair(CipherSuite.CURVE25519_AES128), client_config) | ||
|
||
# Alice creates a group and adds Bob. | ||
alice_group = alice.create_group(None) | ||
output = alice_group.add_members([bob.generate_key_package_message()]) | ||
alice_group.process_incoming_message(output.commit_message) | ||
|
||
# Bob join the group and adds Carla. | ||
bob_group = bob.join_group(None, output.welcome_message).group | ||
output = bob_group.add_members([carla.generate_key_package_message()]) | ||
bob_group.process_incoming_message(output.commit_message) | ||
|
||
# Alice learns that Carla has been added to the group. | ||
received = alice_group.process_incoming_message(output.commit_message) | ||
assert received.roster_update.added == [carla.signing_identity()] | ||
assert received.roster_update.removed == [] | ||
assert received.roster_update.updated == [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters