verify method

bool verify(
  1. List<int> derivedKey,
  2. List<int> password
)

Verify if the derivedKey was derived from the original password using the current parameters.

Implementation

bool verify(List<int> derivedKey, List<int> password) {
  if (derivedKey.length != derivedKeyLength) {
    return false;
  }
  var other = convert(password).bytes;
  for (int i = 0; i < other.length; ++i) {
    if (derivedKey[i] != other[i]) {
      return false;
    }
  }
  return true;
}