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

28 lines
595 B
Go

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