ByteSequence block = blocks.blockAt(i);
boolean lastBlock = (i == blocks.length() - 1);
try {
ByteSequence plainBlock = decryptBlock(iv, block);
if (lastBlock) {
byte paddingLength = plainBlock
.byteAt(plainBlock.length() - 1);
if (paddingLength < 1 || paddingLength > blockLength) {
throw new Exception("Incorrect padding");
}
for (int pos = 1; pos < paddingLength; pos++) {