# Path: sim_soft/sim_auth.py
# MASK_48_BIT = 0xFFFFFFFFFFFF
# MASK_64_BIT = 0xFFFFFFFFFFFFFFFF
# MASK_128_BIT = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
# AUTH_RESULT_OK = 0xDB
# AUTH_RESULT_SYNCHORNISATION_FAILURE = 0xDC
# def rotateLeft128bit(i, n):
# def dummyXor(key, rand, sqn, amf, autn):
# def dummyXorHex(key, rand, sqn, amf, autn):
# def keyHex(key, length=16):
# def dummyXorData(rand, key, sqn, amf, autn=None):
# def authenticateDummyXor(rand, key, sqn, amf, autn=None):


import sys
import os.path
import logging
import unittest
from sim_soft import sim_auth
                     "amf=%s\n"
                        %(key, rand, sqn, amf))
        result = sim_auth.dummyXorHex(key, rand, sqn, amf, None)

        self.assertEqual(result['res'], res)
        self.assertEqual(result['ck'], ck)
        self.assertEqual(result['ik'], ik)
        self.assertEqual(result['kc'], kc)
        self.assertEqual(result['autn'], autn)

    def test_2_dummy_xor(self):
        # input:
        key = "00112233445566778899AABBCCDDEEFF"
        rand = "41ec50d284b5284fb9a317e9f089f247"
        sqn = "FFFFFFFFFFFF"
        amf = "8000"

        # expected output
        autn = "1E3F1FB1C7CE8000BE028D1E3F1FCE38"
        res = "41FD72E1C0E04E38313ABD523C541CB8"
        ck = "FD72E1C0E04E38313ABD523C541CB841"
        ik = "72E1C0E04E38313ABD523C541CB841FD"
        kc = "087C4F48E6D2F0B7"

        logging.info("Codes to check:\n"
                     "key=%s\n"
                     "rand=%s\n"
                     "sqn=%s\n"
                     "amf=%s\n"
                        %(key, rand, sqn, amf))

# Path: sim_soft/sim_auth.py
# MASK_48_BIT = 0xFFFFFFFFFFFF
# MASK_64_BIT = 0xFFFFFFFFFFFFFFFF
# MASK_128_BIT = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
# AUTH_RESULT_OK = 0xDB
# AUTH_RESULT_SYNCHORNISATION_FAILURE = 0xDC
# def rotateLeft128bit(i, n):
# def dummyXor(key, rand, sqn, amf, autn):
# def dummyXorHex(key, rand, sqn, amf, autn):
# def keyHex(key, length=16):
# def dummyXorData(rand, key, sqn, amf, autn=None):
# def authenticateDummyXor(rand, key, sqn, amf, autn=None):


# Path: tests/soft/test_authentication.py
import sys
import os.path
import logging
import unittest
from sim_soft import sim_auth

                     "amf=%s\n"
                        %(key, rand, sqn, amf))
        result = sim_auth.dummyXorHex(key, rand, sqn, amf, None)

        self.assertEqual(result['res'], res)
        self.assertEqual(result['ck'], ck)
        self.assertEqual(result['ik'], ik)
        self.assertEqual(result['kc'], kc)
        self.assertEqual(result['autn'], autn)

    def test_2_dummy_xor(self):
        # input:
        key = "00112233445566778899AABBCCDDEEFF"
        rand = "41ec50d284b5284fb9a317e9f089f247"
        sqn = "FFFFFFFFFFFF"
        amf = "8000"

        # expected output
        autn = "1E3F1FB1C7CE8000BE028D1E3F1FCE38"
        res = "41FD72E1C0E04E38313ABD523C541CB8"
        ck = "FD72E1C0E04E38313ABD523C541CB841"
        ik = "72E1C0E04E38313ABD523C541CB841FD"
        kc = "087C4F48E6D2F0B7"

        logging.info("Codes to check:\n"
                     "key=%s\n"
                     "rand=%s\n"
                     "sqn=%s\n"
                     "amf=%s\n"
                        %(key, rand, sqn, amf))

        result = sim_auth.dummyXorHex(key, rand, sqn, amf, None)