byteSecret static method

List<List<int>> byteSecret(
  1. String privateString,
  2. String publicString
)

return a Bytes data secret

Implementation

static List<List<int>> byteSecret(String privateString, String publicString) {
  final secret = rawSecret(privateString, publicString);
  assert(secret.x != null && secret.y != null);
  final xs = secret.x!.toBigInteger()!.toRadixString(16);
  final ys = secret.y!.toBigInteger()!.toRadixString(16);
  final hexX = leftPadding(xs, 64);
  final hexY = leftPadding(ys, 64);
  final secretBytes = Uint8List.fromList(HEX.decode('$hexX$hexY'));
  final pair = [
    secretBytes.sublist(0, 32),
    secretBytes.sublist(32, 40),
  ];
  return pair;
}