We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d25f85f commit a80a201Copy full SHA for a80a201
core/src/main/java/org/bouncycastle/crypto/generators/BCrypt.java
@@ -586,7 +586,7 @@ private final byte[] deriveRawKey(
586
Arrays.fill(salt32Bit2, 0);
587
588
int rounds = 1 << cost;
589
- for (int i = 0; i < rounds; i++)
+ for (int i = 0; i != rounds; i++) // rounds may be negative if cost is 31
590
{
591
// state <- ExpandKey(state, 0, key);
592
cyclicXorKey(psw);
@@ -598,6 +598,7 @@ private final byte[] deriveRawKey(
598
processTable(0, 0, P);
599
processTable(P[P_SZ - 2], P[P_SZ - 1], S);
600
}
601
+
602
// encrypt magicString 64 times
603
return encryptMagicString();
604
0 commit comments