mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
p2p/discover/v5wire: use head.IV because it's shorter
This commit is contained in:
parent
64a054b06b
commit
73d67bd768
1 changed files with 1 additions and 2 deletions
|
|
@ -196,8 +196,7 @@ func (c *Codec) Encode(id enode.ID, addr string, packet Packet, challenge *Whoar
|
||||||
// Just apply the masking again here to get back the complete encoding.
|
// Just apply the masking again here to get back the complete encoding.
|
||||||
c.buf.Reset()
|
c.buf.Reset()
|
||||||
c.buf.Write(w.ChallengeData)
|
c.buf.Write(w.ChallengeData)
|
||||||
var iv [16]byte
|
copy(head.IV[:], w.ChallengeData)
|
||||||
copy(iv[:], w.ChallengeData)
|
|
||||||
enc := applyMasking(id, head.IV, c.buf.Bytes())
|
enc := applyMasking(id, head.IV, c.buf.Bytes())
|
||||||
return enc, w.Nonce, nil
|
return enc, w.Nonce, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue