1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-10 06:16:53 -05:00
v2fly/transport/internet/kcp/xor.go
database64128 c78ee5aac7
🏡 Housekeeping: Update to Go 1.17 (#1215)
* ⬆ Update to Go 1.17

* 🏗 Update workflows and add windows-arm64

* 💾 Update generated files

* 📛 Update not-so-friendly filenames
2021-08-21 13:20:40 +08:00

19 lines
358 B
Go

//go:build !amd64
// +build !amd64
package kcp
// xorfwd performs XOR forwards in words, x[i] ^= x[i-4], i from 0 to len
func xorfwd(x []byte) {
for i := 4; i < len(x); i++ {
x[i] ^= x[i-4]
}
}
// xorbkd performs XOR backwords in words, x[i] ^= x[i-4], i from len to 0
func xorbkd(x []byte) {
for i := len(x) - 1; i >= 4; i-- {
x[i] ^= x[i-4]
}
}