Versions in this module Expand all Collapse all v0 v0.1.0 May 25, 2026 Changes in this version + var ErrTreeFull = errors.New("tree: no blank leaf available") + func HPKEKeysFromPathSecret(pathSecret []byte) (crypto.HPKEPrivateKey, crypto.HPKEPublicKey, error) + func Hash(t *Tree) ([]byte, error) + func LeafCount(width uint32) uint32 + func NextPathSecret(prev []byte) ([]byte, error) + func NodeWidth(leafCount uint32) uint32 + type Capabilities struct + Ciphersuites []uint16 + Credentials []CredentialType + Extensions []ExtensionType + Proposals []ProposalType + Versions []ProtocolVersion + func (c *Capabilities) UnmarshalMLS(d *mlstls.Decoder) error + func (c Capabilities) MarshalMLS(e *mlstls.Encoder) error + type Credential struct + Identity []byte + Type CredentialType + func BasicCredential(identity []byte) Credential + func (c *Credential) UnmarshalMLS(d *mlstls.Decoder) error + func (c Credential) MarshalMLS(e *mlstls.Encoder) error + type CredentialType uint16 + const CredentialBasic + const CredentialX509 + type Extension struct + Data []byte + Type ExtensionType + func (x *Extension) UnmarshalMLS(d *mlstls.Decoder) error + func (x Extension) MarshalMLS(e *mlstls.Encoder) error + type ExtensionType uint16 + type LeafIndex uint32 + func (l LeafIndex) ToNode() NodeIndex + type LeafNode struct + Capabilities Capabilities + Credential Credential + EncryptionKey crypto.HPKEPublicKey + Extensions []Extension + Lifetime Lifetime + ParentHash []byte + Signature []byte + SignatureKey crypto.SignaturePublicKey + Source LeafNodeSource + func (l *LeafNode) MarshalLeafTBS(e *mlstls.Encoder, groupID []byte, leafIndex uint32) error + func (l *LeafNode) MarshalMLS(e *mlstls.Encoder) error + func (l *LeafNode) UnmarshalMLS(d *mlstls.Decoder) error + type LeafNodeSource uint8 + const LeafNodeSourceCommit + const LeafNodeSourceKeyPackage + const LeafNodeSourceUpdate + type Lifetime struct + NotAfter uint64 + NotBefore uint64 + func (l *Lifetime) UnmarshalMLS(d *mlstls.Decoder) error + func (l Lifetime) MarshalMLS(e *mlstls.Encoder) error + type Node struct + Leaf *LeafNode + Parent *ParentNode + func (n *Node) IsBlank() bool + type NodeIndex uint32 + func CommonAncestor(x, y NodeIndex) NodeIndex + func Root(width uint32) NodeIndex + func (n NodeIndex) Copath(width uint32) []NodeIndex + func (n NodeIndex) DirectPath(width uint32) []NodeIndex + func (n NodeIndex) IsLeaf() bool + func (n NodeIndex) Left() (NodeIndex, bool) + func (n NodeIndex) Level() uint32 + func (n NodeIndex) Parent(width uint32) (NodeIndex, bool) + func (n NodeIndex) Right() (NodeIndex, bool) + func (n NodeIndex) Sibling(width uint32) (NodeIndex, bool) + func (n NodeIndex) ToLeaf() (LeafIndex, bool) + type ParentNode struct + EncryptionKey crypto.HPKEPublicKey + ParentHash []byte + UnmergedLeaves []LeafIndex + func (p *ParentNode) MarshalMLS(e *mlstls.Encoder) error + func (p *ParentNode) UnmarshalMLS(d *mlstls.Decoder) error + type ProposalType uint16 + const ProposalAdd + const ProposalExtJoin + const ProposalGCE + const ProposalPSK + const ProposalReinit + const ProposalRemove + const ProposalUpdate + type ProtocolVersion uint16 + const ProtocolVersionMLS10 + type Tree struct + func FromNodes(snap []*Node) (*Tree, error) + func New(creator *LeafNode) *Tree + func (t *Tree) AddLeaf(leaf *LeafNode) (LeafIndex, error) + func (t *Tree) At(idx NodeIndex) *Node + func (t *Tree) BlankDirectPath(from NodeIndex) error + func (t *Tree) BlankLeaf(li LeafIndex) error + func (t *Tree) BlankParent(idx NodeIndex) error + func (t *Tree) Leaf(li LeafIndex) (*LeafNode, error) + func (t *Tree) LeafCount() uint32 + func (t *Tree) Parent(idx NodeIndex) *ParentNode + func (t *Tree) PopulatedLeaves() []LeafIndex + func (t *Tree) Resolution(idx NodeIndex) []NodeIndex + func (t *Tree) SetLeaf(li LeafIndex, leaf *LeafNode) error + func (t *Tree) SetParent(idx NodeIndex, p *ParentNode) error + func (t *Tree) Width() uint32 + type UpdatePath struct + LeafNode LeafNode + Nodes []UpdatePathNode + func (u *UpdatePath) MarshalMLS(e *mlstls.Encoder) error + func (u *UpdatePath) UnmarshalMLS(d *mlstls.Decoder) error + type UpdatePathNode struct + EncryptedPathSecrets []crypto.HPKECiphertext + EncryptionKey crypto.HPKEPublicKey + func (n *UpdatePathNode) MarshalMLS(e *mlstls.Encoder) error + func (n *UpdatePathNode) UnmarshalMLS(d *mlstls.Decoder) error