MCPcopy Create free account
hub / github.com/cryptidtech/oberon / Token

Class Token

python/oberon/classes.py:54–76  ·  view source on GitHub ↗

An Oberon Token

Source from the content-addressed store, hash-verified

52
53
54class Token:
55 """An Oberon Token"""
56
57 def __init__(self, value: bytes):
58 if len(value) == token_size():
59 self.value = value
60 else:
61 raise Exception("invalid size")
62
63 def __bytes__(self):
64 return self.value
65
66 def add_blinding(self, blinder: bytes):
67 return Token(add_blinding(self.value, blinder))
68
69 def remove_blinding(self, blinder: bytes):
70 return Token(remove_blinding(self.value, blinder))
71
72 def create_proof(self, identifier: bytes, blindings: list[bytes], nonce: bytes):
73 return Proof(create_proof(self.value, identifier, blindings, nonce))
74
75 def verify(self, identifier: bytes, public_key: PublicKey):
76 return verify_token(self.value, public_key.value, identifier)
77
78
79class Proof:

Callers 3

new_tokenMethod · 0.70
add_blindingMethod · 0.70
remove_blindingMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected