@Test public void testEqualsConsistentTime() { testEquals(new EqualityChecker() { @Override public boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return PlatformDependent.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) != 0; } }); }
public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); }
PlatformDependent { public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); } }
PlatformDependent { public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); } private  PlatformDependent(); }
PlatformDependent { public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); } private  PlatformDependent(); static boolean hasDirectBufferNoCleanerConstructor(); static byte[] allocateUninitializedArray(int size); static boolean isAndroid(); static boolean isWindows(); static boolean isOsx(); static boolean maybeSuperUser(); static int javaVersion(); static boolean canEnableTcpNoDelayByDefault(); static boolean hasUnsafe(); static Throwable getUnsafeUnavailabilityCause(); static boolean isUnaligned(); static boolean directBufferPreferred(); static long maxDirectMemory(); static File tmpdir(); static int bitMode(); static int addressSize(); static long allocateMemory(long size); static void freeMemory(long address); static long reallocateMemory(long address, long newSize); static void throwException(Throwable t); static ConcurrentMap<K, V> newConcurrentHashMap(); static LongCounter newLongCounter(); static ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity); static ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity, float loadFactor); static ConcurrentMap<K, V> newConcurrentHashMap(
            int initialCapacity, float loadFactor, int concurrencyLevel); static ConcurrentMap<K, V> newConcurrentHashMap(Map<? extends K, ? extends V> map); static void freeDirectBuffer(ByteBuffer buffer); static long directBufferAddress(ByteBuffer buffer); static ByteBuffer directBuffer(long memoryAddress, int size); static int getInt(Object object, long fieldOffset); static byte getByte(long address); static short getShort(long address); static int getInt(long address); static long getLong(long address); static byte getByte(byte[] data, int index); static short getShort(byte[] data, int index); static int getInt(byte[] data, int index); static long getLong(byte[] data, int index); static void putByte(long address, byte value); static void putShort(long address, short value); static void putInt(long address, int value); static void putLong(long address, long value); static void putByte(byte[] data, int index, byte value); static void putShort(byte[] data, int index, short value); static void putInt(byte[] data, int index, int value); static void putLong(byte[] data, int index, long value); static void copyMemory(long srcAddr, long dstAddr, long length); static void copyMemory(byte[] src, int srcIndex, long dstAddr, long length); static void copyMemory(long srcAddr, byte[] dst, int dstIndex, long length); static void setMemory(byte[] dst, int dstIndex, long bytes, byte value); static void setMemory(long address, long bytes, byte value); static ByteBuffer allocateDirectNoCleaner(int capacity); static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity); static void freeDirectNoCleaner(ByteBuffer buffer); static boolean useDirectBufferNoCleaner(); static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length); static boolean isZero(byte[] bytes, int startPos, int length); static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length); static int hashCodeAscii(byte[] bytes, int startPos, int length); static int hashCodeAscii(CharSequence bytes); static Queue<T> newMpscQueue(); static Queue<T> newMpscQueue(final int maxCapacity); static Queue<T> newSpscQueue(); static Queue<T> newFixedMpscQueue(int capacity); static ClassLoader getClassLoader(final Class<?> clazz); static ClassLoader getContextClassLoader(); static ClassLoader getSystemClassLoader(); static Deque<C> newConcurrentDeque(); static Random threadLocalRandom(); static String normalizedArch(); static String normalizedOs(); }
PlatformDependent { public static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { return !hasUnsafe() || !unalignedAccess() ? ConstantTimeUtils.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length) : PlatformDependent0.equalsConstantTime(bytes1, startPos1, bytes2, startPos2, length); } private  PlatformDependent(); static boolean hasDirectBufferNoCleanerConstructor(); static byte[] allocateUninitializedArray(int size); static boolean isAndroid(); static boolean isWindows(); static boolean isOsx(); static boolean maybeSuperUser(); static int javaVersion(); static boolean canEnableTcpNoDelayByDefault(); static boolean hasUnsafe(); static Throwable getUnsafeUnavailabilityCause(); static boolean isUnaligned(); static boolean directBufferPreferred(); static long maxDirectMemory(); static File tmpdir(); static int bitMode(); static int addressSize(); static long allocateMemory(long size); static void freeMemory(long address); static long reallocateMemory(long address, long newSize); static void throwException(Throwable t); static ConcurrentMap<K, V> newConcurrentHashMap(); static LongCounter newLongCounter(); static ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity); static ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity, float loadFactor); static ConcurrentMap<K, V> newConcurrentHashMap(
            int initialCapacity, float loadFactor, int concurrencyLevel); static ConcurrentMap<K, V> newConcurrentHashMap(Map<? extends K, ? extends V> map); static void freeDirectBuffer(ByteBuffer buffer); static long directBufferAddress(ByteBuffer buffer); static ByteBuffer directBuffer(long memoryAddress, int size); static int getInt(Object object, long fieldOffset); static byte getByte(long address); static short getShort(long address); static int getInt(long address); static long getLong(long address); static byte getByte(byte[] data, int index); static short getShort(byte[] data, int index); static int getInt(byte[] data, int index); static long getLong(byte[] data, int index); static void putByte(long address, byte value); static void putShort(long address, short value); static void putInt(long address, int value); static void putLong(long address, long value); static void putByte(byte[] data, int index, byte value); static void putShort(byte[] data, int index, short value); static void putInt(byte[] data, int index, int value); static void putLong(byte[] data, int index, long value); static void copyMemory(long srcAddr, long dstAddr, long length); static void copyMemory(byte[] src, int srcIndex, long dstAddr, long length); static void copyMemory(long srcAddr, byte[] dst, int dstIndex, long length); static void setMemory(byte[] dst, int dstIndex, long bytes, byte value); static void setMemory(long address, long bytes, byte value); static ByteBuffer allocateDirectNoCleaner(int capacity); static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity); static void freeDirectNoCleaner(ByteBuffer buffer); static boolean useDirectBufferNoCleaner(); static boolean equals(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length); static boolean isZero(byte[] bytes, int startPos, int length); static int equalsConstantTime(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length); static int hashCodeAscii(byte[] bytes, int startPos, int length); static int hashCodeAscii(CharSequence bytes); static Queue<T> newMpscQueue(); static Queue<T> newMpscQueue(final int maxCapacity); static Queue<T> newSpscQueue(); static Queue<T> newFixedMpscQueue(int capacity); static ClassLoader getClassLoader(final Class<?> clazz); static ClassLoader getContextClassLoader(); static ClassLoader getSystemClassLoader(); static Deque<C> newConcurrentDeque(); static Random threadLocalRandom(); static String normalizedArch(); static String normalizedOs(); static final boolean BIG_ENDIAN_NATIVE_ORDER; }