code: private void update(int index)
      {
          int delta = receivedIndex - index;
  
          /* update the replay bit mask */
          if (delta > 0)
          {
              replayWindow = replayWindow << delta;
              replayWindow |= 1;
          }
          else
          {
              replayWindow |= ( 1 << delta );
          }
  
          receivedIndex = index;
      }
docs: Update the SRTP packet index.
  
  This method is called after all checks were successful.
  
  @param index index number of the accepted packet