public boolean equalsSecretBigInteger(SecretBigInteger other) {
    // BigInteger.toByteArray always return the minimal encoding, so it is not possible that two
    // BigInteger of the same values return different encodings.
    byte[] myArray = value.toByteArray();
    byte[] otherArray = other.value.toByteArray();
    return MessageDigest.isEqual(myArray, otherArray);
  }
Returns true if {@code other} has the same secret value.

<p>Note that the time may depend on the length of the byte-encoding of the BigIntegers.
java_src/src/main/java/com/google/crypto/tink/util/SecretBigInteger.java