mirror of https://github.com/nucypher/nucypher.git
Making it easier to get an hrac from outside PolicyGroup.
parent
6554df9c03
commit
38e692a526
|
@ -110,6 +110,14 @@ class PolicyGroup(object):
|
|||
pass # Tell Alice to either wait or lower the value of n.
|
||||
|
||||
def hrac(self):
|
||||
"""
|
||||
A convenience method for generating an hrac for this instance.
|
||||
"""
|
||||
return self.hrac_for(self.alice, self.bob, self.uri)
|
||||
|
||||
@staticmethod
|
||||
def hrac_for(alice, bob, uri):
|
||||
|
||||
"""
|
||||
The "hashed resource authentication code".
|
||||
|
||||
|
@ -121,7 +129,7 @@ class PolicyGroup(object):
|
|||
Alice and Bob have all the information they need to construct this.
|
||||
Ursula does not, so we share it with her.
|
||||
"""
|
||||
return self.hash(bytes(self.alice.seal) + bytes(self.bob.seal) + self.uri)
|
||||
return PolicyGroup.hash(bytes(alice.seal) + bytes(bob.seal) + uri)
|
||||
|
||||
def treasure_map_dht_key(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue