AUDIT changes

This commit is contained in:
jdl
2026-06-13 00:10:21 +02:00
parent 11f6f2fc75
commit cd5442f3bf
6 changed files with 10 additions and 10 deletions

View File

@@ -29,8 +29,8 @@ type Packet struct {
Signed []byte // Raw signed message for verification (incoming packet).
}
// Marshal the packet into a buffer with prefixed signature.
func (p Packet) Marshal(buf []byte, signKey *[64]byte) []byte {
// marshal the packet into a buffer with prefixed signature.
func (p Packet) marshal(buf []byte, signKey *[64]byte) []byte {
buf[0] = p.PeerIP
copy(buf[1:33], p.WGPubKey[:])
binary.BigEndian.PutUint16(buf[33:35], p.WGPort)
@@ -43,7 +43,7 @@ func (p Packet) Verify(buf []byte, pubKey *[32]byte) bool {
return ok
}
func Unmarshal(signed []byte) (p Packet) {
func unmarshal(signed []byte) (p Packet) {
buf := signed[signSize:]
p.PeerIP = buf[0]
copy(p.WGPubKey[:], buf[1:33])