Files
zeekay 5ee674cbcf rebrand: openziti → hanzozt (Hanzo Zero Trust)
Global rebrand of all OpenZiti references to Hanzo ZT:
- Go module paths: github.com/openziti/* → github.com/hanzozt/*
- Docker images: openziti/* → hanzozt/*
- Java packages: org.openziti.* → org.hanzozt.*
- Brand: OpenZiti → Hanzo ZT
- URLs: openziti.io → hanzozt.dev
2026-02-18 16:13:40 -08:00

30 lines
626 B
Go

package westworld3
import (
"github.com/hanzozt/dilithium/util"
"github.com/pkg/errors"
)
type hello struct {
version uint32
profile uint8
}
func encodeHello(hello hello, data []byte) (n uint32, err error) {
dataSz := len(data)
if dataSz < 5 {
return 0, errors.Errorf("hello too large [%d < 5]", dataSz)
}
util.WriteUint32(data, hello.version)
data[4] = hello.profile
return 5, nil
}
func decodeHello(data []byte) (hello, uint32, error) {
dataSz := len(data)
if dataSz < 5 {
return hello{}, 0, errors.Errorf("short hello buffer [%d < 5]", dataSz)
}
return hello{util.ReadUint32(data), data[4]}, 5, nil
}