summaryrefslogtreecommitdiffhomepage
path: root/src/noise_helpers.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-04 16:15:53 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-04 16:15:53 +0200
commit8c34c4cbb3780c433148966a004f5a51aace0f64 (patch)
treea590de76c326f6dfe3c92d2e27b78ce2ab792289 /src/noise_helpers.go
parent22c83f4b8d98b6b3c7dabc078e70801d0201876c (diff)
First set of code review patches
Diffstat (limited to 'src/noise_helpers.go')
-rw-r--r--src/noise_helpers.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/noise_helpers.go b/src/noise_helpers.go
index 1e622a5..105f78f 100644
--- a/src/noise_helpers.go
+++ b/src/noise_helpers.go
@@ -47,6 +47,14 @@ func KDF3(key []byte, input []byte) (t0 [blake2s.Size]byte, t1 [blake2s.Size]byt
return
}
+func isZero(val []byte) bool {
+ var acc byte
+ for _, b := range val {
+ acc |= b
+ }
+ return acc == 0
+}
+
/* curve25519 wrappers */
func newPrivateKey() (sk NoisePrivateKey, err error) {