Skip to content

Commit 37b958a

Browse files
committed
Align behaviour of CTR and SIC modes in the JCE API.
1 parent 24eae4b commit 37b958a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/util/BaseBlockCipher.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ else if (modeName.equalsIgnoreCase("OpenPGPCFB"))
249249
cipher = new BufferedGenericBlockCipher(
250250
new OpenPGPCFBBlockCipher(baseEngine));
251251
}
252-
else if (modeName.startsWith("SIC"))
252+
else if (modeName.startsWith("SIC") || modeName.startsWith("CTR"))
253253
{
254254
ivLength = baseEngine.getBlockSize();
255255
if (ivLength < 16)
@@ -259,12 +259,6 @@ else if (modeName.startsWith("SIC"))
259259
cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
260260
new SICBlockCipher(baseEngine)));
261261
}
262-
else if (modeName.startsWith("CTR"))
263-
{
264-
ivLength = baseEngine.getBlockSize();
265-
cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(
266-
new SICBlockCipher(baseEngine)));
267-
}
268262
else if (modeName.startsWith("GOFB"))
269263
{
270264
ivLength = baseEngine.getBlockSize();

0 commit comments

Comments
 (0)