Versions in this module Expand all Collapse all v0 v0.0.1 Jan 3, 2024 Changes in this version + var ErrDecryptionFailed = errors.New("decryption failed") + var ErrKeysDropped = errors.New("CryptoSetup: keys were already dropped") + var ErrKeysNotYetAvailable = errors.New("CryptoSetup: keys at this encryption level not yet available") + var FirstKeyUpdateInterval uint64 = 100 + var KeyUpdateInterval uint64 = protocol.KeyUpdateInterval + var QUICVersionContextKey = &quicVersionContextKey + func GetRetryIntegrityTag(retry []byte, origDestConnID protocol.ConnectionID, ...) *[16]byte + func NewInitialAEAD(connID protocol.ConnectionID, pers protocol.Perspective, ...) (LongHeaderSealer, LongHeaderOpener) + type ConnectionState struct + Used0RTT bool + type CryptoSetup interface + ChangeConnectionID func(protocol.ConnectionID) + ConnectionState func() ConnectionState + DiscardInitialKeys func() + Get0RTTOpener func() (LongHeaderOpener, error) + Get0RTTSealer func() (LongHeaderSealer, error) + Get1RTTOpener func() (ShortHeaderOpener, error) + Get1RTTSealer func() (ShortHeaderSealer, error) + GetHandshakeOpener func() (LongHeaderOpener, error) + GetHandshakeSealer func() (LongHeaderSealer, error) + GetInitialOpener func() (LongHeaderOpener, error) + GetInitialSealer func() (LongHeaderSealer, error) + GetSessionTicket func() ([]byte, error) + HandleMessage func([]byte, protocol.EncryptionLevel) error + NextEvent func() Event + SetHandshakeConfirmed func() + SetLargest1RTTAcked func(protocol.PacketNumber) error + StartHandshake func() error + func NewCryptoSetupClient(connID protocol.ConnectionID, tp *wire.TransportParameters, ...) CryptoSetup + func NewCryptoSetupServer(connID protocol.ConnectionID, localAddr, remoteAddr net.Addr, ...) CryptoSetup + type Event struct + Data []byte + Kind EventKind + TransportParameters *wire.TransportParameters + type EventKind uint8 + const EventDiscard0RTTKeys + const EventHandshakeComplete + const EventNoEvent + const EventReceivedReadKeys + const EventReceivedTransportParameters + const EventRestoredTransportParameters + const EventWriteHandshakeData + const EventWriteInitialData + type LongHeaderOpener interface + DecodePacketNumber func(wirePN protocol.PacketNumber, wirePNLen protocol.PacketNumberLen) protocol.PacketNumber + Open func(dst, src []byte, pn protocol.PacketNumber, associatedData []byte) ([]byte, error) + type LongHeaderSealer interface + EncryptHeader func(sample []byte, firstByte *byte, pnBytes []byte) + Overhead func() int + Seal func(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte + type ShortHeaderOpener interface + DecodePacketNumber func(wirePN protocol.PacketNumber, wirePNLen protocol.PacketNumberLen) protocol.PacketNumber + Open func(dst, src []byte, rcvTime time.Time, pn protocol.PacketNumber, ...) ([]byte, error) + type ShortHeaderSealer interface + KeyPhase func() protocol.KeyPhaseBit + type Token struct + IsRetryToken bool + OriginalDestConnectionID protocol.ConnectionID + RetrySrcConnectionID protocol.ConnectionID + SentTime time.Time + func (t *Token) ValidateRemoteAddr(addr net.Addr) bool + type TokenGenerator struct + func NewTokenGenerator(key TokenProtectorKey) *TokenGenerator + func (g *TokenGenerator) DecodeToken(encrypted []byte) (*Token, error) + func (g *TokenGenerator) NewRetryToken(raddr net.Addr, origDestConnID protocol.ConnectionID, ...) ([]byte, error) + func (g *TokenGenerator) NewToken(raddr net.Addr) ([]byte, error) + type TokenProtectorKey [32]byte