for (fillSize=blockSize; fillSize<inputLen; fillSize+=blockSize);
return fillSize;
}
protected static byte[] hashInput(AgileEncryptionInfoBuilder builder, byte pwHash[], byte blockKey[], byte inputKey[], int cipherMode) {
EncryptionVerifier ver = builder.getVerifier();
int keySize = builder.getDecryptor().getKeySizeInBytes();
int blockSize = builder.getDecryptor().getBlockSizeInBytes();
HashAlgorithm hashAlgo = ver.getHashAlgorithm();
byte[] salt = ver.getSalt();
byte intermedKey[] = generateKey(pwHash, hashAlgo, blockKey, keySize);
SecretKey skey = new SecretKeySpec(intermedKey, ver.getCipherAlgorithm().jceId);
byte[] iv = generateIv(hashAlgo, salt, null, blockSize);
Cipher cipher = getCipher(skey, ver.getCipherAlgorithm(), ver.getChainingMode(), iv, cipherMode);
byte[] hashFinal;
try {
inputKey = getBlock0(inputKey, getNextBlockSize(inputKey.length, blockSize));
hashFinal = cipher.doFinal(inputKey);