Skip to content

Commit

Permalink
simplify EntranceServer crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaiwish committed Dec 31, 2023
1 parent 57bf1ca commit 3db6ee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/entranceserver/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 3db6ee7

Please sign in to comment.