steady

package module
v0.0.0-...-0dcfdb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

Steady: A simple end-to-end secure logging system

A golang implementation of a proof-of-concept Steady relay and simple echo collector. For the corresponding Steady device please see the C implementation.

Brief instructions to run
  1. go get github.com/pylls/steady
  2. run steady-relay
  3. run steady-make-device
  4. copy test.device to the device folder of the C implementation
  5. build and run the C demo device
  6. run steady-echo-collector to read from the relay
Paper

https://eprint.iacr.org/2018/737

License

Apache 2.0

Documentation

Index

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 AuditPath

func AuditPath(m int, data [][]byte) [][]byte

AuditPath as in RFC6962

func CheckPayloadHash

func CheckPayloadHash(payload []byte, policy Policy, bh BlockHeader) bool

func DecodeBlockPayload

func DecodeBlockPayload(payload, pub, pk []byte, policy Policy, bh BlockHeader) (events [][]byte,
	IV []byte, err error)

func EncodePolicy

func EncodePolicy(p Policy) []byte

func MakeEncodedBlock

func MakeEncodedBlock(index, lenPrev, time uint64,
	encrypt, compress bool,
	policy Policy, events [][]byte, sk []byte) ([]byte, error)

func MerkleTreeHash

func MerkleTreeHash(data [][]byte) (root []byte)

MerkleTreeHash as in RFC6962

func RootFromAuditPath

func RootFromAuditPath(l []byte, index, size int, path [][]byte) (r []byte)

RootFromAuditPath computes the expected root from an audit path

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)

type Policy

type Policy struct {
	ID, Signature, Vk, Pub []byte
	Timeout, Space, Time   uint64
}

func DecodePolicy

func DecodePolicy(b []byte) (Policy, error)

func MakePolicy

func MakePolicy(sk, vk, pub []byte,
	timeout, space, time uint64) Policy

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL