diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-12 20:10:44 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-12 20:13:03 +0100 |
commit | bffe99aeadae09abd02f2bd3184925af6b680535 (patch) | |
tree | 556d223ebcd32b957e62e15353087b93a824641c /internal | |
parent | 77285c99aa30eb802d0281175990e6809501ec18 (diff) | |
download | wireguard-go-bffe99aeadae09abd02f2bd3184925af6b680535.tar.gz wireguard-go-bffe99aeadae09abd02f2bd3184925af6b680535.zip |
Don't use modules
Feel free to revert this if you have a strong feeling about it. But so
far as I can see, it adds a lot of complexity for basically no upsides.
Diffstat (limited to '')
-rw-r--r-- | ratelimiter.go (renamed from internal/ratelimiter/ratelimiter.go) | 2 | ||||
-rw-r--r-- | ratelimiter_test.go (renamed from internal/ratelimiter/ratelimiter_test.go) | 2 | ||||
-rw-r--r-- | tai64n.go (renamed from internal/tai64n/tai64n.go) | 4 | ||||
-rw-r--r-- | tai64n_test.go (renamed from internal/tai64n/tai64n_test.go) | 6 | ||||
-rw-r--r-- | xchacha20.go (renamed from internal/xchacha20poly1305/xchacha20.go) | 6 | ||||
-rw-r--r-- | xchacha20_test.go (renamed from internal/xchacha20poly1305/xchacha20_test.go) | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/internal/ratelimiter/ratelimiter.go b/ratelimiter.go index 006900a..168a743 100644 --- a/internal/ratelimiter/ratelimiter.go +++ b/ratelimiter.go @@ -1,4 +1,4 @@ -package ratelimiter +package main /* Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ diff --git a/internal/ratelimiter/ratelimiter_test.go b/ratelimiter_test.go index 37339ee..9b0abfd 100644 --- a/internal/ratelimiter/ratelimiter_test.go +++ b/ratelimiter_test.go @@ -1,4 +1,4 @@ -package ratelimiter +package main import ( "net" diff --git a/internal/tai64n/tai64n.go b/tai64n.go index da5257c..8c5ebe0 100644 --- a/internal/tai64n/tai64n.go +++ b/tai64n.go @@ -1,4 +1,4 @@ -package tai64n +package main import ( "bytes" @@ -11,7 +11,7 @@ const base = uint64(4611686018427387914) type Timestamp [TimestampSize]byte -func Now() Timestamp { +func TimestampNow() Timestamp { var tai64n Timestamp now := time.Now() secs := base + uint64(now.Unix()) diff --git a/internal/tai64n/tai64n_test.go b/tai64n_test.go index 389b65c..a9e22b0 100644 --- a/internal/tai64n/tai64n_test.go +++ b/tai64n_test.go @@ -1,4 +1,4 @@ -package tai64n +package main import ( "testing" @@ -9,10 +9,10 @@ import ( * as used by WireGuard. */ func TestMonotonic(t *testing.T) { - old := Now() + old := TimestampNow() for i := 0; i < 10000; i++ { time.Sleep(time.Nanosecond) - next := Now() + next := TimestampNow() if !next.After(old) { t.Error("TAI64N, not monotonically increasing on nano-second scale") } diff --git a/internal/xchacha20poly1305/xchacha20.go b/xchacha20.go index a6e59f0..8e7d99f 100644 --- a/internal/xchacha20poly1305/xchacha20.go +++ b/xchacha20.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a license that can be // found in the LICENSE file. -package xchacha20poly1305 +package main import ( "encoding/binary" @@ -138,7 +138,7 @@ func hChaCha20(out *[32]byte, nonce []byte, key *[32]byte) { binary.LittleEndian.PutUint32(out[28:], v15) } -func Encrypt( +func XChaCha20Poly1305Encrypt( dst []byte, nonceFull *[24]byte, plaintext []byte, @@ -153,7 +153,7 @@ func Encrypt( return aead.Seal(dst, nonce[:], plaintext, additionalData) } -func Decrypt( +func XChaCha20Poly1305Decrypt( dst []byte, nonceFull *[24]byte, plaintext []byte, diff --git a/internal/xchacha20poly1305/xchacha20_test.go b/xchacha20_test.go index 5d5b78f..0f41cf8 100644 --- a/internal/xchacha20poly1305/xchacha20_test.go +++ b/xchacha20_test.go @@ -1,4 +1,4 @@ -package xchacha20poly1305 +package main import ( "encoding/hex" @@ -60,7 +60,7 @@ func TestXChaCha20(t *testing.T) { // test encryption - ct := Encrypt( + ct := XChaCha20Poly1305Encrypt( nil, &nonceArray, pt, @@ -74,7 +74,7 @@ func TestXChaCha20(t *testing.T) { // test decryption - ptp, err := Decrypt( + ptp, err := XChaCha20Poly1305Decrypt( nil, &nonceArray, ct, |