Versions in this module Expand all Collapse all v0 v0.0.0 Dec 30, 2023 Changes in this version + var UncachedSignature = errors.New("uncached signature") + type FilterMask struct + Mask pk.BitSet + Type byte + func (f *FilterMask) ReadFrom(r io.Reader) (n int64, err error) + func (f *FilterMask) WriteTo(w io.Writer) (n int64, err error) + type HistoryMessage struct + Sender uuid.UUID + Signature []byte + func (p *HistoryMessage) ReadFrom(r io.Reader) (n int64, err error) + func (p HistoryMessage) WriteTo(w io.Writer) (n int64, err error) + type HistoryUpdate struct + Acknowledged pk.FixedBitSet + Offset pk.VarInt + func (h *HistoryUpdate) ReadFrom(r io.Reader) (n int64, err error) + func (h HistoryUpdate) WriteTo(w io.Writer) (n int64, err error) + type Message struct + Prev Prev + Signature *Signature + Unsigned *chat.Message + type MessageBody struct + LastSeen []*Signature + PlainMsg string + Salt int64 + Timestamp time.Time + type PackedMessageBody struct + LastSeen []PackedSignature + PlainMsg string + Salt int64 + Timestamp time.Time + func (m *PackedMessageBody) ReadFrom(r io.Reader) (n int64, err error) + func (m *PackedMessageBody) Unpack(cache *SignatureCache) (*MessageBody, error) + func (m *PackedMessageBody) WriteTo(w io.Writer) (n int64, err error) + type PackedSignature struct + ID int32 + func (p PackedSignature) ReadFrom(r io.Reader) (n int64, err error) + func (p PackedSignature) WriteTo(w io.Writer) (n int64, err error) + type Prev struct + Index int + Sender uuid.UUID + Session uuid.UUID + type Session struct + PublicKey user.PublicKey + SessionID uuid.UUID + func (s *Session) InitValidate() + func (s *Session) ReadFrom(r io.Reader) (n int64, err error) + func (s *Session) VerifyAndUpdate(msg *Message) bool + func (s Session) WriteTo(w io.Writer) (n int64, err error) + type Signature [256]byte + func (s *Signature) ReadFrom(r io.Reader) (n int64, err error) + func (s Signature) WriteTo(w io.Writer) (n int64, err error) + type SignatureCache struct + func NewSignatureCache() SignatureCache + func (s *SignatureCache) PopOrInsert(self *Signature, lastSeen []*Signature)