Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxGroupMembers = 1000 MaxGroupStateBytes = 8 * 1024 * 1024 )
Variables ¶
View Source
var ErrMLSProviderRequired = errors.New("an audited RFC 9420 MLS/TreeKEM provider is required")
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
GroupID string `json:"group_id"`
Epoch uint64 `json:"epoch"`
Previous []byte `json:"previous"`
Kind ActionKind `json:"kind"`
ActorID string `json:"actor_id"`
Subject protocol.NodePublicIdentity `json:"subject"`
CreatedAt time.Time `json:"created_at"`
Signature protocol.HybridSignature `json:"signature"`
}
func SignAction ¶
func SignAction(signer *pqcrypto.HybridSigner, action Action) (Action, error)
type ActionKind ¶
type ActionKind string
const ( ActionAdd ActionKind = "add" ActionRemove ActionKind = "remove" ActionBan ActionKind = "ban" ActionGrantAdmin ActionKind = "grant_admin" ActionRevokeAdmin ActionKind = "revoke_admin" ActionTransferOwner ActionKind = "transfer_owner" )
type MLSProvider ¶
type MLSProvider interface {
Create(ctx context.Context, groupID string, creatorCredential []byte) ([]byte, error)
Add(ctx context.Context, state []byte, keyPackage []byte) (newState, commit, welcome []byte, err error)
Remove(ctx context.Context, state []byte, leafIndex uint32) (newState, commit []byte, err error)
Encrypt(ctx context.Context, state, plaintext []byte) (newState, ciphertext []byte, err error)
Decrypt(ctx context.Context, state, ciphertext []byte) (newState, plaintext []byte, err error)
}
MLSProvider keeps authorization separate from group encryption. A provider implementation should use RFC 9420 MLS and map every successful State action to the corresponding Add/Remove/Update proposal and Commit.
Hybrid post-quantum MLS ciphersuites are intentionally not implemented here: they are still IETF drafts. This boundary lets an audited provider replace the transport without changing frontends or node APIs.
type Member ¶
type Member struct {
Identity protocol.NodePublicIdentity `json:"identity"`
Role Role `json:"role"`
}
type State ¶
type State struct {
GroupID string `json:"group_id"`
Creator protocol.NodePublicIdentity `json:"creator"`
GenesisNonce []byte `json:"genesis_nonce"`
Epoch uint64 `json:"epoch"`
Policy Policy `json:"policy"`
Members map[string]Member `json:"members"`
Hash []byte `json:"hash"`
// contains filtered or unexported fields
}
func (*State) UnmarshalJSON ¶
UnmarshalJSON restores the non-serialized concurrency guard and validates the complete self-certifying state before committing it to the receiver. Unknown fields and trailing JSON values are rejected.
Click to show internal directories.
Click to hide internal directories.