Skip to content

Commit d31da08

Browse files
author
gefeili
committed
ISAPEngine is inherited from AEADBufferBaseEngine
1 parent 153526f commit d31da08

File tree

4 files changed

+168
-247
lines changed

4 files changed

+168
-247
lines changed

core/src/main/java/org/bouncycastle/crypto/engines/AEADBufferBaseEngine.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,19 @@ public int getBlockSize()
127127
return BlockSize;
128128
}
129129

130+
@Override
131+
public int getUpdateOutputSize(int len)
132+
{
133+
int total = Math.max(0, len + bufferOff + (forEncryption ? 0 : -MAC_SIZE));
134+
return total - total % BlockSize;
135+
}
136+
137+
@Override
138+
public int getOutputSize(int len)
139+
{
140+
return Math.max(0, len + bufferOff + (forEncryption ? MAC_SIZE : -MAC_SIZE));
141+
}
142+
130143
protected abstract void processBufferAAD(byte[] input, int inOff);
131144

132145
protected abstract void processFinalAADBlock();

0 commit comments

Comments
 (0)