class Subtles {

  public static boolean secureCompare(final byte[] a, final byte[] b) {
    if (a.length != b.length) {
      return false;
    }

    int match = 0;
    for (int i = 0; i < a.length; i++) {
      match = match | a[i] ^ b[i];
    }

    return (match == 0); // true if match
  }

  private  Subtles();

}