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

Method marshal

handshake_messages.go:1521–1535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1519}
1520
1521func (m *clientKeyExchangeMsg) marshal() []byte {
1522 if m.raw != nil {
1523 return m.raw
1524 }
1525 length := len(m.ciphertext)
1526 x := make([]byte, length+4)
1527 x[0] = typeClientKeyExchange
1528 x[1] = uint8(length >> 16)
1529 x[2] = uint8(length >> 8)
1530 x[3] = uint8(length)
1531 copy(x[4:], m.ciphertext)
1532
1533 m.raw = x
1534 return x
1535}
1536
1537func (m *clientKeyExchangeMsg) unmarshal(data []byte) bool {
1538 m.raw = data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected