Can Scram-sha-1 be imporved to make it more fast …
after the challange is rcvd from server it takes a while to respond back to the server .
found out hi is taking more time
private static byte[] hi(String str, byte[] salt, int iterations) throws SmackException {
byte[] key = str.getBytes();
// U1 := HMAC(str, salt + INT(1))
byte[] u = hmac(key, ByteUtils.concact(salt, ONE));
byte[] res = u.clone();
//WITH 4096 *iterations it takes around 3-4 secs not sure if this can be improved *
-
for (int i = 1; i < iterations; i++) {*
-
u = hmac(key, u);
for (int j = 0; j < u.length; j++) {* -
res[j] ^= u[j];
}* -
}*
FileLog.e(“SCRAM WA”,“hi-4”);
return res;
}