public class Utils extends Object
| Constructor | Description |
|---|---|
Utils() |
| Modifier and Type | Method | Description |
|---|---|---|
static int |
bit(byte[] h,
int i) |
Get the i'th bit of a byte array.
|
static String |
bytesToHex(byte[] raw) |
Converts bytes to a hex string.
|
static int |
equal(byte[] b,
byte[] c) |
Constant-time byte[] comparison.
|
static int |
equal(int b,
int c) |
Constant-time byte comparison.
|
static byte[] |
hexToBytes(String s) |
Converts a hex string to bytes.
|
static int |
negative(int b) |
Constant-time determine if byte is negative.
|
public static int equal(int b,
int c)
public static int equal(byte[] b,
byte[] c)
public static int negative(int b)
b - the byte to check.public static int bit(byte[] h,
int i)
h - the byte array.i - the bit index.public static byte[] hexToBytes(String s)
s - the hex string to be converted.public static String bytesToHex(byte[] raw)
raw - the byte[] to be converted.