aboutsummaryrefslogtreecommitdiffstats
path: root/device/noise-types.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-01-28 00:49:31 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-28 15:22:34 +0100
commit34c047c762c31911333833c56a6dc50c52c84f5f (patch)
treedca8ea6dc6fb03d939f0f012f6a61f44b6688a1e /device/noise-types.go
parentdevice: the psk is not a chapoly key (diff)
downloadwireguard-go-34c047c762c31911333833c56a6dc50c52c84f5f.tar.xz
wireguard-go-34c047c762c31911333833c56a6dc50c52c84f5f.zip
device: avoid hex allocations in IpcGet
benchmark old ns/op new ns/op delta BenchmarkUAPIGet-16 2872 2157 -24.90% benchmark old allocs new allocs delta BenchmarkUAPIGet-16 30 18 -40.00% benchmark old bytes new bytes delta BenchmarkUAPIGet-16 737 256 -65.26% Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--device/noise-types.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/device/noise-types.go b/device/noise-types.go
index 90108d4..3688f7d 100644
--- a/device/noise-types.go
+++ b/device/noise-types.go
@@ -60,18 +60,10 @@ func (key *NoisePrivateKey) FromMaybeZeroHex(src string) (err error) {
return
}
-func (key NoisePrivateKey) ToHex() string {
- return hex.EncodeToString(key[:])
-}
-
func (key *NoisePublicKey) FromHex(src string) error {
return loadExactHex(key[:], src)
}
-func (key NoisePublicKey) ToHex() string {
- return hex.EncodeToString(key[:])
-}
-
func (key NoisePublicKey) IsZero() bool {
var zero NoisePublicKey
return key.Equals(zero)
@@ -84,7 +76,3 @@ func (key NoisePublicKey) Equals(tar NoisePublicKey) bool {
func (key *NoisePresharedKey) FromHex(src string) error {
return loadExactHex(key[:], src)
}
-
-func (key NoisePresharedKey) ToHex() string {
- return hex.EncodeToString(key[:])
-}