/** * Composes the other info as {@code algID || partyUInfo || partyVInfo * || suppPubInfo || suppPrivInfo}. * * @param algID The algorithm identifier, {@code null} if not * specified. * @param partyUInfo The partyUInfo, {@code null} if not specified. * @param partyVInfo The partyVInfo {@code null} if not specified. * @param suppPubInfo The suppPubInfo, {@code null} if not specified. * @param suppPrivInfo The suppPrivInfo, {@code null} if not specified. * * @return The resulting other info. */ public static byte[] composeOtherInfo(final byte[] algID, final byte[] partyUInfo, final byte[] partyVInfo, final byte[] suppPubInfo, final byte[] suppPrivInfo) { return ByteUtils.concat(algID, partyUInfo, partyVInfo, suppPubInfo, suppPrivInfo); }
/** * Encodes the specified data as {@code data.length || data}. * * @param data The data to encode, may be {@code null}. * * @return The encoded data. */ public static byte[] encodeDataWithLength(final byte[] data) { byte[] bytes = data != null ? data : new byte[0]; byte[] length = IntegerUtils.toBytes(bytes.length); return ByteUtils.concat(length, bytes); }
if (i == 1) inputBytes = ByteUtils.concat(salt, IntegerUtils.toBytes(blockIndex)); currentU = prf.doFinal(inputBytes); xorU = currentU;
return cipher.doFinal(ByteUtils.concat(cipherText, authTag));