mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
p2p: opt using bitutil.XORBytes
This commit is contained in:
parent
59405c40d3
commit
090b93ad82
1 changed files with 1 additions and 3 deletions
|
|
@ -287,9 +287,7 @@ func (m *hashMAC) compute(sum1, seed []byte) []byte {
|
|||
}
|
||||
|
||||
m.cipher.Encrypt(m.aesBuffer[:], sum1)
|
||||
for i := range m.aesBuffer {
|
||||
m.aesBuffer[i] ^= seed[i]
|
||||
}
|
||||
bitutil.XORBytes(m.aesBuffer[:], m.aesBuffer[:], seed)
|
||||
m.hash.Write(m.aesBuffer[:])
|
||||
sum2 := m.hash.Sum(m.hashBuffer[:0])
|
||||
return sum2[:16]
|
||||
|
|
|
|||
Loading…
Reference in a new issue