cryptoSignSeedKeypair static method

KeyPair cryptoSignSeedKeypair(
  1. Uint8List seed
)

Implementation

static KeyPair cryptoSignSeedKeypair(Uint8List seed) {
  RangeError.checkValueInInterval(seed.length, cryptoSignSeedbytes,
      cryptoSignSeedbytes, 'seed', 'Invalid length');
  final _pk = calloc<Uint8>(cryptoSignPublickeybytes);
  final _sk = calloc<Uint8>(cryptoSignSecretkeybytes);
  final _seed = seed.toPointer();

  try {
    _cryptoSign
        .crypto_sign_seed_keypair(_pk, _sk, _seed)
        .mustSucceed('crypto_sign_seed_keypair');
    return KeyPair(
        pk: _pk.toList(cryptoSignPublickeybytes),
        sk: _sk.toList(cryptoSignSecretkeybytes));
  } finally {
    calloc.free(_pk);
    calloc.free(_sk);
    calloc.free(_seed);
  }
}