MCPcopy Create free account
hub / github.com/XTLS/Go / marshal

Method marshal

handshake_messages.go:944–961  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

942}
943
944func (m *keyUpdateMsg) marshal() []byte {
945 if m.raw != nil {
946 return m.raw
947 }
948
949 var b cryptobyte.Builder
950 b.AddUint8(typeKeyUpdate)
951 b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
952 if m.updateRequested {
953 b.AddUint8(1)
954 } else {
955 b.AddUint8(0)
956 }
957 })
958
959 m.raw = b.BytesOrPanic()
960 return m.raw
961}
962
963func (m *keyUpdateMsg) unmarshal(data []byte) bool {
964 m.raw = data

Callers 1

handleKeyUpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected