Documentation
¶
Overview ¶
Package protocolsession implements the authenticated end-to-end session primitives shared by protocol roles. Transport and operation routing remain outside this package so relay identity can never become an authorization input.
Index ¶
- Constants
- Variables
- func EncodeBody(value any) ([]byte, error)
- func EncodeLaneAttachRequest(requestedLaneID uint32) ([]byte, error)
- func EncodeLaneGrant(grant LaneGrant) ([]byte, error)
- func EncodeMessage(message Message) ([]byte, error)
- func EncodeOperationFailure(failure OperationFailure) ([]byte, error)
- func EncodeOperationRetry(reason OperationRetryReason) ([]byte, error)
- func EncodePeerPathControl(control PeerPathControl) ([]byte, error)
- func EncodeScanProgress(progress ScanProgress) ([]byte, error)
- func EncodeSessionTerminal(terminal SessionTerminal) ([]byte, error)
- func EncodeTURNDemand(d TURNDemand) ([]byte, error)
- func EncodeTURNGrants(g TURNGrants) ([]byte, error)
- func EnvelopeFrameSize(plaintextBytes int) (int, error)
- func IsNotSent(err error) bool
- func IsOperationCapacityError(err error) bool
- func MarkNotSent(cause error) error
- func MarkSendUncertain(cause error) error
- func MessageAllowedForOperation(requestKind, messageKind MessageKind) bool
- func NewLaneAccept(hello LaneHello, senderNonce []byte, senderPrivateKey ed25519.PrivateKey) ([]byte, error)
- func NewLaneReject(hello LaneHello, rejection LaneRejection, senderPrivateKey ed25519.PrivateKey) ([]byte, error)
- func ParseLaneAccept(encoded []byte, hello LaneHello, sender *senderauth.Verifier) ([]byte, error)
- func ValidTURNCredential(value string) bool
- func ValidTURNServiceID(id string) bool
- func ValidTURNURL(value string) bool
- func ValidateKindDirection(direction Direction, kind MessageKind) error
- func ValidateSessionControlBody(origin Role, kind MessageKind, body []byte) error
- type AuthenticatedOperationViolation
- type AuthenticatedOperationViolationCode
- type ClientHello
- type ClientHelloReplayGuard
- type Direction
- type EnvelopeBinding
- type EnvelopeOpener
- type EnvelopeSealer
- type FrameChannel
- type InboundMessageValidator
- type InboundMessageValidatorFunc
- type InboundValidationResult
- type LaneAdmission
- type LaneAdmissionDisposition
- type LaneAdmissionIdentity
- type LaneAdmissionSettlementGate
- type LaneAdmissionSettlementGateFunc
- type LaneAttachRequest
- type LaneGrant
- type LaneHello
- func (h LaneHello) AttachNonce() []byte
- func (h LaneHello) Encoded() []byte
- func (h LaneHello) LaneEpoch() uint32
- func (h LaneHello) LaneID() uint32
- func (h LaneHello) OperationID() OperationID
- func (h LaneHello) ProtocolSessionID() ProtocolSessionID
- func (h LaneHello) ShareInstance() catalog.ShareInstance
- type LaneRegistry
- func (r *LaneRegistry) AdmitCandidate(encoded, senderNonce []byte, settlement LaneAdmissionSettlementGate) (LaneAdmission, error)
- func (r *LaneRegistry) Close()
- func (r *LaneRegistry) IssueGrant(requestedLaneID uint32, operationID OperationID, attachNonce []byte) (LaneGrant, error)
- func (r *LaneRegistry) Release(laneID, laneEpoch uint32) bool
- func (r *LaneRegistry) RevokeGrant(grant LaneGrant) bool
- func (r *LaneRegistry) Stop()
- type LaneRegistryConfig
- type LaneRejectCode
- type LaneRejection
- type Message
- type MessageHandler
- type MessageHandlerFunc
- type MessageKind
- type OpenedEnvelope
- type Operation
- func (op Operation) ID() OperationID
- func (op Operation) IsActive() bool
- func (op Operation) IsCurrent() bool
- func (op Operation) IsZero() bool
- func (op Operation) PeerAttemptBinding() (PeerAttemptBinding, bool)
- func (op Operation) RequestKind() (MessageKind, bool)
- func (op Operation) Same(other Operation) bool
- type OperationContinuationClassifier
- type OperationContinuationContract
- type OperationContinuationScope
- type OperationDisposition
- type OperationFailure
- type OperationID
- type OperationLimits
- type OperationRetryReason
- type OperationState
- type PeerAttemptAuthority
- type PeerAttemptBinding
- type PeerAttemptContinuationClassifier
- type PeerFailureRecoveryScope
- type PeerPathControl
- type PeerPathControlKind
- type PeerSessionTerminalError
- type ProtocolSessionID
- type ReceiverInstanceID
- type Role
- type RouterLimits
- type ScanProgress
- type SealedEnvelope
- type SendEvidence
- type SenderControlSemanticRegistry
- type SenderControlSemanticRule
- type SenderControlSemanticValidator
- type SenderControlSemanticValidatorFunc
- type ServerHello
- type SessionKeys
- type SessionTerminal
- type TURNDemand
- type TURNGrant
- type TURNGrantID
- type TURNGrants
- type TURNMode
- type TURNStatus
- type TrafficKey
- type TranscriptHash
Constants ¶
const ( EnvelopeNonceBytes = 12 EnvelopeHeaderBytes = 28 EnvelopeTagBytes = 16 EnvelopeOverheadBytes = EnvelopeHeaderBytes + EnvelopeTagBytes MaxEnvelopeBytes = 65_536 MaxEnvelopePlaintextBytes = MaxEnvelopeBytes - EnvelopeOverheadBytes )
const ( LaneAttachNonceBytes = 16 LaneSenderNonceBytes = 16 LaneHelloBodyBytes = 4 + 1 + catalog.IdentityBytes + IdentityBytes + 4 + 4 + OperationIDBytes + LaneAttachNonceBytes LaneHelloBytes = LaneHelloBodyBytes + sha256.Size LaneAcceptBodyBytes = 4 + 1 + sha256.Size + LaneSenderNonceBytes LaneAcceptBytes = LaneAcceptBodyBytes + ed25519.SignatureSize LaneRejectBodyBytes = 4 + 1 + 1 + 2 + sha256.Size + 4 LaneRejectBytes = LaneRejectBodyBytes + ed25519.SignatureSize MaxLaneRetryAfter = 30 * time.Second )
const ( LaneGrantTTL = 30 * time.Second LaneGrantTombstoneTTL = 30 * time.Second DefaultMaxLogicalLanes = 16 DefaultMaxPendingGrants = 64 )
const ( // OperationReplayWindow is the width (in operation IDs) of the sender's // sliding duplicate-detection bitmap, accommodating cross-lane reordering // without per-operation wall-clock tombstone retention. 65,536 IDs occupy // 8 KiB per session and cover >65 seconds at 1,000 operations/sec. OperationReplayWindow = 65536 ControlQueueFrameLimit = 256 ControlQueueByteLimit = 4 * 1024 * 1024 DataQueueFrameLimit = 1024 DataQueueByteLimit = 64 * 1024 * 1024 MaximumDataBurst = 8 MaximumControlBurst = 8 RouterControlQueueLimit = 256 RouterDataQueueLimit = 1024 RouterMaximumControlBurst = 8 )
const ( OperationScopeDirectory uint8 = 2 OperationScopeRevision uint8 = 3 OperationScopeBlock uint8 = 4 OperationScopePeer uint8 = 5 PeerOperationCodeFirst uint16 = 0x5000 PeerOperationCodeLast uint16 = 0x5fff PeerOperationCodeNegotiation uint16 = 0x5001 PeerOperationCodeTimeout uint16 = 0x5002 PeerOperationCodeCandidates uint16 = 0x5003 PeerOperationCodeAdmission uint16 = 0x5004 PeerOperationCodeICE uint16 = 0x5005 PeerOperationCodeSTUN uint16 = 0x5006 PeerOperationCodeTransport uint16 = 0x5007 PeerOperationCodeDTLS uint16 = 0x5008 PeerOperationCodePolicy uint16 = 0x5009 PeerOperationCodeAuthentication uint16 = 0x500a PeerOperationCodeSessionInvariant uint16 = 0x500b PeerOperationCodeCapacity uint16 = 0x500c MaxOperationFailureMessageBytes = 512 MinOperationFailureRetryAfter = time.Millisecond MaxOperationFailureRetryAfter = 30 * time.Second )
const ( MaxPeerPathControlLifetime = 120 * time.Second MaxPeerPathControlBodyBytes = 256 )
const ( IdentityBytes = catalog.IdentityBytes OperationIDBytes = 8 )
const ( SessionTerminalCodeFirst = uint16(0x1001) SessionTerminalCodeLast = uint16(0x1008) MaxSessionTerminalMessageBytes = 512 )
const ( // The signed hello binds the online message contract independently of links. WireVersion = byte(3) HandshakeNonceBytes = 32 X25519KeyBytes = 32 SessionAuthKeyBytes = sha256.Size TrafficKeyBytes = sha256.Size TranscriptHashBytes = sha256.Size ClientHelloBodySize = 4 + 1 + catalog.IdentityBytes + IdentityBytes + HandshakeNonceBytes + X25519KeyBytes ClientHelloSize = ClientHelloBodySize + sha256.Size ServerHelloBodySize = 4 + 1 + sha256.Size + HandshakeNonceBytes + X25519KeyBytes + 4 + 4 ServerHelloSize = ServerHelloBodySize + ed25519.SignatureSize ClientHelloReplayTTL = 5 * time.Minute )
const ( MaxGrantsPerMessage = 4 MaxURLsPerGrant = 8 MaxTURNURLBytes = 512 MaxTURNCredentialBytes = 1024 MaxTURNBodyBytes = 16 << 10 MaxTURNServiceIDBytes = 128 )
const MaximumOperationContinuations = 1_024
Variables ¶
var ( ErrContinuationContract = errors.New("protocolsession: operation continuation contract is invalid") ErrConflictingContinuation = errors.New("protocolsession: operation continuation conflicts with its contract") ErrContinuationPending = errors.New("protocolsession: operation continuation admission is still pending") )
var ( ErrEnvelopeBinding = errors.New("operation envelope binding is invalid") ErrEnvelopeMalformed = errors.New("operation envelope is malformed") ErrEnvelopeVersion = errors.New("operation envelope has an unsupported wire version") ErrEnvelopeDirection = errors.New("operation envelope has the wrong direction") ErrEnvelopeSequence = errors.New("operation envelope sequence is not the next expected value") ErrEnvelopeAuthentication = errors.New("operation envelope authentication failed") ErrEnvelopeTooLarge = errors.New("operation envelope exceeds the frame limit") ErrSequenceExhausted = errors.New("operation envelope sequence is exhausted") ErrNonceSource = errors.New("operation envelope nonce source failed") ErrEnvelopeClosed = errors.New("operation envelope cryptographic state is closed") )
var ( ErrLaneInput = errors.New("protocol session lane input is invalid") ErrLaneMalformed = errors.New("protocol session lane frame is malformed") ErrLaneProof = errors.New("protocol session lane proof is invalid") ErrLaneSignature = errors.New("protocol session lane signature is invalid") )
var ( ErrLaneGrantBudget = errors.New("protocol session lane grant budget is exhausted") ErrLaneEpoch = errors.New("protocol session lane epoch is exhausted") ErrLaneUnknown = errors.New("protocol session logical lane is unknown") ErrLaneStopping = errors.New("protocol session is stopping") ErrLaneSettlementUnclaimed = errors.New("protocol session authenticated lane settlement was not claimed") )
var ( ErrInvalidMessage = errors.New("protocolsession: invalid message") ErrNonCanonicalMessage = errors.New("protocolsession: message is not canonical CBOR") ErrUnknownMessageKind = errors.New("protocolsession: unknown message kind") ErrInvalidOperationID = errors.New("protocolsession: invalid operation identity") ErrMessageTooLarge = errors.New("protocolsession: message exceeds the envelope plaintext limit") ErrFragmentHeader = errors.New("protocolsession: invalid fragment routing header") )
var ( ErrInvalidRole = errors.New("protocolsession: invalid role") ErrInvalidDirection = errors.New("protocolsession: message kind is invalid for direction") ErrUnknownOperation = errors.New("protocolsession: message refers to an unknown operation") ErrOperationIDReused = errors.New("protocolsession: operation identity was reused") ErrUnexpectedOperation = errors.New("protocolsession: message is invalid for the operation") ErrConflictingFinal = errors.New("protocolsession: operation final conflicts with its tombstone") ErrSessionTerminated = errors.New("protocolsession: session is terminal") ErrActiveOperationBudget = errors.New("protocolsession: active operation budget exhausted") ErrNilRuntimeDependency = errors.New("protocolsession: runtime dependency must not be nil") ErrRouterControlFull = errors.New("protocolsession: inbound control queue is full") ErrRouterDataFull = errors.New("protocolsession: inbound data queue is full") ErrHandlerRegistered = errors.New("protocolsession: message kind already has a handler") ErrHandlerMissing = errors.New("protocolsession: message kind has no handler") ErrControlQueueFull = errors.New("protocolsession: control queue capacity exceeded") ErrDataQueueFull = errors.New("protocolsession: data queue capacity exceeded") ErrWriterTerminal = errors.New("protocolsession: writer accepted a terminal message") ErrWriterStopped = errors.New("protocolsession: writer is stopped") ErrMessageClass = errors.New("protocolsession: message submitted to the wrong writer queue") ErrEnvelopeRejected = errors.New("protocolsession: inbound envelope rejected") ErrInboundSemantic = errors.New("protocolsession: inbound message semantic validation failed") ErrInboundRejected = errors.New("protocolsession: inbound message rejected") ErrPeerSessionTerminal = errors.New("protocolsession: peer ended the session") ErrNotSent = errors.New("protocolsession: message was not handed to transport") ErrOperationSuppressed = errors.New("protocolsession: outbound message suppressed for retired or duplicate operation") )
var ( ErrAuthenticatedOperationViolation = errors.New("protocolsession: authenticated operation invariant violated") ErrInvalidAuthenticatedOperationViolation = errors.New("protocolsession: authenticated operation violation is invalid") ErrAuthenticatedOperationObserver = errors.New("protocolsession: authenticated operation observer is invalid") )
var ( ErrInvalidScanProgress = errors.New("scan progress body is invalid") ErrInvalidSessionTerminal = errors.New("session terminal body is invalid") )
var ( ErrHandshakeInput = errors.New("protocol session handshake input is invalid") ErrClientHelloMalformed = errors.New("protocol session client hello is malformed") ErrClientHelloProof = errors.New("protocol session client hello proof is invalid") ErrClientHelloReplay = errors.New("protocol session client hello was already admitted") ErrClientHelloReplayBudget = errors.New("protocol session client hello replay budget is exhausted") ErrServerHelloMalformed = errors.New("protocol session server hello is malformed") ErrServerHelloSignature = errors.New("protocol session server hello signature is invalid") ErrUnsupportedVersion = errors.New("protocol session wire version is unsupported") ErrKeyLength = errors.New("protocol session key must be exactly 32 bytes") ErrTrafficKeyDirection = errors.New("protocol session traffic key has the wrong direction") ErrKeyAgreement = errors.New("protocol session X25519 key agreement failed") )
var DefaultRouterLimits = RouterLimits{ ControlFrames: RouterControlQueueLimit, DataFrames: RouterDataQueueLimit, }
var ErrControlSemantic = errors.New("session control semantic body is invalid")
var ErrIdentityLength = errors.New("protocol session identity must be exactly 16 bytes")
var ErrInvalidOperationFailure = errors.New("operation failure body is invalid")
var ErrInvalidOperationRetry = errors.New("operation retry body is invalid")
var ErrPeerPathControl = errors.New("invalid peer path control")
var ErrTURNControl = errors.New("invalid TURN control")
Functions ¶
func EncodeBody ¶
EncodeBody produces the deterministic CBOR representation expected by NewMessage. Keeping this helper here lets services share one canonical mode without moving their typed schema into the session runtime.
func EncodeLaneAttachRequest ¶
func EncodeLaneGrant ¶
func EncodeMessage ¶
EncodeMessage returns a copy so callers cannot mutate a queued message after it has passed lifecycle validation.
func EncodeOperationFailure ¶
func EncodeOperationFailure(failure OperationFailure) ([]byte, error)
EncodeOperationFailure owns the cross-service wire schema. Keeping it at the protocol-session boundary prevents a directory operation from depending on a content-only validator that cannot represent its frozen error scope.
func EncodeOperationRetry ¶ added in v0.1.6
func EncodeOperationRetry(reason OperationRetryReason) ([]byte, error)
func EncodePeerPathControl ¶
func EncodePeerPathControl(control PeerPathControl) ([]byte, error)
func EncodeScanProgress ¶
func EncodeScanProgress(progress ScanProgress) ([]byte, error)
func EncodeSessionTerminal ¶
func EncodeSessionTerminal(terminal SessionTerminal) ([]byte, error)
func EncodeTURNDemand ¶ added in v0.1.6
func EncodeTURNDemand(d TURNDemand) ([]byte, error)
func EncodeTURNGrants ¶ added in v0.1.6
func EncodeTURNGrants(g TURNGrants) ([]byte, error)
func EnvelopeFrameSize ¶
func IsNotSent ¶ added in v0.1.6
IsNotSent reports whether the frame is proved never to have reached the transport.
func IsOperationCapacityError ¶
IsOperationCapacityError identifies a retryable refusal before any operation authority or wire delivery exists.
func MarkNotSent ¶ added in v0.1.6
MarkNotSent tags an error proved to have failed before transport acquired the frame.
func MarkSendUncertain ¶ added in v0.1.6
MarkSendUncertain marks an aggregated send error where at least one attempt may have reached transport. It removes per-attempt ErrNotSent wrappers so errors.Is(err, ErrNotSent) stays false and guards IsNotSent under later joins while preserving every underlying cause.
func MessageAllowedForOperation ¶ added in v0.1.6
func MessageAllowedForOperation(requestKind, messageKind MessageKind) bool
func NewLaneAccept ¶
func NewLaneReject ¶
func NewLaneReject(hello LaneHello, rejection LaneRejection, senderPrivateKey ed25519.PrivateKey) ([]byte, error)
func ParseLaneAccept ¶
func ValidTURNCredential ¶ added in v0.1.6
func ValidTURNServiceID ¶ added in v0.1.6
Service IDs preserve internal spaces and reject Unicode White_Space at either boundary.
func ValidTURNURL ¶ added in v0.1.6
func ValidateKindDirection ¶ added in v0.1.6
func ValidateKindDirection(direction Direction, kind MessageKind) error
func ValidateSessionControlBody ¶
func ValidateSessionControlBody(origin Role, kind MessageKind, body []byte) error
The authenticated outer kind selects the schema. Body versions remain local to each protocol, so a schema revision cannot redirect another control family.
Types ¶
type AuthenticatedOperationViolation ¶
type AuthenticatedOperationViolation struct {
// contains filtered or unexported fields
}
func NewAuthenticatedOperationViolation ¶
func NewAuthenticatedOperationViolation(code AuthenticatedOperationViolationCode) (AuthenticatedOperationViolation, error)
func (AuthenticatedOperationViolation) Code ¶
func (violation AuthenticatedOperationViolation) Code() AuthenticatedOperationViolationCode
func (AuthenticatedOperationViolation) MatchesAuthenticatedMessage ¶ added in v0.1.6
func (violation AuthenticatedOperationViolation) MatchesAuthenticatedMessage(message Message) bool
func (AuthenticatedOperationViolation) Valid ¶ added in v0.1.6
func (violation AuthenticatedOperationViolation) Valid() bool
type AuthenticatedOperationViolationCode ¶
type AuthenticatedOperationViolationCode uint8
AuthenticatedOperationViolationCode names facts proved after envelope and sender-control authentication but before ordinary operation dispatch.
const ( AuthenticatedOperationViolationMalformedFailure AuthenticatedOperationViolationCode = iota + 1 AuthenticatedOperationViolationMalformedPeerControl AuthenticatedOperationViolationConflictingPeerAnswer AuthenticatedOperationViolationConflictingFinal AuthenticatedOperationViolationContinuationContract )
type ClientHello ¶
type ClientHello struct {
// contains filtered or unexported fields
}
func NewClientHello ¶
func NewClientHello( share catalog.ShareInstance, receiver ReceiverInstanceID, receiverNonce []byte, receiverPublic *ecdh.PublicKey, sessionAuthKey []byte, ) (ClientHello, error)
func (ClientHello) Body ¶
func (h ClientHello) Body() []byte
func (ClientHello) Encoded ¶
func (h ClientHello) Encoded() []byte
func (ClientHello) ReceiverInstanceID ¶
func (h ClientHello) ReceiverInstanceID() ReceiverInstanceID
func (ClientHello) ReceiverNonce ¶
func (h ClientHello) ReceiverNonce() []byte
func (ClientHello) ReceiverPublicKey ¶
func (h ClientHello) ReceiverPublicKey() *ecdh.PublicKey
func (ClientHello) ShareInstance ¶
func (h ClientHello) ShareInstance() catalog.ShareInstance
type ClientHelloReplayGuard ¶
type ClientHelloReplayGuard struct {
// contains filtered or unexported fields
}
ClientHelloReplayGuard owns the atomic admission tombstone. ReceiverInstanceID is intentionally excluded because it is diagnostic and must not let a holder of the share capability replay the same nonce and ephemeral key.
func NewClientHelloReplayGuard ¶
func NewClientHelloReplayGuard(capacity int, now func() time.Time) (*ClientHelloReplayGuard, error)
func (*ClientHelloReplayGuard) AcceptClientHello ¶
func (g *ClientHelloReplayGuard) AcceptClientHello( encoded []byte, expectedShare catalog.ShareInstance, sessionAuthKey []byte, ) (ClientHello, error)
AcceptClientHello makes proof verification and replay admission one atomic sender-side API. Keeping the parser private prevents a future caller from admitting catalog work after authenticating a hello but forgetting its share-scoped replay tombstone.
type EnvelopeBinding ¶
type EnvelopeBinding struct {
ProtocolSessionID ProtocolSessionID
LaneID uint32
LaneEpoch uint32
Direction Direction
}
type EnvelopeOpener ¶
type EnvelopeOpener struct {
// contains filtered or unexported fields
}
EnvelopeOpener advances only after AEAD authentication. A forged frame can therefore fail closed without consuming the legitimate sender's sequence.
func NewEnvelopeOpener ¶
func NewEnvelopeOpener(key TrafficKey, binding EnvelopeBinding) (*EnvelopeOpener, error)
func (*EnvelopeOpener) Close ¶
func (o *EnvelopeOpener) Close()
func (*EnvelopeOpener) Destroy ¶
func (o *EnvelopeOpener) Destroy()
Destroy drops the opener's sole AEAD reference and zeroes its visible binding and sequence state. The standard-library AEAD schedule has no zeroization API and is therefore released to GC after this reference is removed.
func (*EnvelopeOpener) NextSequence ¶
func (o *EnvelopeOpener) NextSequence() (uint64, error)
func (*EnvelopeOpener) Open ¶
func (o *EnvelopeOpener) Open(frame []byte) (OpenedEnvelope, error)
func (*EnvelopeOpener) Stop ¶
func (o *EnvelopeOpener) Stop()
Stop is safe at the protocol callback boundary; Destroy remains the lane owner's post-pump join operation.
type EnvelopeSealer ¶
type EnvelopeSealer struct {
// contains filtered or unexported fields
}
EnvelopeSealer is intentionally stateful: one lane writer owns one instance, making sequence assignment and nonce generation impossible to bypass.
func NewEnvelopeSealer ¶
func NewEnvelopeSealer(key TrafficKey, binding EnvelopeBinding, nonceSource io.Reader) (*EnvelopeSealer, error)
func (*EnvelopeSealer) Close ¶
func (s *EnvelopeSealer) Close()
func (*EnvelopeSealer) Destroy ¶
func (s *EnvelopeSealer) Destroy()
Destroy releases every reference and zeroes all directly accessible cryptographic state owned by the sealer. Go's cipher.AEAD does not expose a destructor for its internal AES expanded schedule; clearing aead drops this component's only reference so that opaque schedule becomes garbage-collector managed rather than pretending it was deterministically overwritten.
func (*EnvelopeSealer) NextSequence ¶
func (s *EnvelopeSealer) NextSequence() (uint64, error)
func (*EnvelopeSealer) Seal ¶
func (s *EnvelopeSealer) Seal(plaintext []byte) (SealedEnvelope, error)
func (*EnvelopeSealer) Stop ¶
func (s *EnvelopeSealer) Stop()
Stop freezes future envelope use without touching fields an in-flight writer or pump may still be reading. The lane owner calls Destroy only after those components have joined.
type FrameChannel ¶
type FrameChannel interface {
Send(ctx context.Context, frame framechannel.Frame) error
SendTerminal(ctx context.Context, frame framechannel.Frame) error
Recv() <-chan framechannel.Frame
State() framechannel.ChannelState
Close() error
}
FrameChannel is defined where it is consumed. Retaining the parent Frame and ChannelState types keeps transport adapters wire-neutral.
type InboundMessageValidator ¶ added in v0.1.4
type InboundMessageValidator interface {
ValidateInbound(message Message) (InboundValidationResult, error)
}
InboundMessageValidator checks role message schemas after the lane authenticates the envelope. It cannot grant authority to an unopened frame.
type InboundMessageValidatorFunc ¶ added in v0.1.4
type InboundMessageValidatorFunc func(Message) (InboundValidationResult, error)
func SenderMessageValidator ¶ added in v0.1.4
func SenderMessageValidator(semantic SenderControlSemanticValidator) InboundMessageValidatorFunc
SenderMessageValidator runs inside the lane pump, after authenticated decryption and before operation admission. A valid envelope can still carry an invalid operation result, which must retire the correct operation.
func (InboundMessageValidatorFunc) ValidateInbound ¶ added in v0.1.4
func (validate InboundMessageValidatorFunc) ValidateInbound(message Message) (InboundValidationResult, error)
type InboundValidationResult ¶ added in v0.1.4
type InboundValidationResult struct {
// contains filtered or unexported fields
}
InboundValidationResult is a sealed result of validating one authenticated message.
func ValidateReceiverMessage ¶ added in v0.1.4
func ValidateReceiverMessage(message Message) (InboundValidationResult, error)
func (InboundValidationResult) HasOperationViolation ¶ added in v0.1.4
func (result InboundValidationResult) HasOperationViolation() bool
func (InboundValidationResult) OperationViolation ¶ added in v0.1.6
func (result InboundValidationResult) OperationViolation() AuthenticatedOperationViolation
type LaneAdmission ¶
type LaneAdmission struct {
Disposition LaneAdmissionDisposition
SettlementBegan bool
OperationID OperationID
LaneID uint32
LaneEpoch uint32
Rejection LaneRejection
Response []byte
}
type LaneAdmissionDisposition ¶
type LaneAdmissionDisposition uint8
const ( LaneAdmissionAccepted LaneAdmissionDisposition = iota + 1 LaneAdmissionRejected LaneAdmissionSilentClose )
type LaneAdmissionIdentity ¶
type LaneAdmissionSettlementGate ¶
type LaneAdmissionSettlementGate interface {
BeginAuthenticatedSettlement(OperationID, LaneAdmissionIdentity) bool
}
LaneAdmissionSettlementGate transfers terminal authority to the exact connectivity attempt after WS2A authentication and before registry state or signed evidence changes. Implementations must make this a one-shot state transition; false leaves the grant untouched and produces no response.
type LaneAdmissionSettlementGateFunc ¶
type LaneAdmissionSettlementGateFunc func(OperationID, LaneAdmissionIdentity) bool
func (LaneAdmissionSettlementGateFunc) BeginAuthenticatedSettlement ¶
func (function LaneAdmissionSettlementGateFunc) BeginAuthenticatedSettlement( operationID OperationID, lane LaneAdmissionIdentity, ) bool
type LaneAttachRequest ¶
type LaneAttachRequest struct {
RequestedLaneID uint32
}
func DecodeLaneAttachRequest ¶
func DecodeLaneAttachRequest(encoded []byte) (LaneAttachRequest, error)
type LaneGrant ¶
type LaneGrant struct {
LaneID uint32
LaneEpoch uint32
OperationID OperationID
AttachNonce [LaneAttachNonceBytes]byte
}
LaneGrant carries the protocol authorization for one channel attachment. OperationID is bound by the enclosing message; expiry remains private to the sender's registry because it is not conveyed to the receiver.
func DecodeLaneGrant ¶
func DecodeLaneGrant(encoded []byte, operationID OperationID) (LaneGrant, error)
type LaneHello ¶
type LaneHello struct {
// contains filtered or unexported fields
}
func NewLaneHello ¶
func NewLaneHello(share catalog.ShareInstance, session ProtocolSessionID, laneID, laneEpoch uint32, operationID OperationID, attachNonce []byte, receiverToSender TrafficKey) (LaneHello, error)
func ParseLaneHello ¶
func ParseLaneHello(encoded []byte, receiverToSender TrafficKey) (LaneHello, error)
func (LaneHello) AttachNonce ¶
func (LaneHello) OperationID ¶
func (h LaneHello) OperationID() OperationID
func (LaneHello) ProtocolSessionID ¶
func (h LaneHello) ProtocolSessionID() ProtocolSessionID
func (LaneHello) ShareInstance ¶
func (h LaneHello) ShareInstance() catalog.ShareInstance
type LaneRegistry ¶
type LaneRegistry struct {
// contains filtered or unexported fields
}
func NewLaneRegistry ¶
func NewLaneRegistry(config LaneRegistryConfig) (*LaneRegistry, error)
func (*LaneRegistry) AdmitCandidate ¶
func (r *LaneRegistry) AdmitCandidate( encoded, senderNonce []byte, settlement LaneAdmissionSettlementGate, ) (LaneAdmission, error)
AdmitCandidate returns SilentClose for malformed, unauthenticated, or unclaimed input. A signed response or registry mutation is legal only after the traffic-key proof and the caller's synchronous settlement transition.
func (*LaneRegistry) Close ¶
func (r *LaneRegistry) Close()
func (*LaneRegistry) IssueGrant ¶
func (r *LaneRegistry) IssueGrant(requestedLaneID uint32, operationID OperationID, attachNonce []byte) (LaneGrant, error)
func (*LaneRegistry) Release ¶
func (r *LaneRegistry) Release(laneID, laneEpoch uint32) bool
func (*LaneRegistry) RevokeGrant ¶
func (r *LaneRegistry) RevokeGrant(grant LaneGrant) bool
RevokeGrant removes only the exact grant returned by IssueGrant. LaneEpoch and nonce comparison prevent a delayed sender operation from revoking same-ID work.
func (*LaneRegistry) Stop ¶
func (r *LaneRegistry) Stop()
type LaneRegistryConfig ¶
type LaneRegistryConfig struct {
ProtocolSessionID ProtocolSessionID
ReceiverToSender TrafficKey
SenderSigningKey ed25519.PrivateKey
InitialLaneID uint32
MaxLogicalLanes int
MaxPendingGrants int
Now func() time.Time
}
type LaneRejectCode ¶
type LaneRejectCode uint8
const ( LaneRejectUnknownSession LaneRejectCode = iota + 1 LaneRejectStaleEpoch LaneRejectGrantExpired LaneRejectGrantConsumed LaneRejectAdmissionLimited LaneRejectStopping LaneRejectGrantMismatch )
func (LaneRejectCode) DiagnosticName ¶
func (value LaneRejectCode) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
type LaneRejection ¶
type LaneRejection struct {
Code LaneRejectCode
RetryAfter time.Duration
}
func ParseLaneReject ¶
func ParseLaneReject(encoded []byte, hello LaneHello, sender *senderauth.Verifier) (LaneRejection, error)
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is an immutable authenticated-plaintext message. Body remains opaque because catalog, revision, and block schemas belong to their business modules. For MessageBlockFragment, Body returns the complete binary fragment plaintext.
func DecodeMessage ¶
DecodeMessage rejects merely decodable CBOR. Re-encoding the typed outer map and the opaque body prevents alternate integers, map order, and indefinite forms from creating multiple authenticated byte representations.
func NewMessage ¶
func NewMessage(kind MessageKind, operationID *OperationID, body []byte) (Message, error)
NewMessage validates an ordinary CBOR message and owns copies of all input. Binary block fragments use DecodeMessage because their operation identity is part of the fixed fragment header rather than the CBOR wrapper.
func (Message) Kind ¶
func (m Message) Kind() MessageKind
func (Message) OperationFingerprint ¶ added in v0.1.6
func (Message) OperationID ¶
func (m Message) OperationID() (OperationID, bool)
type MessageHandler ¶
MessageHandler consumes authenticated messages with an explicit Operation handle. Handlers should admit work into their own bounded queue and return promptly.
type MessageHandlerFunc ¶
func (MessageHandlerFunc) HandleMessage ¶
type MessageKind ¶
type MessageKind uint8
MessageKind identifies the operation carried inside an authenticated envelope. Values are wire contract values and therefore intentionally explicit.
const ( MessageListChildren MessageKind = 1 MessageCatalogResult MessageKind = 2 MessageOpenRevisions MessageKind = 3 MessageOpenResults MessageKind = 4 MessageRenewLease MessageKind = 5 MessageReleaseLease MessageKind = 6 MessageRequestBlocks MessageKind = 7 MessageBlockFragment MessageKind = 8 MessageCancel MessageKind = 9 MessageOperationError MessageKind = 10 MessageSessionTerminal MessageKind = 11 MessageLaneAttach MessageKind = 12 MessageScanProgress MessageKind = 13 MessageOperationComplete MessageKind = 14 MessageLeaseResult MessageKind = 15 MessagePeerOffer MessageKind = 16 MessagePeerAnswer MessageKind = 17 MessagePeerCandidate MessageKind = 18 MessagePeerPathControl MessageKind = 19 MessageTURNControl MessageKind = 20 MessageOperationRetry MessageKind = 21 )
func (MessageKind) DiagnosticName ¶
func (value MessageKind) DiagnosticName() string
DiagnosticName belongs to the source vocabulary; recorders accept new values.
func (MessageKind) IsFinal ¶ added in v0.1.6
func (kind MessageKind) IsFinal() bool
func (MessageKind) IsRequest ¶ added in v0.1.6
func (kind MessageKind) IsRequest() bool
func (MessageKind) IsSessionControl ¶ added in v0.1.6
func (kind MessageKind) IsSessionControl() bool
Session controls outlive negotiation operations and never acquire their permits.
func (MessageKind) Valid ¶ added in v0.1.6
func (kind MessageKind) Valid() bool
type OpenedEnvelope ¶
type Operation ¶ added in v0.1.6
type Operation struct {
// contains filtered or unexported fields
}
Operation is an explicit, comparable handle passed to message handlers and outbound response calls, replacing implicit context.Value capability smuggling. Because OperationID is strictly monotonic per session, the ID itself uniquely identifies the operation without a separate generation token.
func NewOperation ¶ added in v0.1.6
func NewOperation(id OperationID, state OperationState) Operation
func (Operation) ID ¶ added in v0.1.6
func (op Operation) ID() OperationID
func (Operation) PeerAttemptBinding ¶ added in v0.1.6
func (op Operation) PeerAttemptBinding() (PeerAttemptBinding, bool)
func (Operation) RequestKind ¶ added in v0.1.6
func (op Operation) RequestKind() (MessageKind, bool)
type OperationContinuationClassifier ¶
type OperationContinuationClassifier interface {
BeginOperationContinuation(
requestKind MessageKind,
canonicalRequestBody []byte,
) (OperationContinuationContract, bool, error)
ClassifyUnboundOperationContinuation(
kind MessageKind,
canonicalBody []byte,
) (OperationContinuationScope, bool, error)
}
OperationContinuationClassifier creates the immutable continuation contract for one request generation. The session runtime owns replay state; an injected schema owner only decodes the opaque request and continuation bodies.
type OperationContinuationContract ¶
type OperationContinuationContract interface {
ClassifyOperationContinuation(
kind MessageKind,
canonicalBody []byte,
) ([sha256.Size]byte, bool, error)
OperationContinuationScope() OperationContinuationScope
MaximumContinuations() int
}
OperationContinuationContract validates a continuation against the request that created it and returns its canonical semantic fingerprint.
type OperationDisposition ¶
type OperationDisposition uint8
OperationDisposition reports whether an authenticated message is delivered, idempotently dropped, terminates the session, or fell behind the replay window.
const ( OperationDeliver OperationDisposition = iota OperationDrop OperationSessionTerminal OperationBelowReplayWindow )
type OperationFailure ¶
type OperationFailure struct {
Scope uint8
Code uint16
Retryable bool
RetryAfter time.Duration
Message string
PeerAttempt *PeerAttemptBinding
}
func DecodeOperationFailure ¶
func DecodeOperationFailure(encoded []byte) (OperationFailure, error)
DecodeOperationFailure is the receive-side authority for OPERATION_ERROR semantics.
type OperationID ¶
type OperationID uint64
OperationID is a session-scoped monotonically increasing 64-bit counter issued by the receiver starting at 1. Zero denotes absence.
func OperationIDFromBigEndian ¶ added in v0.1.6
func OperationIDFromBigEndian(raw []byte) (OperationID, error)
func OperationIDFromUint64 ¶ added in v0.1.6
func OperationIDFromUint64(raw uint64) (OperationID, error)
func (OperationID) AppendBigEndian ¶ added in v0.1.6
func (id OperationID) AppendBigEndian(dst []byte) []byte
func (OperationID) Equal ¶
func (id OperationID) Equal(other OperationID) bool
func (OperationID) IsZero ¶
func (id OperationID) IsZero() bool
func (OperationID) PutBigEndian ¶ added in v0.1.6
func (id OperationID) PutBigEndian(dst []byte)
func (OperationID) String ¶ added in v0.1.6
func (id OperationID) String() string
func (OperationID) Uint64 ¶ added in v0.1.6
func (id OperationID) Uint64() uint64
type OperationLimits ¶
type OperationRetryReason ¶ added in v0.1.6
type OperationRetryReason uint8
OperationRetryReason identifies why the sender declined to admit a request without terminating the session, asking the receiver to reissue it with a fresh OperationID.
const (
OperationRetryReasonReplayWindow OperationRetryReason = 1
)
func DecodeOperationRetry ¶ added in v0.1.6
func DecodeOperationRetry(encoded []byte) (OperationRetryReason, error)
type OperationState ¶ added in v0.1.6
type OperationState interface {
Active(OperationID) bool
Current(OperationID) bool
RequestKind(OperationID) (MessageKind, bool)
PeerAttemptBinding(OperationID) (PeerAttemptBinding, bool)
}
OperationState is the read-only authority query backing an explicit Operation handle.
type PeerAttemptAuthority ¶ added in v0.1.6
type PeerAttemptAuthority interface {
PeerAttemptBinding() PeerAttemptBinding
}
PeerAttemptAuthority is optionally implemented by an OperationContinuationContract whose request owns a peer attempt binding.
type PeerAttemptBinding ¶
type PeerAttemptBinding struct {
PeerSlot uint8
PeerPathID [16]byte
AttemptID [16]byte
AttemptSequence uint64
}
PeerAttemptBinding identifies one negotiation. PeerSlot is session-scoped; its sequence survives replacement of the physical PeerPathID.
func (PeerAttemptBinding) Valid ¶ added in v0.1.6
func (binding PeerAttemptBinding) Valid() bool
type PeerAttemptContinuationClassifier ¶
type PeerAttemptContinuationClassifier interface {
ClassifyPeerAttemptContinuation(MessageKind, []byte) (PeerAttemptBinding, bool, error)
}
PeerAttemptContinuationClassifier supplies schema-validated identities only. Incoming messages may consult an existing retirement boundary, never create it.
type PeerFailureRecoveryScope ¶
type PeerFailureRecoveryScope string
const ( PeerFailureAttemptTransient PeerFailureRecoveryScope = "attempt-transient" PeerFailureResourceDeferred PeerFailureRecoveryScope = "resource-deferred" PeerFailurePathTerminal PeerFailureRecoveryScope = "path-terminal" PeerFailureSessionTerminal PeerFailureRecoveryScope = "session-terminal" )
func PeerFailureScope ¶
func PeerFailureScope(code uint16) PeerFailureRecoveryScope
PeerFailureScope grants recovery authority only to known typed reasons. Text and Retryable never revive an operation, and an unknown reason cannot confer session termination authority or an automatic retry.
type PeerPathControl ¶
type PeerPathControl struct {
PeerPathID [IdentityBytes]byte
NetworkGenerationID [IdentityBytes]byte
ControlSequence uint64
Kind PeerPathControlKind
ValidFor time.Duration
HoldFor time.Duration
}
PeerPathControl has session authority, never negotiation-operation authority. Durations are relative to authenticated receipt, avoiding remote clock trust.
func DecodePeerPathControl ¶
func DecodePeerPathControl(body []byte) (PeerPathControl, error)
type PeerPathControlKind ¶
type PeerPathControlKind uint8
const ( PeerPathDemand PeerPathControlKind = iota + 1 PeerPathRevoke PeerPathMappingReady PeerPathNetworkChanged )
type PeerSessionTerminalError ¶
type PeerSessionTerminalError struct {
// contains filtered or unexported fields
}
PeerSessionTerminalError retains the authenticated terminal message for callers that decode diagnostics while still supporting errors.Is classification.
func NewPeerSessionTerminalError ¶ added in v0.1.5
func NewPeerSessionTerminalError(message Message) *PeerSessionTerminalError
func (*PeerSessionTerminalError) Error ¶
func (terminal *PeerSessionTerminalError) Error() string
func (*PeerSessionTerminalError) Message ¶
func (terminal *PeerSessionTerminalError) Message() Message
func (*PeerSessionTerminalError) Terminal ¶ added in v0.1.5
func (terminal *PeerSessionTerminalError) Terminal() (SessionTerminal, error)
func (*PeerSessionTerminalError) Unwrap ¶
func (terminal *PeerSessionTerminalError) Unwrap() error
type ProtocolSessionID ¶
type ProtocolSessionID [IdentityBytes]byte
func ProtocolSessionIDFromBytes ¶
func ProtocolSessionIDFromBytes(raw []byte) (ProtocolSessionID, error)
func UntrustedLaneHelloRoute ¶
func UntrustedLaneHelloRoute(encoded []byte) (catalog.ShareInstance, ProtocolSessionID, error)
UntrustedLaneHelloRoute extracts only the identities needed to select the candidate ProtocolSession. Callers must not authorize or answer from this result: LaneRegistry.AdmitCandidate performs the traffic-key proof before any signed response or resource admission is legal.
func (ProtocolSessionID) Bytes ¶
func (id ProtocolSessionID) Bytes() []byte
func (ProtocolSessionID) Equal ¶
func (id ProtocolSessionID) Equal(other ProtocolSessionID) bool
func (ProtocolSessionID) IsZero ¶
func (id ProtocolSessionID) IsZero() bool
type ReceiverInstanceID ¶
type ReceiverInstanceID [IdentityBytes]byte
func ReceiverInstanceIDFromBytes ¶
func ReceiverInstanceIDFromBytes(raw []byte) (ReceiverInstanceID, error)
func (ReceiverInstanceID) Bytes ¶
func (id ReceiverInstanceID) Bytes() []byte
func (ReceiverInstanceID) Equal ¶
func (id ReceiverInstanceID) Equal(other ReceiverInstanceID) bool
func (ReceiverInstanceID) IsZero ¶
func (id ReceiverInstanceID) IsZero() bool
type Role ¶
type Role uint8
Role determines, rather than merely documents, the only directions a runtime may receive and send. This prevents accidentally wiring two receiver halves.
func (Role) DiagnosticName ¶
DiagnosticName belongs to the source vocabulary; recorders accept new values.
func (Role) InboundDirection ¶
func (Role) OutboundDirection ¶
type RouterLimits ¶
RouterLimits permits lower local admission limits without changing wire limits.
type ScanProgress ¶
type ScanProgress struct {
AttemptID catalog.ScanAttemptID
DiscoveredEntries uint64
}
func DecodeScanProgress ¶
func DecodeScanProgress(encoded []byte) (ScanProgress, error)
type SealedEnvelope ¶
type SendEvidence ¶ added in v0.1.6
type SendEvidence uint8
SendEvidence expresses cross-lane transport proof independently of error aggregation so joined per-lane failures cannot conflate one pre-transport refusal with another lane's uncertain acceptance.
const ( // SendUncertain is the conservative zero value: transport ownership was not // proved absent, so callers must retain peer-visible recovery state. SendUncertain SendEvidence = iota SendDelivered SendNotSent )
type SenderControlSemanticRegistry ¶
type SenderControlSemanticRegistry struct {
// contains filtered or unexported fields
}
func NewSenderControlSemanticRegistry ¶
func NewSenderControlSemanticRegistry( rules ...SenderControlSemanticRule, ) (*SenderControlSemanticRegistry, error)
func (*SenderControlSemanticRegistry) ValidateSenderControl ¶
func (registry *SenderControlSemanticRegistry) ValidateSenderControl( kind MessageKind, operationID OperationID, semantic []byte, ) error
type SenderControlSemanticRule ¶
type SenderControlSemanticRule struct {
Kind MessageKind
Validate SenderControlSemanticValidatorFunc
}
SenderControlSemanticRule binds one sender control kind to its typed decoder. Keeping this registry at the authentication boundary prevents a new final kind from silently bypassing semantic validation before routing.
type SenderControlSemanticValidator ¶
type SenderControlSemanticValidator interface {
ValidateSenderControl(MessageKind, OperationID, []byte) error
}
type SenderControlSemanticValidatorFunc ¶
type SenderControlSemanticValidatorFunc func(MessageKind, OperationID, []byte) error
func (SenderControlSemanticValidatorFunc) ValidateSenderControl ¶
func (validate SenderControlSemanticValidatorFunc) ValidateSenderControl( kind MessageKind, operationID OperationID, semantic []byte, ) error
type ServerHello ¶
type ServerHello struct {
// contains filtered or unexported fields
}
func NewServerHello ¶
func NewServerHello( client ClientHello, senderNonce []byte, senderPublic *ecdh.PublicKey, initialLaneID uint32, senderSigningKey ed25519.PrivateKey, ) (ServerHello, error)
func ParseServerHello ¶
func ParseServerHello(encoded []byte, client ClientHello, sender *senderauth.Verifier) (ServerHello, error)
func (ServerHello) Body ¶
func (h ServerHello) Body() []byte
func (ServerHello) Encoded ¶
func (h ServerHello) Encoded() []byte
func (ServerHello) InitialLaneEpoch ¶
func (h ServerHello) InitialLaneEpoch() uint32
func (ServerHello) InitialLaneID ¶
func (h ServerHello) InitialLaneID() uint32
func (ServerHello) SenderNonce ¶
func (h ServerHello) SenderNonce() []byte
func (ServerHello) SenderPublicKey ¶
func (h ServerHello) SenderPublicKey() *ecdh.PublicKey
type SessionKeys ¶
type SessionKeys struct {
// contains filtered or unexported fields
}
func DeriveReceiverSession ¶
func DeriveReceiverSession( receiverPrivate *ecdh.PrivateKey, sessionAuthKey []byte, client ClientHello, server ServerHello, ) (SessionKeys, error)
func DeriveSenderSession ¶
func DeriveSenderSession( senderPrivate *ecdh.PrivateKey, sessionAuthKey []byte, client ClientHello, server ServerHello, ) (SessionKeys, error)
func (*SessionKeys) Destroy ¶
func (k *SessionKeys) Destroy()
func (SessionKeys) ProtocolSessionID ¶
func (k SessionKeys) ProtocolSessionID() ProtocolSessionID
func (SessionKeys) ReceiverToSender ¶
func (k SessionKeys) ReceiverToSender() TrafficKey
func (SessionKeys) SenderToReceiver ¶
func (k SessionKeys) SenderToReceiver() TrafficKey
func (SessionKeys) TranscriptHash ¶
func (k SessionKeys) TranscriptHash() TranscriptHash
type SessionTerminal ¶
func DecodeSessionTerminal ¶
func DecodeSessionTerminal(encoded []byte) (SessionTerminal, error)
type TURNDemand ¶ added in v0.1.6
func DecodeTURNDemand ¶ added in v0.1.6
func DecodeTURNDemand(body []byte) (TURNDemand, error)
type TURNGrant ¶ added in v0.1.6
type TURNGrantID ¶ added in v0.1.6
type TURNGrantID [IdentityBytes]byte
type TURNGrants ¶ added in v0.1.6
type TURNGrants struct {
RequestID uint64
Status TURNStatus
HasFallback bool
Grants []TURNGrant
}
func DecodeTURNGrants ¶ added in v0.1.6
func DecodeTURNGrants(body []byte) (TURNGrants, error)
type TURNStatus ¶ added in v0.1.6
type TURNStatus uint8
const ( TURNOK TURNStatus = iota + 1 TURNUnconfigured TURNRetryLater TURNPartialRetryable )
func TURNRetryStatus ¶ added in v0.1.6
func TURNRetryStatus(grants int) TURNStatus
TURNRetryStatus preserves successful grants while other requested services retry.
type TrafficKey ¶
type TrafficKey struct {
// contains filtered or unexported fields
}
TrafficKey carries its derivation direction so the two transcript keys cannot be interchanged at a lane boundary. Direction in envelope AAD detects a peer mismatch, but rejecting the mistake locally avoids emitting an undecryptable first frame and consuming the lane sequence.
func TrafficKeyFromBytes ¶
func TrafficKeyFromBytes(raw []byte, direction Direction) (TrafficKey, error)
func (TrafficKey) Bytes ¶
func (k TrafficKey) Bytes() []byte
func (*TrafficKey) Destroy ¶
func (k *TrafficKey) Destroy()
func (TrafficKey) Equal ¶
func (k TrafficKey) Equal(other TrafficKey) bool
type TranscriptHash ¶
type TranscriptHash [TranscriptHashBytes]byte
func (TranscriptHash) Bytes ¶
func (h TranscriptHash) Bytes() []byte
func (TranscriptHash) Equal ¶
func (h TranscriptHash) Equal(other TranscriptHash) bool