msc: cipher mode: move cipher expect to new function

Move the ciphering calculations from f_mm_common() to new function
f_get_expected_encryption(), so that it can be re-used for ciphering in
inter-BSC handover (upcoming patch).

Add tr_BSSMAP_CipherModeCmd2() to conveniently use the values returned
by f_get_expected_encryption().

To verify the Ciphering Mode Command in f_mm_common(), use the new
tr_BSSMAP_CipherModeCmd2(), and rely on template matching instead of
checking each IE individually.

Related: SYS#5324
Change-Id: I1f775889fb801d441ea6c8b0f0c34718b814c09e
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 1dcbef1..21cf742 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -546,6 +546,11 @@
 	}
 }
 
+template (present) BSSMAP_IE_KC128 tr_BSSMAP_IE_Kc128(template (present) OCT16 kc128) := {
+	elementIdentifier := '83'O,
+	kC128_Value := kc128
+}
+
 template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := {
 	elementIdentifier := '83'O,
 	kC128_Value := kc128
@@ -1398,21 +1403,25 @@
 	}
 }
 
-template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key)
+template PDU_BSSAP tr_BSSMAP_CipherModeCmd2(template BSSMAP_IE_EncryptionInformation encryptionInformation := *,
+					    template BSSMAP_IE_KC128 kC128 := *)
 modifies tr_BSSAP_BSSMAP := {
 	pdu := {
 		bssmap := {
 			cipherModeCommand := {
 				messageType := '53'O,
 				layer3HeaderInfo := *,
-				encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg),
+				encryptionInformation := encryptionInformation,
 				cipherResponseMode := *,
-				kC128 := *
+				kC128 := kC128
 			}
 		}
 	}
 }
 
+template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key, template BSSMAP_IE_KC128 kC128 := omit)
+ := tr_BSSMAP_CipherModeCmd2(tr_BSSMAP_IE_EncrInfo(key, alg), kC128);
+
 template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg)
 modifies ts_BSSAP_BSSMAP := {
 	pdu := {