cryptoSignKeypair static method

int cryptoSignKeypair(
  1. Uint8List pk,
  2. Uint8List sk,
  3. bool seeded
)

Implementation

static int cryptoSignKeypair(Uint8List pk, Uint8List sk, bool seeded) {
  Uint8List d = Uint8List(64);
  List<Uint64List?> p = List<Uint64List?>.filled(4, Uint64List(0));

  p[0] = Uint64List(16);
  p[1] = Uint64List(16);
  p[2] = Uint64List(16);
  p[3] = Uint64List(16);

  int i;

  if (!seeded) randombytesArrayLen(sk, 32);
  cryptoHashOff(d, sk, 0, 32);
  d[0] &= 248;
  d[31] &= 127;
  d[31] |= 64;

  _scalarbase(p, d, 0);
  _pack(pk, p);

  for (i = 0; i < 32; i++) sk[i + 32] = pk[i];
  return 0;
}