

def        __lowercase    (  UpperCAmelCase__		,					UpperCAmelCase__      ):

				"""simple docstring"""






				__lowerCAmelCase					=							''
				for i in table:
								res += inp[i - 1]
				return res


def        __lowercase    (  UpperCAmelCase__      ):

				"""simple docstring"""






				return data[1:] + data[0]


def        __lowercase    (  UpperCAmelCase__		,					UpperCAmelCase__      ):

				"""simple docstring"""






				__lowerCAmelCase					=							''
				for i in range(len(UpperCAmelCase__      )      ):
								if a[i] == b[i]:
												res += "0"
								else:
												res += "1"
				return res


def        __lowercase    (  UpperCAmelCase__		,					UpperCAmelCase__      ):

				"""simple docstring"""






				__lowerCAmelCase					=							int('0b' + data[0] + data[-1]		,					2      )
				__lowerCAmelCase					=							int('0b' + data[1:3]		,					2      )
				return bin(s[row][col]      )[2:]


def        __lowercase    (  UpperCAmelCase__		,					UpperCAmelCase__		,					UpperCAmelCase__		,					UpperCAmelCase__		,					UpperCAmelCase__      ):

				"""simple docstring"""






				__lowerCAmelCase					=							message[:4]
				__lowerCAmelCase					=							message[4:]
				__lowerCAmelCase					=							apply_table(UpperCAmelCase__		,					UpperCAmelCase__      )
				__lowerCAmelCase					=							xor(UpperCAmelCase__		,					UpperCAmelCase__      )
				__lowerCAmelCase					=							apply_sbox(UpperCAmelCase__		,					temp[:4]      )  # noqa: E741
				__lowerCAmelCase					=							apply_sbox(UpperCAmelCase__		,					temp[4:]      )
				__lowerCAmelCase					=							'0' * (2 - len(UpperCAmelCase__      )) + l  # noqa: E741
				__lowerCAmelCase					=							'0' * (2 - len(UpperCAmelCase__      )) + r
				__lowerCAmelCase					=							apply_table(l + r		,					UpperCAmelCase__      )
				__lowerCAmelCase					=							xor(UpperCAmelCase__		,					UpperCAmelCase__      )
				return temp + right


if __name__ == "__main__":
		lowerCamelCase      				=     input('''Enter 10 bit key: ''')
		lowerCamelCase      				=     input('''Enter 8 bit message: ''')

		lowerCamelCase      				=     [6, 3, 7, 4, 8, 5, 1_0, 9]
		lowerCamelCase      				=     [3, 5, 2, 7, 4, 1_0, 1, 9, 8, 6]
		lowerCamelCase      				=     [2, 4, 3, 1]
		lowerCamelCase      				=     [2, 6, 3, 1, 4, 8, 5, 7]
		lowerCamelCase      				=     [4, 1, 3, 5, 7, 2, 8, 6]
		lowerCamelCase      				=     [4, 1, 2, 3, 2, 3, 4, 1]
		lowerCamelCase      				=     [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
		lowerCamelCase      				=     [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

		# key generation
		lowerCamelCase      				=     apply_table(key, paa_table)
		lowerCamelCase      				=     temp[:5]
		lowerCamelCase      				=     temp[5:]
		lowerCamelCase      				=     left_shift(left)
		lowerCamelCase      				=     left_shift(right)
		lowerCamelCase      				=     apply_table(left + right, pa_table)
		lowerCamelCase      				=     left_shift(left)
		lowerCamelCase      				=     left_shift(right)
		lowerCamelCase      				=     left_shift(left)
		lowerCamelCase      				=     left_shift(right)
		lowerCamelCase      				=     apply_table(left + right, pa_table)

		# encryption
		lowerCamelCase      				=     apply_table(message, IP)
		lowerCamelCase      				=     function(expansion, sa, sa, keya, temp)
		lowerCamelCase      				=     temp[4:] + temp[:4]
		lowerCamelCase      				=     function(expansion, sa, sa, keya, temp)
		lowerCamelCase      				=     apply_table(temp, IP_inv)
		print('''Cipher text is:''', CT)

		# decryption
		lowerCamelCase      				=     apply_table(CT, IP)
		lowerCamelCase      				=     function(expansion, sa, sa, keya, temp)
		lowerCamelCase      				=     temp[4:] + temp[:4]
		lowerCamelCase      				=     function(expansion, sa, sa, keya, temp)
		lowerCamelCase      				=     apply_table(temp, IP_inv)
		print('''Plain text after decypting is:''', PT)









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCamelCase      				=     {
    '''configuration_lilt''': ['''LILT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LiltConfig'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCamelCase      				=     [
		    '''LILT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''LiltForQuestionAnswering''',
		    '''LiltForSequenceClassification''',
		    '''LiltForTokenClassification''',
		    '''LiltModel''',
		    '''LiltPreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_lilt import (
				    LILT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LiltForQuestionAnswering,
				    LiltForSequenceClassification,
				    LiltForTokenClassification,
				    LiltModel,
				    LiltPreTrainedModel,
				)

else:
		import sys

		lowerCamelCase      				=     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






