public static boolean constantTimeArrayEquals(byte[] a, byte[] b) {
    if (a == null || b == null) {
      return (a == b);
    }
    if (a.length != b.length) {
      return false;
    }
    byte result = 0;
    for (int i = 0; i < b.length; i++) {
      result = (byte) (result | a[i] ^ b[i]);
    }
    return (result == 0);
  }
Returns {@code true} if the two arrays are equal to one another.
When the two arrays differ in length, trivially returns {@code false}.
When the two arrays are equal in length, does a constant-time comparison
of the two, i.e. does not abort the comparison when the first differing
element is found.

<p>NOTE: This is a copy of {@code java/com/google/math/crypto/ConstantTime#arrayEquals}.

@param a An array to compare
@param b Another array to compare
@return {@code true} if these arrays are both null or if they have equal
        length and equal bytes in all elements
java/com/google/android/apps/authenticator/util/CryptoUtils.java