X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgovpn%2Fpeer.go;h=7bb978c8d0548b6e1e03f37f2a8d31d17e97f8e2;hp=792ebe7d7e1606adc0b1d8737db5ff1e7643ca9e;hb=8b30dc0a74d068b1a081e897dc0bb6d4d80281ab;hpb=18d0c712f6954564df50e5aa78862b1d6e128b3b diff --git a/src/cypherpunks.ru/govpn/peer.go b/src/cypherpunks.ru/govpn/peer.go index 792ebe7..7bb978c 100644 --- a/src/cypherpunks.ru/govpn/peer.go +++ b/src/cypherpunks.ru/govpn/peer.go @@ -63,10 +63,8 @@ func newNonces(key *[32]byte, i uint64) chan *[NonceSize]byte { 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