Package com.nimbusds.jose.crypto.utils
Class ConstantTimeUtils
- java.lang.Object
-
- com.nimbusds.jose.crypto.utils.ConstantTimeUtils
-
public class ConstantTimeUtils extends Object
Array utilities.- Version:
- 2017-04-26
- Author:
- Vladimir Dzhuvinov
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areEqual(byte[] a, byte[] b)
Checks the specified arrays for equality in constant time.
-
-
-
Method Detail
-
areEqual
public static boolean areEqual(byte[] a, byte[] b)
Checks the specified arrays for equality in constant time. Intended to mitigate timing attacks.- Parameters:
a
- The first array. Must not benull
.b
- The second array. Must not benull
.- Returns:
true
if the two arrays are equal, elsefalse
.
-
-