mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
22 lines
379 B
Go
22 lines
379 B
Go
package primitives
|
|
|
|
import (
|
|
fssz "github.com/prysmaticlabs/fastssz"
|
|
)
|
|
|
|
// SSZBytes --
|
|
type SSZBytes []byte
|
|
|
|
// HashTreeRoot --
|
|
func (b *SSZBytes) HashTreeRoot() ([32]byte, error) {
|
|
return fssz.HashWithDefaultHasher(b)
|
|
}
|
|
|
|
// HashTreeRootWith --
|
|
func (b *SSZBytes) HashTreeRootWith(hh *fssz.Hasher) error {
|
|
indx := hh.Index()
|
|
hh.PutBytes(*b)
|
|
hh.Merkleize(indx)
|
|
return nil
|
|
}
|