mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
simplify EntranceServer crypto
This commit is contained in:
@@ -16,8 +16,8 @@ func CalcSum32(data []byte) uint32 {
|
||||
tableIdx1 := int((data[len(data)>>1] + 1) & 0xFF)
|
||||
out := make([]byte, 4)
|
||||
for i := 0; i < len(data); i++ {
|
||||
key := _sum32Table0[(tableIdx0+i)%7] ^ _sum32Table1[(tableIdx1+i)%9]
|
||||
out[i&3] = (out[i&3] + (data[i] ^ key)) & 0xFF
|
||||
key := data[i] ^ _sum32Table0[(tableIdx0+i)%7] ^ _sum32Table1[(tableIdx1+i)%9]
|
||||
out[i&3] = (out[i&3] + key) & 0xFF
|
||||
}
|
||||
return binary.BigEndian.Uint32(out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user