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:
Olaoluwa Osuntokun committed 2016-06-30 11:34:53 -07:00
1 parent 14f12fbb7d
commit 381474fc8e
1 file changed
+7
+7
View File
@@ -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[:]
}