def authenticationAndCipheringRequest(AuthenticationParameterRAND_presence=0, CiphKeySeqNr_presence=0):
 a = TpPd(pd=3)
 b = MessageType(mesType=18)
 d = CipheringAlgorithmAndImeisvRequest()
 e = ForceToStandbyAndAcReferenceNumber()
 packet = (((a / b) / d) / e)
 if (AuthenticationParameterRAND_presence is 1):
  g = AuthenticationParameterRAND(ieiAPR=33)
  packet = (packet / g)
 if (CiphKeySeqNr_presence is 1):
  h = CiphKeySeqNrHdr(ieiCKSN=8, eightBitCKSN=0)
  packet = (packet / h)
 return packet

def authenticationAndCipheringRequest ( AuthenticationParameterRAND_presence = 0 , CiphKeySeqNr_presence = 0 ) : a = TpPd ( pd = 3 ) b = MessageType ( mesType = 18 ) d = CipheringAlgorithmAndImeisvRequest ( ) e = ForceToStandbyAndAcReferenceNumber ( ) packet = ( ( ( a / b ) / d ) / e ) if ( AuthenticationParameterRAND_presence is 1 ) : g = AuthenticationParameterRAND ( ieiAPR = 33 ) packet = ( packet / g ) if ( CiphKeySeqNr_presence is 1 ) : h = CiphKeySeqNrHdr ( ieiCKSN = 8 , eightBitCKSN = 0 ) packet = ( packet / h ) return packet
authentication and ciphering request section 9 .