xtrace_sdk.x_vec.crypto.encryption.homomorphic_base

Attributes

Classes

HomomorphicBase

The Interface which all homomorphic encryption primitives should implement.

Module Contents

xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.T_CT
xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.T_PT
xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.T_KEY
xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.T_KP
class xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.HomomorphicBase

Bases: Generic[T_CT, T_PT, T_KP, T_KEY], abc.ABC

The Interface which all homomorphic encryption primitives should implement.

Parameters:

ABC (abc.ABC) – Abstract class

static key_gen(*args, **kwargs)
Abstractmethod:

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

T_KP

Key generation routine.

static encrypt(pt, key)
Abstractmethod:

Parameters:
Return type:

T_PT

Encrypts a plain text with key

static decrypt(ct, key)
Abstractmethod:

Parameters:
Return type:

T_CT

decrypts a cipher

static add(ct1, ct2, key)
Abstractmethod:

Parameters:
Return type:

T_CT

homomorphically add two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) + decrypt(ct2)

static multiply(ct1, ct2, key)
Abstractmethod:

Parameters:
Return type:

T_CT

homomorphically multiply two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) * decrypt(ct2)

static xor(ct1, ct2, key)
Abstractmethod:

Parameters:
Return type:

T_CT

homomorphically xor two ciphers and return ct3 such that decrypt(ct3)= decrypt(ct1) ^ decrypt(ct2)