aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/seccomp/hash_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/seccomp/hash_test.go')
-rw-r--r--container/seccomp/hash_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/container/seccomp/hash_test.go b/container/seccomp/hash_test.go
index 24f6b1c7..5c995582 100644
--- a/container/seccomp/hash_test.go
+++ b/container/seccomp/hash_test.go
@@ -1,6 +1,7 @@
package seccomp_test
import (
+ "crypto/sha512"
"encoding/hex"
"hakurei.app/container/bits"
@@ -12,18 +13,18 @@ type (
seccomp.ExportFlag
bits.FilterPreset
}
- bpfLookup map[bpfPreset][]byte
+ bpfLookup map[bpfPreset][sha512.Size]byte
)
-func toHash(s string) []byte {
- if len(s) != 128 {
+func toHash(s string) [sha512.Size]byte {
+ if len(s) != sha512.Size*2 {
panic("bad sha512 string length")
}
if v, err := hex.DecodeString(s); err != nil {
panic(err.Error())
- } else if len(v) != 64 {
+ } else if len(v) != sha512.Size {
panic("unreachable")
} else {
- return v
+ return ([sha512.Size]byte)(v)
}
}