xtrace_sdk.crypto.encryption.homomorphic_base ============================================= .. py:module:: xtrace_sdk.crypto.encryption.homomorphic_base Attributes ---------- .. autoapisummary:: xtrace_sdk.crypto.encryption.homomorphic_base.T_CT xtrace_sdk.crypto.encryption.homomorphic_base.T_PT xtrace_sdk.crypto.encryption.homomorphic_base.T_KEY xtrace_sdk.crypto.encryption.homomorphic_base.T_KP Classes ------- .. autoapisummary:: xtrace_sdk.crypto.encryption.homomorphic_base.HomomorphicBase Module Contents --------------- .. py:data:: T_CT .. py:data:: T_PT .. py:data:: T_KEY .. py:data:: T_KP .. py:class:: HomomorphicBase Bases: :py:obj:`Generic`\ [\ :py:obj:`T_CT`\ , :py:obj:`T_PT`\ , :py:obj:`T_KP`\ , :py:obj:`T_KEY`\ ], :py:obj:`abc.ABC` The Interface which all homomorphic encryption primitives should implement. :param ABC: Abstract class :type ABC: abc.ABC .. py:method:: key_gen(*args, **kwargs) :staticmethod: :abstractmethod: Key generation routine. .. py:method:: encrypt(pt, key) :staticmethod: :abstractmethod: Encrypts a plain text with key .. py:method:: decrypt(ct, key) :staticmethod: :abstractmethod: decrypts a cipher .. py:method:: add(ct1, ct2, key) :staticmethod: :abstractmethod: homomorphically add two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) + decrypt(ct2) .. py:method:: multiply(ct1, ct2, key) :staticmethod: :abstractmethod: homomorphically multiply two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) * decrypt(ct2) .. py:method:: xor(ct1, ct2, key) :staticmethod: :abstractmethod: homomorphically xor two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) ^ decrypt(ct2)