isZeroConst static method

bool isZeroConst(
  1. List<int> bytes
)

Constant-time check for whether every byte in bytes is zero.

Implementation

static bool isZeroConst(List<int> bytes) {
  var nonZero = 0;
  for (final byte in bytes) {
    nonZero |= byte;
  }

  if (nonZero == 0) {
    return true;
  }
  return false;
}