buf := new([NonceSize]byte)
binary.BigEndian.PutUint64(buf[:], i)
mac.Write(buf[:])
- sum = mac.Sum(nil)
- for index := 0; index < NonceSize; index++ {
- buf[index] = sum[index]
- }
+ mac.Sum(sum[0:])
+ copy(buf[:], sum)
nonces <- buf
mac.Reset()
i += 2
// Basic
Addr string
- Id *PeerId
+ ID *PeerID
Conn io.Writer `json:"-"`
// Traffic behaviour
Encless bool
MTU int
- key *[SSize]byte `json:"-"`
+ key *[SSize]byte
// Timers
Timeout time.Duration `json:"-"`
}
func (p *Peer) String() string {
- return p.Id.String() + ":" + p.Addr
+ return p.ID.String() + ":" + p.Addr
}
// Zero peer's memory state.
peer := Peer{
Addr: addr,
- Id: conf.Id,
+ ID: conf.ID,
Conn: conn,
NoiseEnable: noiseEnable,