Package org.pgpainless.util
Class BCUtil
- java.lang.Object
-
- org.pgpainless.util.BCUtil
-
public final class BCUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
constantTimeAreEqual(char[] expected, char[] supplied)
A constant time equals comparison - does not terminate early if test will fail.
-
-
-
Method Detail
-
constantTimeAreEqual
public static boolean constantTimeAreEqual(char[] expected, char[] supplied)
A constant time equals comparison - does not terminate early if test will fail. For best results always pass the expected value as the first parameter. TODO: This method was proposed as a patch to BC: https://github.com/bcgit/bc-java/pull/1141 Replace usage of this method with upstream eventually. Remove once BC 172 gets released, given it contains the patch.- Parameters:
expected
- first arraysupplied
- second array- Returns:
- true if arrays equal, false otherwise.
-
-