static void moveAuthTag(byte[] messageKey,
                            byte[] cipherText,
                            byte[] messageKeyWithAuthTag,
                            byte[] cipherTextWithoutAuthTag) {
        // Check dimensions of arrays
        if (messageKeyWithAuthTag.length != messageKey.length + 16) {
            throw new IllegalArgumentException("Length of messageKeyWithAuthTag must be length of messageKey + " +
                    "length of AuthTag (16)");
        }

        if (cipherTextWithoutAuthTag.length != cipherText.length - 16) {
            throw new IllegalArgumentException("Length of cipherTextWithoutAuthTag must be length of cipherText " +
                    "- length of AuthTag (16)");
        }

        // Move auth tag from cipherText to messageKey
        System.arraycopy(messageKey, 0, messageKeyWithAuthTag, 0, 16);
        System.arraycopy(cipherText, 0, cipherTextWithoutAuthTag, 0, cipherTextWithoutAuthTag.length);
        System.arraycopy(cipherText, cipherText.length - 16, messageKeyWithAuthTag, 16, 16);
    }
@Test
    public void testMoveAuthTag() {
        // Extract authTag for testing purposes
        byte[] authTag = new byte[16];
        System.arraycopy(cipherTextWithAuthTag, 35, authTag, 0, 16);

        byte[] messageKeyWithAuthTag = new byte[16 + 16];
        byte[] cipherTextWithoutAuthTag = new byte[35];

        OmemoMessageBuilder.moveAuthTag(messageKey, cipherTextWithAuthTag, messageKeyWithAuthTag, cipherTextWithoutAuthTag);

        // Check if first n - 16 bytes of cipherText got copied over to cipherTextWithoutAuthTag correctly
        byte[] checkCipherText = new byte[35];
        System.arraycopy(cipherTextWithAuthTag, 0, checkCipherText, 0, 35);
        assertTrue(Arrays.equals(checkCipherText, cipherTextWithoutAuthTag));

        byte[] checkMessageKey = new byte[16];
        System.arraycopy(messageKeyWithAuthTag, 0, checkMessageKey, 0, 16);
        assertTrue(Arrays.equals(checkMessageKey, messageKey));

        byte[] checkAuthTag = new byte[16];
        System.arraycopy(messageKeyWithAuthTag, 16, checkAuthTag, 0, 16);
        assertTrue(Arrays.equals(checkAuthTag, authTag));
    }