Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Classes | Functions | Variables
zeth.core.ownership Namespace Reference

Classes

class  OwnershipKeyPair
 

Functions

str ownership_key_as_hex (bytes a_sk)
 
OwnershipPublicKey ownership_public_key_from_hex (str key_hex)
 
OwnershipSecretKey ownership_secret_key_from_hex (str key_hex)
 
OwnershipKeyPair gen_ownership_keypair ()
 

Variables

 OwnershipSecretKey = NewType('OwnershipSecretKey', bytes)
 
 OwnershipPublicKey = NewType('OwnershipPublicKey', bytes)
 

Function Documentation

◆ gen_ownership_keypair()

OwnershipKeyPair zeth.core.ownership.gen_ownership_keypair ( )

Definition at line 59 of file ownership.py.

59 def gen_ownership_keypair() -> OwnershipKeyPair:
60  a_sk = OwnershipSecretKey(Random.get_random_bytes(32))
61  a_pk = _derive_a_pk(a_sk)
62  keypair = OwnershipKeyPair(a_sk, a_pk)
63  return keypair
64 
65 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ownership_key_as_hex()

str zeth.core.ownership.ownership_key_as_hex ( bytes  a_sk)
Convert either a secret or public ownership key to hex representation of the
underlying 32-byte object.

Definition at line 37 of file ownership.py.

37 def ownership_key_as_hex(a_sk: bytes) -> str:
38  """
39  Convert either a secret or public ownership key to hex representation of the
40  underlying 32-byte object.
41  """
42  return hex_extend_32bytes(a_sk.hex())
43 
44 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ownership_public_key_from_hex()

OwnershipPublicKey zeth.core.ownership.ownership_public_key_from_hex ( str  key_hex)
Read an ownership public key from a hex string.

Definition at line 45 of file ownership.py.

45 def ownership_public_key_from_hex(key_hex: str) -> OwnershipPublicKey:
46  """
47  Read an ownership public key from a hex string.
48  """
49  return OwnershipPublicKey(bytes.fromhex(key_hex))
50 
51 
Here is the caller graph for this function:

◆ ownership_secret_key_from_hex()

OwnershipSecretKey zeth.core.ownership.ownership_secret_key_from_hex ( str  key_hex)
Read an ownership public key from a hex string.

Definition at line 52 of file ownership.py.

52 def ownership_secret_key_from_hex(key_hex: str) -> OwnershipSecretKey:
53  """
54  Read an ownership public key from a hex string.
55  """
56  return OwnershipSecretKey(bytes.fromhex(key_hex))
57 
58 
Here is the caller graph for this function:

Variable Documentation

◆ OwnershipPublicKey

zeth.core.ownership.OwnershipPublicKey = NewType('OwnershipPublicKey', bytes)

Definition at line 22 of file ownership.py.

◆ OwnershipSecretKey

zeth.core.ownership.OwnershipSecretKey = NewType('OwnershipSecretKey', bytes)

Definition at line 18 of file ownership.py.

zeth.core.utils.hex_extend_32bytes
str hex_extend_32bytes(str element)
Definition: utils.py:210
zeth.core.ownership.ownership_key_as_hex
str ownership_key_as_hex(bytes a_sk)
Definition: ownership.py:37
zeth.core.ownership.ownership_secret_key_from_hex
OwnershipSecretKey ownership_secret_key_from_hex(str key_hex)
Definition: ownership.py:52
zeth.core.ownership.OwnershipPublicKey
OwnershipPublicKey
Definition: ownership.py:22
zeth.core.ownership.gen_ownership_keypair
OwnershipKeyPair gen_ownership_keypair()
Definition: ownership.py:59
zeth.core.ownership.ownership_public_key_from_hex
OwnershipPublicKey ownership_public_key_from_hex(str key_hex)
Definition: ownership.py:45
zeth.core.ownership.OwnershipSecretKey
OwnershipSecretKey
Definition: ownership.py:18