extractPublicKeyBlock method

int extractPublicKeyBlock(
  1. int start,
  2. int expectedBlockLength
)

Implementation

int extractPublicKeyBlock(int start, int expectedBlockLength) {
  //   output.writeUint32(8 + message.lengthInBytes);
  // output.writeUint32(algoId);
  // output.writeUint32(message.lengthInBytes);
  // output.writeBytes(message);
  var current = start;
  _input.offset = current;

  var publicKeyLength = _input.readUint32();
  assert(publicKeyLength + 4 == expectedBlockLength,
      'PublicKey Blocklength is not correct');

  current = current + 4;
  _input.offset = current;

  var publicKeyBytes = _input.readBytes(publicKeyLength);

  _publicKeys.add(publicKeyBytes.toUint8List());
  // print(publicKeyBytes.toUint8List().toHex());

  return current + publicKeyLength;
}