keyPair_fromSecretKey static method

KeyPair keyPair_fromSecretKey(
  1. Uint8List secretKey
)

Implementation

static KeyPair keyPair_fromSecretKey(Uint8List secretKey) {
  KeyPair kp = new KeyPair(publicKeyLength, secretKeyLength);
  Uint8List sk = kp.secretKey;
  Uint8List pk = kp.publicKey;

  // copy sk
  for (int i = 0; i < sk.length; i++) sk[i] = secretKey[i];

  TweetNaclFast.crypto_scalarmult_base(pk, sk);
  return kp;
}