public class Utils
extends java.lang.Object
コンストラクタ | 説明 |
---|---|
Utils() |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
static int |
bit(byte[] h,
int i) |
Get the i'th bit of a byte array.
|
static java.lang.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(java.lang.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(java.lang.String s)
s
- the hex string to be converted.public static java.lang.String bytesToHex(byte[] raw)
raw
- the byte[] to be converted.