public static byte[] longToBigEndian(long n) { byte[] bs = new byte[8]; longToBigEndian(n, bs, 0); return bs; }
public static void longToBigEndian(long[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { longToBigEndian(ns[i], bs, off); off += 8; } }
public static byte[] asBytes(long[] x) { byte[] z = new byte[16]; Pack.longToBigEndian(x, z, 0); return z; }
public static byte[] longToBigEndian(long n) { byte[] bs = new byte[8]; longToBigEndian(n, bs, 0); return bs; }
public static byte[] asBytes(long[] x) { byte[] z = new byte[16]; Pack.longToBigEndian(x, z, 0); return z; }
protected byte[] getLengthTag(byte[] p2) { byte[] L2 = new byte[8]; if (p2 != null) { Pack.longToBigEndian(p2.length * 8L, L2, 0); } return L2; }
public static byte[] longToBigEndian(long[] ns) { byte[] bs = new byte[8 * ns.length]; longToBigEndian(ns, bs, 0); return bs; }
public static byte[] longToBigEndian(long[] ns) { byte[] bs = new byte[8 * ns.length]; longToBigEndian(ns, bs, 0); return bs; }
public static void longToBigEndian(long[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { longToBigEndian(ns[i], bs, off); off += 8; } }
protected byte[] getLengthTag(byte[] p2) { byte[] L2 = new byte[8]; if (p2 != null) { Pack.longToBigEndian(p2.length * 8L, L2, 0); } return L2; } }
public static void asBytes(long[] x, byte[] z) { Pack.longToBigEndian(x, z, 0); }
public static BigInteger toBigInteger64(long[] x) { byte[] bs = new byte[32]; for (int i = 0; i < 4; ++i) { long x_i = x[i]; if (x_i != 0L) { Pack.longToBigEndian(x_i, bs, (3 - i) << 3); } } return new BigInteger(1, bs); }
public static BigInteger toBigInteger64(long[] x) { byte[] bs = new byte[24]; for (int i = 0; i < 3; ++i) { long x_i = x[i]; if (x_i != 0L) { Pack.longToBigEndian(x_i, bs, (2 - i) << 3); } } return new BigInteger(1, bs); }
public static BigInteger toBigInteger64(long[] x) { byte[] bs = new byte[16]; for (int i = 0; i < 2; ++i) { long x_i = x[i]; if (x_i != 0L) { Pack.longToBigEndian(x_i, bs, (1 - i) << 3); } } return new BigInteger(1, bs); }
protected void populateState(byte[] state) { System.arraycopy(xBuf, 0, state, 0, xBufOff); Pack.intToBigEndian(xBufOff, state, 4); Pack.longToBigEndian(byteCount, state, 8); }
private static byte[] generateDefaultPersonalizationString(byte[] seed) { return Arrays.concatenate(Strings.toByteArray("Default"), seed, Pack.longToBigEndian(Thread.currentThread().getId()), Pack.longToBigEndian(System.currentTimeMillis())); }
protected void populateState(byte[] state) { System.arraycopy(xBuf, 0, state, 0, xBufOff); Pack.intToBigEndian(xBufOff, state, 4); Pack.longToBigEndian(byteCount, state, 8); }
public void addSeedMaterial(long seed) { addSeedMaterial(Pack.longToBigEndian(seed)); }
public void addSeedMaterial(long seed) { addSeedMaterial(Pack.longToBigEndian(seed)); }
protected byte[] toByteArray() { byte[] byteRepresentation = new byte[32]; Pack.intToBigEndian(layerAddress, byteRepresentation, 0); Pack.longToBigEndian(treeAddress, byteRepresentation, 4); Pack.intToBigEndian(type, byteRepresentation, 12); Pack.intToBigEndian(keyAndMask, byteRepresentation, 28); return byteRepresentation; }