Here you can find the source of areEqualConstantTime(String a, String b)
public static boolean areEqualConstantTime(String a, String b)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean areEqualConstantTime(String a, String b) { boolean equal = true; if (a.length() != b.length()) { equal = false;/* w w w. ja v a 2 s . com*/ } for (int i = 0; i < a.length(); i++) { if (a.charAt(i % a.length()) != b.charAt(i % b.length())) { equal = false; } } return equal; } }