wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.bouncycastle.shaded.crypto;
 
public abstract class DefaultMultiBlockCipher
    implements MultiBlockCipher
{
    protected DefaultMultiBlockCipher()
    {
    }
 
    public int getMultiBlockSize()
    {
        return this.getBlockSize();
    }
 
    public int processBlocks(byte[] in, int inOff, int blockCount, byte[] out, int outOff)
        throws DataLengthException, IllegalStateException
    {
 
        // TODO check if the underlying cipher supports the multiblock interface and call it directly?
 
        int resultLen = 0;
        int blockSize = this.getMultiBlockSize();
        
        for (int i = 0; i != blockCount; i++)
        {
            resultLen += this.processBlock(in, inOff, out, outOff + resultLen);
 
            inOff += blockSize;
        }
 
        return resultLen;
    }
}