libsignal_protocol_dart
libsignal_protocol_dart copied to clipboard
Cannot import device consistency libraries.
I think by adding it to export on libsignal_protocol_dart.dart would solve this problem.
And DeviceConsistencyMessage also needs the export. Shall I submit PR.
And I couldn't find much about this module in signal protocol. I guess it is for user who is using multiple devices.
Eg: User has 4 device namely 1,2,3,4 He will send DeviceConsistencyMessage from 1 to 2/3/4 to verify about the devices , right ?
I am not sure how it works acccording to myunderstanding it is like below:
bob is using 3 devices
Bob is currently on device 1
final keyList = <IdentityKey>[
deviceOne.getPublicKey(), // public key of current device
deviceTwo.getPublicKey(), // public key of 2nd device
deviceThree.getPublicKey() // public key of 3rd device
];
//bob creates a commitment and consistency message
final deviceOneCommitment = DeviceConsistencyCommitment(1, keyList);
final deviceOneMessage =
DeviceConsistencyMessage(deviceOneCommitment, deviceOne);
//bob send deviceOneMessage consistency message to devices 2 and 3.
//bob send deviceTwoMessage consistency message to devices 1 and 3.
//bob send deviceThreeMessage consistency message to devices 1 and 2.
// ON device 1 below will happen and similar will happen to 2/3
final receivedDeviceTwoMessage = DeviceConsistencyMessage.fromSerialized(
deviceOneCommitment,
deviceTwoMessage.serialized,
deviceTwo.getPublicKey());
final receivedDeviceThreeMessage = DeviceConsistencyMessage.fromSerialized(
deviceOneCommitment,
deviceThreeMessage.serialized,
deviceThree.getPublicKey());
final codeOne = generateCode(deviceOneCommitment, [
deviceOneMessage,
receivedDeviceTwoMessage,
receivedDeviceThreeMessage
]);
Now this codeOne has to be same on every device , right ?
And 1 more thing
Future<List
If we convert it to below;
Future<List
I am not sure of the pupose of it, can you please clear me on this ?
DeviceConsistencyCommitment has serialized getter but how to create DeviceConsistencyCommitment from serialized ? Can we create it like this always DeviceConsistencyCommitment(1, keyList) ?