Call rcm() and psi() using self.rho()

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
ying tong 2021-05-27 12:48:44 +08:00 committed by therealyingtong
parent cbf2e840b9
commit dbf772b00d
1 changed files with 7 additions and 7 deletions

View File

@ -14,8 +14,8 @@ class OrchardNote(object):
self.v = v self.v = v
self.rho = rho self.rho = rho
self.rseed = rseed self.rseed = rseed
self.rcm = self.rcm(rho) self.rcm = self.rcm()
self.psi = self.psi(rho) self.psi = self.psi()
def __eq__(self, other): def __eq__(self, other):
if other is None: if other is None:
@ -29,11 +29,11 @@ class OrchardNote(object):
self.psi == other.psi self.psi == other.psi
) )
def rcm(self, rho): def rcm(self):
return to_scalar(prf_expand(self.rseed, b'\x05' + bytes(rho))) return to_scalar(prf_expand(self.rseed, b'\x05' + bytes(self.rho)))
def psi(self, rho): def psi(self):
return to_base(prf_expand(self.rseed, b'\x09' + bytes(rho))) return to_base(prf_expand(self.rseed, b'\x09' + bytes(self.rho)))
def note_commitment(self): def note_commitment(self):
g_d = diversify_hash(self.d) g_d = diversify_hash(self.d)