public static byte[] intToBigEndian(int n) { byte[] bs = new byte[4]; intToBigEndian(n, bs, 0); return bs; }
public static byte[] intToBigEndian(int[] ns) { byte[] bs = new byte[4 * ns.length]; intToBigEndian(ns, bs, 0); return bs; }
public static void intToBigEndian(int[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { intToBigEndian(ns[i], bs, off); off += 4; } }
public static void longToBigEndian(long n, byte[] bs, int off) { intToBigEndian((int)(n >>> 32), bs, off); intToBigEndian((int)(n & 0xffffffffL), bs, off + 4); }
public static byte[] intToBigEndian(int[] ns) { byte[] bs = new byte[4 * ns.length]; intToBigEndian(ns, bs, 0); return bs; }
public static void intToBigEndian(int[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { intToBigEndian(ns[i], bs, off); off += 4; } }
public static void longToBigEndian(long n, byte[] bs, int off) { intToBigEndian((int)(n >>> 32), bs, off); intToBigEndian((int)(n & 0xffffffffL), bs, off + 4); }
public static byte[] asBytes(int[] x) { byte[] z = new byte[16]; Pack.intToBigEndian(x, z, 0); return z; }
protected byte[] getLengthTag(byte[] p2) { byte[] L2 = new byte[4]; if (p2 != null) { Pack.intToBigEndian(p2.length * 8, L2, 0); } return L2; } }
public static byte[] asBytes(int[] x) { byte[] z = new byte[16]; Pack.intToBigEndian(x, z, 0); return z; }
@Override protected byte[] toByteArray() { byte[] byteRepresentation = super.toByteArray(); Pack.intToBigEndian(otsAddress, byteRepresentation,16); Pack.intToBigEndian(chainAddress, byteRepresentation, 20); Pack.intToBigEndian(hashAddress, byteRepresentation, 24); return byteRepresentation; }
@Override protected byte[] toByteArray() { byte[] byteRepresentation = super.toByteArray(); Pack.intToBigEndian(padding, byteRepresentation,16); Pack.intToBigEndian(treeHeight, byteRepresentation, 20); Pack.intToBigEndian(treeIndex, byteRepresentation, 24); return byteRepresentation; }
@Override protected byte[] toByteArray() { byte[] byteRepresentation = super.toByteArray(); Pack.intToBigEndian(lTreeAddress, byteRepresentation, 16); Pack.intToBigEndian(treeHeight, byteRepresentation, 20); Pack.intToBigEndian(treeIndex, byteRepresentation, 24); return byteRepresentation; }
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; }
protected void populateState(byte[] state) { System.arraycopy(xBuf, 0, state, 0, xBufOff); Pack.intToBigEndian(xBufOff, state, 4); Pack.longToBigEndian(byteCount, state, 8); }
public byte returnByte(byte in) { if (index == 0) { isaac(); keyStream = Pack.intToBigEndian(results); } byte out = (byte)(keyStream[index]^in); index = (index + 1) & 1023; return out; }
public byte returnByte(byte in) { if (index == 0) { isaac(); keyStream = Pack.intToBigEndian(results); } byte out = (byte)(keyStream[index]^in); index = (index + 1) & 1023; return out; }
public int doFinal(byte[] out, int outOff) { finish(); Pack.intToBigEndian(V, out, outOff); reset(); return DIGEST_LENGTH; }
public byte[] getEncodedState() { final int baseSize = getEncodedStateSize(); byte[] encoded = new byte[baseSize + 4]; populateState(encoded); Pack.intToBigEndian(digestLength * 8, encoded, baseSize); return encoded; }
public byte[] getEncodedState() { final int baseSize = getEncodedStateSize(); byte[] encoded = new byte[baseSize + 4]; populateState(encoded); Pack.intToBigEndian(digestLength * 8, encoded, baseSize); return encoded; }