Documentation ¶
Index ¶
- Constants
- func GetTreeConfig(encodingType EncodingType) (merkletree.Config, error)
- type BlindedEntropy
- type BlindedPreimage
- type EncodedLeaf
- type Encoder
- func (e *Encoder) BlindedPreimage(leaf Leaf, key Key, secret Secret) (BlindedPreimage, error)
- func (e *Encoder) Encode(leaf Leaf, key Key, secret Secret) ([]byte, error)
- func (e *Encoder) EncodingType() EncodingType
- func (e *Encoder) GenerateSecret() (Secret, error)
- func (e *Encoder) Hash(preimage BlindedPreimage) ([]byte, error)
- type EncodingType
- type HashMeta
- type HistoricalQueryResponse
- type ID
- type Key
- type Leaf
- type LeafBytes
- type LeafContainer
- type LeafType
- type Path
- type QueryResponse
- type Revelations
- type RootHash
- type RootMetadata
- type SHA512_256Hasher
- type Secret
- type SigID
- type Skiplist
- type Skips
- type Teamv1HiddenTail
- type Teamv1Leaf
- type TreeSeqno
Constants ¶
View Source
const CurrentEncodingType = EncodingTypeBlindedSHA512_256v1
View Source
const (
LeafTypeTeamv1 = 1
)
Variables ¶
This section is empty.
Functions ¶
func GetTreeConfig ¶
func GetTreeConfig(encodingType EncodingType) (merkletree.Config, error)
Types ¶
type BlindedEntropy ¶
type BlindedEntropy []byte
type BlindedPreimage ¶
type BlindedPreimage struct { LeafContainer LeafContainer BlindedEntropy BlindedEntropy }
func NewBlindedPreimage ¶
func NewBlindedPreimage(leaf Leaf, blindedEntropy BlindedEntropy) (BlindedPreimage, error)
type EncodedLeaf ¶
type EncodedLeaf []byte
func (EncodedLeaf) Construct ¶
func (l EncodedLeaf) Construct() interface{}
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(encodingType EncodingType) *Encoder
func (*Encoder) BlindedPreimage ¶
func (*Encoder) EncodingType ¶
func (e *Encoder) EncodingType() EncodingType
func (*Encoder) GenerateSecret ¶
type EncodingType ¶
type EncodingType byte
const (
EncodingTypeBlindedSHA512_256v1 EncodingType = 1 // p = HMAC-SHA512-256; (k, v) -> (k, p(p(k, s), v)) where s is a secret unique per Merkle seqno
)
type HistoricalQueryResponse ¶
type HistoricalQueryResponse struct { RootMetadata RootMetadata `codec:"r,omitempty"` Paths []Path `codec:"p,omitempty"` BlindedPreimages []BlindedPreimage `codec:"v,omitempty"` Skiplists []Skiplist `codec:"s,omitempty"` }
type Leaf ¶
type Leaf interface { Serialize() ([]byte, error) Type() LeafType ID() ID GetRevelations() Revelations }
type LeafContainer ¶
type LeafContainer struct { LeafType LeafType // specifies structure of leafBytes LeafBytes LeafBytes // msgpack deserialization implements Leaf // contains filtered or unexported fields }
func ExportLeaf ¶
func ExportLeaf(l Leaf) (LeafContainer, error)
func NewLeafContainer ¶
func NewLeafContainer(leafType LeafType, leafBytes LeafBytes) LeafContainer
func (LeafContainer) Serialize ¶
func (c LeafContainer) Serialize() ([]byte, error)
type Path ¶
type Path = []merkletree.Node
type QueryResponse ¶
type QueryResponse struct { RootMetadata RootMetadata `codec:"r,omitempty"` Path Path `codec:"p,omitempty"` BlindedPreimage BlindedPreimage `codec:"v,omitempty"` Skiplists []Skiplist `codec:"s,omitempty"` }
type RootMetadata ¶
type RootMetadata struct { EncodingType EncodingType `codec:"e"` Seqno TreeSeqno `codec:"s"` Skips Skips `codec:"t"` // includes prev Hash RootHash `codec:"r"` // contains filtered or unexported fields }
func (RootMetadata) EncodingAndHashMeta ¶
func (r RootMetadata) EncodingAndHashMeta() (encoding []byte, hashMeta HashMeta, err error)
func (RootMetadata) HashMeta ¶
func (r RootMetadata) HashMeta() (HashMeta, error)
type SHA512_256Hasher ¶
type SHA512_256Hasher struct{}
func (SHA512_256Hasher) Hash ¶
func (h SHA512_256Hasher) Hash(x []byte) merkletree.Hash
type Skiplist ¶
type Skiplist = []RootMetadata
type Teamv1HiddenTail ¶
type Teamv1Leaf ¶
type Teamv1Leaf struct { // do not encode teamID; it's redundant in the tree TeamID sig3.TeamID `codec:"-"` Tails map[keybase1.SeqType]Teamv1HiddenTail // contains filtered or unexported fields }
func (Teamv1Leaf) GetRevelations ¶
func (l Teamv1Leaf) GetRevelations() Revelations
func (Teamv1Leaf) ID ¶
func (l Teamv1Leaf) ID() ID
func (Teamv1Leaf) Serialize ¶
func (l Teamv1Leaf) Serialize() ([]byte, error)
func (Teamv1Leaf) Type ¶
func (l Teamv1Leaf) Type() LeafType
type TreeSeqno ¶
type TreeSeqno int64
func ComputeSkipPath ¶
computeSkipPath computes a log pattern skip path in reverse e.g., start=100, end=2033 -> ret = {1009, 497, 241, 113, 105, 101} such that ret[i+1] \in computeSkipPointers(ret[i])
func ComputeSkipPointers ¶
Click to show internal directories.
Click to hide internal directories.