Skip to content

Commit a1e0799

Browse files
author
gefeili
committed
Refactor on Grain128AEADEngine
1 parent 24cf9b7 commit a1e0799

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ protected final void ensureInitialized()
859859
}
860860
}
861861

862+
// Used for Grain128 AEAD and Romulus Engine
862863
protected void finishAAD1(State nextState)
863864
{
864865
switch (m_state)
@@ -877,6 +878,7 @@ protected void finishAAD1(State nextState)
877878
m_state = nextState;
878879
}
879880

881+
// Use for Elephant and Sparkle
880882
protected void finishAAD2(State nextState)
881883
{
882884
// State indicates whether we ever received AAD
@@ -896,6 +898,7 @@ protected void finishAAD2(State nextState)
896898
m_state = nextState;
897899
}
898900

901+
// Used for Gift-Cofb, ISAP, PhotonBeetle and Xoodyak
899902
protected void finishAAD3(State nextState, boolean isDoFinal)
900903
{
901904
// State indicates whether we ever received AAD

core/src/test/java/org/bouncycastle/crypto/test/Grain128AEADTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,15 @@ static void isEqualTo(
230230

231231
public static void main(String[] args)
232232
{
233-
// runTest(new AsconTest());
234-
// runTest(new ElephantTest());
235-
// runTest(new GiftCofbTest());
233+
runTest(new AsconTest());
234+
runTest(new ElephantTest());
235+
runTest(new GiftCofbTest());
236236
runTest(new Grain128AEADTest());
237-
// runTest(new ISAPTest());
238-
// runTest(new PhotonBeetleTest());
239-
// runTest(new RomulusTest());
240-
// runTest(new SparkleTest());
241-
// runTest(new XoodyakTest());
237+
runTest(new ISAPTest());
238+
runTest(new PhotonBeetleTest());
239+
runTest(new RomulusTest());
240+
runTest(new SparkleTest());
241+
runTest(new XoodyakTest());
242242
}
243243
}
244244

0 commit comments

Comments
 (0)