xtrace_sdk.x_vec.crypto.encryption.goldwasser_micali¶
Attributes¶
Classes¶
A self implemented Goldwasser Micali encryption scheme |
Module Contents¶
- xtrace_sdk.x_vec.crypto.encryption.goldwasser_micali.BIT_STRING_LENGTH = 1024¶
- class xtrace_sdk.x_vec.crypto.encryption.goldwasser_micali.Goldwasser_Micali(keys)¶
Bases:
xtrace_sdk.x_vec.crypto.encryption.homomorphic_base.HomomorphicBase[list[int],list[int],xtrace_sdk.x_vec.utils.xtrace_types.GoldwasserMicaliKeyPair,xtrace_sdk.x_vec.utils.xtrace_types.GoldwasserMicaliPublicKey]A self implemented Goldwasser Micali encryption scheme
- Parameters:
keys (xtrace_sdk.x_vec.utils.xtrace_types.GoldwasserMicaliKeyPair)
- keys¶
- static key_gen(key_len)¶
Key generation routine for the Goldwasser_Micali crypto scheme.
- Parameters:
key_len (int) – the number of bits in PK SK
- Returns:
Goldwasser_Micali PK, SK pair
- Return type:
Goldwasser_MicaliKeyPair
- static generate_random_r(pk)¶
Helper function for encryption required by Goldwasser_Micali scheme
- Parameters:
pk (GoldwasserMicaliPublicKey) – the public key
- Returns:
a random r to be used for encryption.
- Return type:
- static encrypt(plaintext, pk)¶
Encryption with PK
- static decrypt(ciphertext, keys)¶
Decrypts a cihpher with Goldwasser Micali key pair and returns the plaintext
- static add(ciphertext1, ciphertext2, pk)¶
- Abstractmethod:
- Parameters:
- Return type:
Not supported for Goldwasser_Micali.
- static multiply(ciphertext1, ciphertext2, pk)¶
- Abstractmethod:
- Parameters:
- Return type:
Not supported for Goldwasser_Micali.
- static xor(ciphertext1, ciphertext2, pk)¶
Homomorphic xor of Goldwasser_Micali crypto system.