}
/** For unit tests only */
static AEADOutputStream innerCreateAES(OutputStream os, byte[] key, Random random) throws IOException {
AESEngine mainCipher = new AESEngine();
AESLightEngine hashCipher = new AESLightEngine();
byte[] nonce = new byte[mainCipher.getBlockSize()];
random.nextBytes(nonce);
nonce[0] &= 0x7F;
return new AEADOutputStream(os, key, nonce, hashCipher, mainCipher);
}