byte[] toBytes() { byte[] result = new byte[ARGON2_BLOCK_SIZE]; for (int i = 0; i < v.length; i++) { Pack.longToLittleEndian(v[i], result, i * 8); } return result; }
public static void longToLittleEndian(long[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { longToLittleEndian(ns[i], bs, off); off += 8; } }
public static byte[] longToLittleEndian(long n) { byte[] bs = new byte[8]; longToLittleEndian(n, bs, 0); return bs; }
public static byte[] longToLittleEndian(long[] ns) { byte[] bs = new byte[8 * ns.length]; longToLittleEndian(ns, bs, 0); return bs; }
public static byte[] longToLittleEndian(long[] ns) { byte[] bs = new byte[8 * ns.length]; longToLittleEndian(ns, bs, 0); return bs; }
public static void longToLittleEndian(long[] ns, int nsOff, int nsLen, byte[] bs, int bsOff) { for (int i = 0; i < nsLen; ++i) { longToLittleEndian(ns[nsOff + i], bs, bsOff); bsOff += 8; } } }
public static byte[] longToLittleEndian(long n) { byte[] bs = new byte[8]; longToLittleEndian(n, bs, 0); return bs; }
public static void longToLittleEndian(long[] ns, byte[] bs, int off) { for (int i = 0; i < ns.length; ++i) { longToLittleEndian(ns[i], bs, off); off += 8; } } }
private void KeccakExtract() { Pack.longToLittleEndian(state, 0, rate >> 6, dataQueue, 0); }
static byte[] defaultTweakFunction(long tweakValue) { byte[] bs = Pack.longToLittleEndian(tweakValue); bs = Arrays.copyOfRange(bs, 0, BLOCK_SIZE); return bs; }
XTSTweak next() { long lo = Pack.littleEndianToLong(tweak, 0); long hi = Pack.littleEndianToLong(tweak, 8); long fdbk = (hi & MSB) == 0 ? 0L : FDBK; hi = (hi << 1) | (lo >>> 63); lo = (lo << 1) ^ fdbk; Pack.longToLittleEndian(lo, tweak, 0); Pack.longToLittleEndian(hi, tweak, 8); return this; } }
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException { long result = doFinal(); Pack.longToLittleEndian(result, out, outOff); return 8; }
static byte[] tweakFunction(long tweakValue) { byte[] bs = Pack.longToLittleEndian(tweakValue); return Arrays.concatenate(bs, bs); } private static final int BLOCK_SIZE = Property.DP_AESXTS_BLOCK_SIZE.asInteger().orElse(4096);
public String toString() { StringBuffer result = new StringBuffer(); for (int i = 0; i < v.length; i++) { result.append(Hex.toHexString(Pack.longToLittleEndian(v[i]))); } return result.toString(); }
private static byte[] generateNonceIVPersonalizationString(byte[] seed) { return Arrays.concatenate(Strings.toByteArray("Nonce"), seed, Pack.longToLittleEndian(Thread.currentThread().getId()), Pack.longToLittleEndian(System.currentTimeMillis())); }
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException { long result = doFinal(); Pack.longToLittleEndian(result, out, outOff); return 8; }
protected void updateRecordMACLength(Mac mac, int len) { byte[] longLen = Pack.longToLittleEndian(len & 0xFFFFFFFFL); mac.update(longLen, 0, longLen.length); }
protected void updateRecordMAC(Mac mac, byte[] buf, int off, int len) { mac.update(buf, off, len); byte[] longLen = Pack.longToLittleEndian(len & 0xFFFFFFFFL); mac.update(longLen, 0, longLen.length); }
private void finish() { Pack.longToLittleEndian(byteCount * 8, L, 0); // get length into L (byteCount * 8 = bitCount) while (xBufOff != 0) { update((byte)0); } processBlock(L, 0); processBlock(Sum, 0); }
private void finish() { Pack.longToLittleEndian(byteCount * 8, L, 0); // get length into L (byteCount * 8 = bitCount) while (xBufOff != 0) { update((byte)0); } processBlock(L, 0); processBlock(Sum, 0); }