-
- All Implemented Interfaces:
public class ConstantTimeConstant-time functions.
-
-
Field Summary
Fields Modifier and Type Field Description public final static ConstantTimeINSTANCE
-
Method Summary
Modifier and Type Method Description final Booleanequal(Integer b, Integer c)Constant-time byte comparison. final Booleanequal(Boolean b, Integer c)final Booleanequal(ByteArray b, ByteArray c)Constant-time ByteArray comparison. final BooleanisNegative(Integer b)Constant-time determine if byte is negative. final Integerbit(ByteArray h, Integer i)Get the i'th bit of a byte array. -
-
Method Detail
-
equal
final Boolean equal(Integer b, Integer c)
Constant-time byte comparison.
- Parameters:
b- a byte, represented as an intc- a byte, represented as an int
-
equal
final Boolean equal(ByteArray b, ByteArray c)
Constant-time ByteArray comparison.
Fails fast if the lengths differ.
- Parameters:
b- a ByteArrayc- a ByteArray
-
isNegative
final Boolean isNegative(Integer b)
Constant-time determine if byte is negative.
- Parameters:
b- the byte to check, represented as an int.
-
-
-
-