code: public void processPacketAESF8(RawPacket pkt, int index) {
          // byte[] iv = new byte[16];
  
          // 4 bytes of the iv are zero
          // the first byte of the RTP header is not used.
          ivStore[0] = 0;
          ivStore[1] = 0;
          ivStore[2] = 0;
          ivStore[3] = 0;
        
          // Need the encryption flag
          index = index | 0x80000000;
  
          // set the index and the encrypt flag in network order into IV
          ivStore[4] = (byte) (index >> 24);
          ivStore[5] = (byte) (index >> 16);
          ivStore[6] = (byte) (index >> 8);
          ivStore[7] = (byte) index;
          
          // The fixed header follows and fills the rest of the IV
          ByteBuffer buf = pkt.getBuffer();
          buf.rewind();
          buf.get(ivStore, 8, 8);
  
          // Encrypted part excludes fixed header (8 bytes), index (4 bytes), and
          // authentication tag (variable according to policy)  
          final int payloadOffset = 8;
          final int payloadLength = pkt.getLength() - (4 + policy.getAuthTagLength());
          SRTPCipherF8.process(cipher, pkt.getBuffer(), payloadOffset, payloadLength, ivStore, cipherF8);
      }
docs: Perform F8 Mode AES encryption / decryption
  
  @param pkt the RTP packet to be encrypted / decrypted