ts-algochat
    Preparing search index...

    Function validateCounter

    • Validates whether a received counter is acceptable.

      A counter is valid if:

      • It has not been seen before (replay protection)
      • It is within the sliding window of +/- COUNTER_WINDOW from peerLastCounter

      Parameters

      • state: PSKState

        Current PSK state

      • counter: number

        The received counter to validate

      Returns boolean

      true if the counter is valid