pascalCoin static method

KeyIV pascalCoin(
  1. String password, {
  2. Uint8List? salt,
})

Gets the key and iv for pascalcoin.

Implementation

static KeyIV pascalCoin(String password, {Uint8List? salt}) {
  Uint8List pwBytes = PDUtil.stringToBytesUtf8(password);
  Uint8List saltBytes = salt == null ? Uint8List(1) : salt;

  // Key = sha256 (password + salt);
  Uint8List key = Sha.sha256([pwBytes, saltBytes]);
  // iv = sha256 (KEY + password + salt);
  Uint8List iv = Sha.sha256([key, pwBytes, saltBytes]).sublist(0, 16);

  return KeyIV(key, iv);
}