1
0
mirror of https://github.com/fumiama/gofastTEA.git synced 2026-06-04 23:40:29 +08:00

fix: encrypt to in go 1.17

This commit is contained in:
源文雨
2022-03-15 20:49:14 +08:00
parent 0e36c3e985
commit 3a1a8fa624

View File

@@ -41,7 +41,7 @@ func (t TEA) EncryptTo(src []byte, dst []byte) int {
copy(dst[fill:], src)
var iv1, iv2, holder uint64
for i := 0; i < len(dst); i += 8 {
for i := 0; i < fill+lens+7; i += 8 {
block := binary.BigEndian.Uint64(dst[i:])
holder = block ^ iv1
iv1 = t.encode(holder)