MessageDigest alg = null;
try {
alg = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException ex) {
// this should never happen
throw new MathInternalError(ex);
}
alg.reset();
// Compute number of iterations required (40 bytes each)
int numIter = (len / 40) + 1;