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

Method marshal

handshake_messages.go:1593–1603  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1591}
1592
1593func (m *serverKeyExchangeMsg) marshal() ([]byte, error) {
1594 length := len(m.key)
1595 x := make([]byte, length+4)
1596 x[0] = typeServerKeyExchange
1597 x[1] = uint8(length >> 16)
1598 x[2] = uint8(length >> 8)
1599 x[3] = uint8(length)
1600 copy(x[4:], m.key)
1601
1602 return x, nil
1603}
1604
1605func (m *serverKeyExchangeMsg) unmarshal(data []byte) bool {
1606 if len(data) < 4 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected