Section: 6.5.1 RRC integrity mechanisms
Content: RRC integrity protection shall be provided by the PDCP layer between UE and gNB and no layers below PDCP shall be integrity protected. Replay protection shall be activated when integrity protection is activated (except for when the selected integrity protection algorithm is NIA0, see Annex D). Replay protection shall ensure that the receiver accepts each particular incoming PDCP COUNT value only once using the same AS security context. The use and mode of operation of the 128-NIA algorithms are specified in Annex D. The input parameters to the 128-bit NIA algorithms as described in Annex D are the RRC message as MESSAGE, an 128-bit integrity key KRRCint as KEY, a 5-bit bearer identity BEARER which value is assigned as specified by TS 38.323[ NR; Packet Data Convergence Protocol (PDCP) specification ]  [23], the 1-bit direction of transmission DIRECTION and a bearer specific direction dependent 32-bit input COUNT which corresponds to the 32-bit PDCP COUNT. The RRC integrity checks shall be performed both in the ME and the gNB. In case failed integrity check (i.e. faulty or missing MAC-I) is detected after the start of integrity protection, the concerned message shall be discarded. This can happen on the gNB side or on the ME side. UE may trigger a recovery procedure as specified in TS 38.331[ NR; Radio Resource Control (RRC); Protocol specification ]  [22]. NOTE: Failed integrity check does not always imply that the concerned message is silently discarded.