Documentation
¶
Index ¶
- Constants
- func AuditPath(m int, data [][]byte) [][]byte
- func CheckPayloadHash(payload []byte, policy Policy, bh BlockHeader) bool
- func DecodeBlockPayload(payload, pub, pk []byte, policy Policy, bh BlockHeader) (events [][]byte, IV []byte, err error)
- func EncodePolicy(p Policy) []byte
- func MakeEncodedBlock(index, lenPrev, time uint64, encrypt, compress bool, policy Policy, ...) ([]byte, error)
- func MerkleTreeHash(data [][]byte) (root []byte)
- func RootFromAuditPath(l []byte, index, size int, path [][]byte) (r []byte)
- type BlockHeader
- type Policy
Constants ¶
View Source
const ( SetupFilename = "%s.device" DeviceStateFilename = "%s.state" CollectorFilename = "%s.collector" WireVersion = 0x42 WireIdentifierSize = 32 // commands WireCmdStatus = 0x0 WireCmdSetup = 0x1 WireCmdRead = 0x2 WireCmdWrite = 0x3 WireTrue = 0x1 WireFalse = 0x0 WireMore = 0xA WireAuthErr = 0xF WirePolicySize = WireIdentifierSize + lc.VericationKeySize + lc.PublicKeySize + 3*8 + lc.SignatureSize WireBlockHeaderSize = 4*8 + 3*lc.HashOutputLen + lc.SignatureSize WireAuthSize = lc.HashOutputLen MaxBlockSize = 104857600 // 100 MiB )
View Source
const ( // LeafPrefix is the domain separation prefix for leaf hashes. LeafPrefix = 0x00 // NodePrefix is the domain separation prefix for internal block nodes. NodePrefix = 0x01 )
View Source
const IVsize = 32
IVsize is the number of bytes of the random IV per block.
Variables ¶
This section is empty.
Functions ¶
func CheckPayloadHash ¶
func CheckPayloadHash(payload []byte, policy Policy, bh BlockHeader) bool
func DecodeBlockPayload ¶
func EncodePolicy ¶
func MakeEncodedBlock ¶
Types ¶
type BlockHeader ¶
type BlockHeader struct {
Index, LenCur, LenPrev, Time uint64
PayloadHash, HeaderHash, RootHash, Signature []byte
Encrypted, Compressed bool
}
func DecodeBlockHeader ¶
func DecodeBlockHeader(encoded []byte, policy Policy) (b BlockHeader, err error)
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
* Stub for a Steady device in Go, only used to make the device config, * please see the C implementation of the device for now.
|
* Stub for a Steady device in Go, only used to make the device config, * please see the C implementation of the device for now. |
Click to show internal directories.
Click to hide internal directories.