Section: C.2.2 Verification of sequence number freshness in the USIM
Content: The USIM shall maintain an array of a previously accepted sequence number components: SEQMS (0), SEQMS (1),… SEQMS (a-1). The initial sequence number value in each array element shall be zero. To verify that the received sequence number SQN is fresh, the USIM shall compare the received SQN with the sequence number in the array element indexed using the index value contained in SQN, i.e. with the array entry SEQMS (i) where i = is the index value. (a) If SEQ > SEQMS (i) the USIM shall consider the sequence number to be guaranteed fresh and subsequently shall set SEQMS (i) to SEQ. (b) If SEQ ≤ SEQMS (i) the USIM shall generate a synchronisation failure message using the highest previously accepted sequence number anywhere in the array, i.e. SQNMS. The USIM shall also be able to put a limit L on the difference between SEQMS and a received sequence number component SEQ. If such a limit L is applied then, before verifying the above conditions (a) and (b), the sequence number shall only be accepted by the USIM if SEQMS - SEQ < L. If SQN can not be accepted then the USIM shall generate a synchronisation failure message using SQNMS.