mirror of
https://github.com/fumiama/gofastTEA.git
synced 2026-07-01 07:20:24 +08:00
add le & sumtable
This commit is contained in:
@@ -15,9 +15,9 @@ func (t TEA) Encrypt(src []byte) (dst []byte) {
|
||||
lens := len(src)
|
||||
fill := 10 - (lens+1)&7
|
||||
dst = make([]byte, fill+lens+7)
|
||||
binary.LittleEndian.PutUint32(dst, Uint32())
|
||||
binary.LittleEndian.PutUint32(dst[4:], Uint32())
|
||||
binary.LittleEndian.PutUint32(dst[8:], Uint32())
|
||||
binary.LittleEndian.PutUint32(dst, randuint32())
|
||||
binary.LittleEndian.PutUint32(dst[4:], randuint32())
|
||||
binary.LittleEndian.PutUint32(dst[8:], randuint32())
|
||||
dst[0] = byte(fill-3) | 0xF8 // 存储pad长度
|
||||
copy(dst[fill:], src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user