MCPcopy
hub / github.com/XTLS/REALITY / marshal

Method marshal

handshake_messages.go:1127–1139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1125}
1126
1127func (m *keyUpdateMsg) marshal() ([]byte, error) {
1128 var b cryptobyte.Builder
1129 b.AddUint8(typeKeyUpdate)
1130 b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
1131 if m.updateRequested {
1132 b.AddUint8(1)
1133 } else {
1134 b.AddUint8(0)
1135 }
1136 })
1137
1138 return b.Bytes()
1139}
1140
1141func (m *keyUpdateMsg) unmarshal(data []byte) bool {
1142 s := cryptobyte.String(data)

Callers 1

handleKeyUpdateMethod · 0.95

Calls 1

BytesMethod · 0.80

Tested by

no test coverage detected