Skip to content

Commit 491bd5b

Browse files
committed
minor compatibility fixes.
updated to 1.82.
1 parent 37cdf64 commit 491bd5b

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

core/src/main/jdk1.4/org/bouncycastle/util/Arrays.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,36 @@ public static boolean constantTimeAreEqual(int len, byte[] a, int aOff, byte[] b
147147
return 0 == d;
148148
}
149149

150+
public static boolean constantTimeAreEqual(
151+
long[] expected,
152+
long[] supplied)
153+
{
154+
if (expected == null || supplied == null)
155+
{
156+
return false;
157+
}
158+
159+
if (expected == supplied)
160+
{
161+
return true;
162+
}
163+
164+
int len = (expected.length < supplied.length) ? expected.length : supplied.length;
165+
166+
long nonEqual = expected.length ^ supplied.length;
167+
168+
for (int i = 0; i != len; i++)
169+
{
170+
nonEqual |= (expected[i] ^ supplied[i]);
171+
}
172+
for (int i = len; i < supplied.length; i++)
173+
{
174+
nonEqual |= (supplied[i] ^ ~supplied[i]);
175+
}
176+
177+
return nonEqual == 0;
178+
}
179+
150180
public static int compareUnsigned(byte[] a, byte[] b)
151181
{
152182
if (a == b)
@@ -875,7 +905,7 @@ public static void reverse(byte[] input, byte[] output)
875905
output[i] = input[last - i];
876906
}
877907
}
878-
908+
879909
public static byte[] reverseInPlace(byte[] a)
880910
{
881911
if (null == a)
@@ -940,7 +970,7 @@ public static int[] reverseInPlace(int[] a)
940970

941971
return a;
942972
}
943-
973+
944974
/**
945975
* Fill input array by zeros
946976
*

docs/releasenotes.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ <h3>2.1.3 Additional Features and Functionality</h3>
5353
<li>The "org.bouncycastle.drbg.effective_256bits_entropy" property has been added for platforms where the entropy source is not producing 1 full bit of entropy per bit and additional bits are required (default value 282).</li>
5454
<li>Support has been added to the CMS content encryptors to allow a generated key to be passed in, rather than always having them generate their own.</li>
5555
<li>OpenPGPKeyGenerator now allows for the use of empty UserIDs (version 4 compatibility).</li>
56+
<li>The HQC KEM has been updated with the latest draft updates.</li>
5657
</ul>
5758
<h3>2.1.4 Additional Notes</h3>
5859
<ul>

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
org.gradle.jvmargs=-Xmx2g
2-
version=1.82-SNAPSHOT
2+
version=1.82
33
maxVersion=1.83
44
org.gradle.java.installations.auto-detect=false
55
org.gradle.java.installations.auto-download=false

prov/src/test/java/org/bouncycastle/jcajce/provider/test/CompositeSignaturesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ public List<Map<String, Object>> readTestVectorsFromJson(String homeDire, String
743743

744744
private static Map<String, Object> parseJsonObject(String json)
745745
{
746-
HashMap<String, Object> testCase = new HashMap<>();
746+
HashMap<String, Object> testCase = new HashMap<String, Object>();
747747
testCase.put("tcId", extractString(json, "tcId"));
748748
testCase.put("pk", Base64.getDecoder().decode(extractString(json, "pk")));
749749
testCase.put("x5c", Base64.getDecoder().decode(extractString(json, "x5c")));

0 commit comments

Comments
 (0)