mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 17:52:25 +01:00
elkrem: add method to export sender root
As noted in the comment on the method, this serialization method isn’t strictly necessary assuming the root is derived via a cryptographically secure, yet deterministic procedure. The method is supplied only for convenience.
This commit is contained in:
parent
14f12fbb7d
commit
381474fc8e
@ -121,3 +121,10 @@ func ElkremReceiverFromBytes(b []byte) (*ElkremReceiver, error) {
|
||||
return &e, nil
|
||||
}
|
||||
|
||||
// ToBytes returns the root of the elkrem sender tree as a byte slice. This
|
||||
// function is in place to allow one to export the root of the tree. However,
|
||||
// node that if one uses a deterministic procedure to generate the root, then
|
||||
// serialization isn't necessary as it can simply be re-derived on the fly.
|
||||
func (e *ElkremSender) ToBytes() []byte {
|
||||
return e.root[:]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user