@@ -0,0 +1,2281 @@
+package org.jitsi.impl.neomedia.transform.srtp;%0A%0Aimport static org.junit.Assert.*;%0Aimport java.util.Arrays;%0Aimport javax.xml.bind.DatatypeConverter;%0Aimport org.bouncycastle.crypto.engines.*;%0Aimport org.junit.*;%0A%0Apublic class SRTPCipherF8Test%0A%7B%0A    // RFC 3711 AES F8 Tests vectors%0A    public static final byte%5B%5D TV_Key =%0A        DatatypeConverter.parseHexBinary(%22234829008467be186c3de14aae72d62c%22);%0A%0A    public static final byte%5B%5D TV_Salt =%0A        DatatypeConverter.parseHexBinary(%2232f2870d%22);%0A%0A    public static final byte%5B%5D TV_IV =%0A        DatatypeConverter.parseHexBinary(%22006e5cba50681de55c621599d462564a%22);%0A%0A    public static final byte%5B%5D TV_Plain =%0A        DatatypeConverter.parseHexBinary(%2270736575646f72616e646f6d6e657373%22%0A            + %2220697320746865206e65787420626573%22 + %2274207468696e67%22);%0A%0A    public static final byte%5B%5D TV_Cipher_AES =%0A        DatatypeConverter.parseHexBinary(%22019ce7a26e7854014a6366aa95d4eefd%22%0A            + %221ad4172a14f9faf455b7f1d4b62bd08f%22 + %22562c0eef7c4802%22);%0A%0A    // Generated with our own implementation%0A    public static final byte%5B%5D TV_Cipher_TwoFish =%0A        DatatypeConverter.parseHexBinary(%22346d91e0d4c3908c476ba25f2792fbb6%22%0A            + %225456f2d90736f40353da7865a8989f01%22 + %22947f6f09385fb5%22);%0A%0A    /**%0A     * Validate our F8 mode implementation with tests vectors provided in%0A     * RFC3711%0A     * %0A     * @throws Exception%0A     */%0A    @Test%0A    public void testAES() throws Exception%0A    %7B%0A        SRTPCipherF8 cipher = new SRTPCipherF8(new AESFastEngine());%0A        cipher.init(TV_Key, TV_Salt);%0A        byte%5B%5D data = Arrays.copyOf(TV_Plain, TV_Plain.length);%0A        byte%5B%5D iv = Arrays.copyOf(TV_IV, TV_IV.length);%0A        cipher.process(data, 0, data.length, iv);%0A%0A        assertArrayEquals(data, TV_Cipher_AES);%0A    %7D%0A%0A    /**%0A     * Validate our F8 mode implementation work with TwoFish%0A     * %0A     * @throws Exception%0A     */%0A    @Test%0A    public void testTwoFish() throws Exception%0A    %7B%0A        SRTPCipherF8 cipher = new SRTPCipherF8(new TwofishEngine());%0A        cipher.init(TV_Key, TV_Salt);%0A        byte%5B%5D data = Arrays.copyOf(TV_Plain, TV_Plain.length);%0A        byte%5B%5D iv = Arrays.copyOf(TV_IV, TV_IV.length);%0A        cipher.process(data, 0, data.length, iv);%0A%0A        assertArrayEquals(data, TV_Cipher_TwoFish);%0A    %7D%0A%7D%0A

Add unit tests for SRTPCipherF8