zkay.transaction.crypto.elgamal

Module Contents

zkay.transaction.crypto.elgamal.to_le_32_hex_bytes(num)
zkay.transaction.crypto.elgamal.get_dlog(x: int, y: int)
class zkay.transaction.crypto.elgamal.ElgamalCrypto(keystore: ZkayKeystoreInterface)

Bases: zkay.transaction.interface.ZkayHomomorphicCryptoInterface

API to generate cryptographic keys and perform encryption/decryption operations.

params
_generate_or_load_key_pair(self, address: str) zkay.transaction.types.KeyPair
_write_key_pair(self, key_file: str, pk: List[int], sk: int)
_read_key_pair(self, key_file: str) Tuple[List[int], int]
_generate_key_pair(self) Tuple[List[int], int]
_enc(self, plain: int, _: int, target_pk: int) Tuple[List[int], List[int]]
_dec(self, cipher: Tuple[int, Ellipsis], sk: Any) Tuple[int, List[int]]
_de_embed(self, plain_embedded: zkay.transaction.crypto.babyjubjub.Point) int
do_op(self, op: str, public_key: List[int], *args: Union[zkay.transaction.types.CipherValue, int]) List[int]
do_rerand(self, arg: zkay.transaction.types.CipherValue, public_key: List[int]) Tuple[List[int], List[int]]

Re-randomizes the given argument. Returns (new_cipher, randomness).

_enc_with_rand(self, plain: int, random: int, pk: List[int]) List[int]