SenderKeyDistributionMessageWrapper constructor

SenderKeyDistributionMessageWrapper(
  1. int id,
  2. int iteration,
  3. Uint8List chainKey,
  4. ECPublicKey signatureKey,
)

Implementation

SenderKeyDistributionMessageWrapper(
    int id, int iteration, Uint8List chainKey, ECPublicKey signatureKey) {
  final version = Uint8List.fromList([
    ByteUtil.intsToByteHighAndLow(
        CiphertextMessage.currentVersion, CiphertextMessage.currentVersion)
  ]);
  final protobuf = SenderKeyDistributionMessage.create()
    ..id = id
    ..iteration = iteration
    ..chainKey = List.from(chainKey)
    ..signingKey = List.from(signatureKey.serialize());
  _id = id;
  _iteration = iteration;
  _chainKey = chainKey;
  _signatureKey = signatureKey;
  _serialized = ByteUtil.combine([version, protobuf.writeToBuffer()]);
}