iterableConstantTime static method

bool iterableConstantTime(
  1. Iterable<List<int>> a,
  2. Iterable<List<int>> b
)

Implementation

static bool iterableConstantTime(
  Iterable<List<int>> a,
  Iterable<List<int>> b,
) {
  if (a.isEmpty && b.isEmpty) return true;
  if (a.length != b.length) {
    return false;
  }
  if (identical(a, b)) {
    return true;
  }
  for (int index = 0; index < a.length; index += 1) {
    final valueA = a.elementAt(index);
    final valueB = b.elementAt(index);
    if (!BytesUtils.bytesEqualConst(valueA, valueB)) return false;
  }
  return true;
}