Call rcm() and psi() using self.rho()
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
cbf2e840b9
commit
dbf772b00d
|
@ -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)
|
||||||
|
@ -73,4 +73,4 @@ class OrchardNotePlaintext(object):
|
||||||
|
|
||||||
note = OrchardNote(d, pk_d, v, rho, rseed)
|
note = OrchardNote(d, pk_d, v, rho, rseed)
|
||||||
cm = note.note_commitment()
|
cm = note.note_commitment()
|
||||||
return derive_nullifier(fvk.nk, rho, note.psi, cm)
|
return derive_nullifier(fvk.nk, rho, note.psi, cm)
|
||||||
|
|
Loading…
Reference in New Issue