aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/ratelimiter/ratelimiter.go (renamed from ratelimiter.go)2
-rw-r--r--internal/ratelimiter/ratelimiter_test.go (renamed from ratelimiter_test.go)2
-rw-r--r--internal/tai64n/tai64n.go (renamed from tai64n.go)4
-rw-r--r--internal/tai64n/tai64n_test.go (renamed from tai64n_test.go)6
-rw-r--r--internal/xchacha20poly1305/xchacha20.go (renamed from xchacha20.go)6
-rw-r--r--internal/xchacha20poly1305/xchacha20_test.go (renamed from xchacha20_test.go)6
6 files changed, 13 insertions, 13 deletions
diff --git a/ratelimiter.go b/internal/ratelimiter/ratelimiter.go
index 168a743..006900a 100644
--- a/ratelimiter.go
+++ b/internal/ratelimiter/ratelimiter.go
@@ -1,4 +1,4 @@
-package main
+package ratelimiter
/* Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */
diff --git a/ratelimiter_test.go b/internal/ratelimiter/ratelimiter_test.go
index 9b0abfd..37339ee 100644
--- a/ratelimiter_test.go
+++ b/internal/ratelimiter/ratelimiter_test.go
@@ -1,4 +1,4 @@
-package main
+package ratelimiter
import (
"net"
diff --git a/tai64n.go b/internal/tai64n/tai64n.go
index 8c5ebe0..da5257c 100644
--- a/tai64n.go
+++ b/internal/tai64n/tai64n.go
@@ -1,4 +1,4 @@
-package main
+package tai64n
import (
"bytes"
@@ -11,7 +11,7 @@ const base = uint64(4611686018427387914)
type Timestamp [TimestampSize]byte
-func TimestampNow() Timestamp {
+func Now() Timestamp {
var tai64n Timestamp
now := time.Now()
secs := base + uint64(now.Unix())
diff --git a/tai64n_test.go b/internal/tai64n/tai64n_test.go
index a9e22b0..389b65c 100644
--- a/tai64n_test.go
+++ b/internal/tai64n/tai64n_test.go
@@ -1,4 +1,4 @@
-package main
+package tai64n
import (
"testing"
@@ -9,10 +9,10 @@ import (
* as used by WireGuard.
*/
func TestMonotonic(t *testing.T) {
- old := TimestampNow()
+ old := Now()
for i := 0; i < 10000; i++ {
time.Sleep(time.Nanosecond)
- next := TimestampNow()
+ next := Now()
if !next.After(old) {
t.Error("TAI64N, not monotonically increasing on nano-second scale")
}
diff --git a/xchacha20.go b/internal/xchacha20poly1305/xchacha20.go
index 8e7d99f..a6e59f0 100644
--- a/xchacha20.go
+++ b/internal/xchacha20poly1305/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 main
+package xchacha20poly1305
import (
"encoding/binary"
@@ -138,7 +138,7 @@ func hChaCha20(out *[32]byte, nonce []byte, key *[32]byte) {
binary.LittleEndian.PutUint32(out[28:], v15)
}
-func XChaCha20Poly1305Encrypt(
+func Encrypt(
dst []byte,
nonceFull *[24]byte,
plaintext []byte,
@@ -153,7 +153,7 @@ func XChaCha20Poly1305Encrypt(
return aead.Seal(dst, nonce[:], plaintext, additionalData)
}
-func XChaCha20Poly1305Decrypt(
+func Decrypt(
dst []byte,
nonceFull *[24]byte,
plaintext []byte,
diff --git a/xchacha20_test.go b/internal/xchacha20poly1305/xchacha20_test.go
index 0f41cf8..5d5b78f 100644
--- a/xchacha20_test.go
+++ b/internal/xchacha20poly1305/xchacha20_test.go
@@ -1,4 +1,4 @@
-package main
+package xchacha20poly1305
import (
"encoding/hex"
@@ -60,7 +60,7 @@ func TestXChaCha20(t *testing.T) {
// test encryption
- ct := XChaCha20Poly1305Encrypt(
+ ct := Encrypt(
nil,
&nonceArray,
pt,
@@ -74,7 +74,7 @@ func TestXChaCha20(t *testing.T) {
// test decryption
- ptp, err := XChaCha20Poly1305Decrypt(
+ ptp, err := Decrypt(
nil,
&nonceArray,
ct,