Skip to content

Commit aa4a965

Browse files
author
gefeili
committed
Refactor on isap_mac
1 parent f8336dc commit aa4a965

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private interface ISAP_AEAD
7474

7575
void init();
7676

77-
void isap_mac(byte[] ad, int adlen, byte[] c, int clen, byte[] tag);
77+
void isap_mac(byte[] c, int clen, byte[] tag);
7878

7979
void reset();
8080

@@ -170,7 +170,7 @@ public void absorbFinalAADBlock()
170170
x4 ^= 1L;
171171
}
172172

173-
public void isap_mac(byte[] ad, int adlen, byte[] c, int clen, byte[] tag)
173+
public void isap_mac(byte[] c, int clen, byte[] tag)
174174
{
175175
ABSORB_MAC(c, clen);
176176
// Derive K*
@@ -478,7 +478,7 @@ public void isap_rk(short[] iv16, byte[] y, int ylen, short[] out16, int outlen,
478478
System.arraycopy(SX, 0, out16, 0, outlen == ISAP_STATE_SZ_CRYPTO_NPUBBYTES ? 17 : 8);
479479
}
480480

481-
public void isap_mac(byte[] ad, int adlen, byte[] c, int clen, byte[] tag)
481+
public void isap_mac(byte[] c, int clen, byte[] tag)
482482
{
483483
// Absorb C
484484
ABSORB_MAC(SX, c, clen, E, C);
@@ -965,7 +965,7 @@ public int doFinal(byte[] output, int outOff)
965965
c = outputStream.toByteArray();
966966
mac = new byte[MAC_SIZE];
967967
ISAPAEAD.swapInternalState();
968-
ISAPAEAD.isap_mac(buffer, bufferOff, c, c.length, mac);
968+
ISAPAEAD.isap_mac(c, c.length, mac);
969969
System.arraycopy(mac, 0, output, outOff, 16);
970970
len += 16;
971971
}
@@ -979,7 +979,7 @@ public int doFinal(byte[] output, int outOff)
979979
throw new OutputLengthException("output buffer is too short");
980980
}
981981
ISAPAEAD.swapInternalState();
982-
ISAPAEAD.isap_mac(buffer, bufferOff, c, len, mac);
982+
ISAPAEAD.isap_mac(c, len, mac);
983983
ISAPAEAD.reset();
984984
for (int i = 0; i < 16; ++i)
985985
{

0 commit comments

Comments
 (0)