1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-07-13 12:40:12 -04:00

update asm code

This commit is contained in:
v2ray
2016-06-18 02:19:18 +02:00
parent f7396aad8c
commit f54da94d03
3 changed files with 10 additions and 17 deletions

View File

@@ -1,7 +1,15 @@
package kcp
// xorfwd performs XOR forwards in words, x[i] ^= x[i-4], i from 0 to len
func xorfwd(x []byte)
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)
func xorbkd(x []byte) {
for i := len(x) - 1; i >= 4; i-- {
x[i] ^= x[i-4]
}
}