mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +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)
|
m.cipher.Encrypt(m.aesBuffer[:], sum1)
|
||||||
for i := range m.aesBuffer {
|
bitutil.XORBytes(m.aesBuffer[:], m.aesBuffer[:], seed)
|
||||||
m.aesBuffer[i] ^= seed[i]
|
|
||||||
}
|
|
||||||
m.hash.Write(m.aesBuffer[:])
|
m.hash.Write(m.aesBuffer[:])
|
||||||
sum2 := m.hash.Sum(m.hashBuffer[:0])
|
sum2 := m.hash.Sum(m.hashBuffer[:0])
|
||||||
return sum2[:16]
|
return sum2[:16]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue