aboutsummaryrefslogtreecommitdiff
path: root/enc.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-10-23 18:47:36 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-10-23 18:47:36 +0200
commit5b1f187c7a3515a8335a134364929f6e0bbef1f5 (patch)
tree168c353969c87772468d70d7c35aca9b59ccf026 /enc.go
parentbb4dbe34df4907c123bae0f34eb3786d244b4480 (diff)
Simplify interface
Diffstat (limited to 'enc.go')
-rw-r--r--enc.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/enc.go b/enc.go
deleted file mode 100644
index 467e0f0..0000000
--- a/enc.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package main
-
-import (
- "bytes"
- "crypto/sha512"
-
- "golang.org/x/crypto/ed25519"
-)
-
-type EncKey struct {
- PKAlg [2]byte
- KDFAlg [2]byte
- KDFRounds uint32 // network byte order
- Salt [16]byte
- Checksum [8]byte
- KeyNum [KeyNumLen]byte
- SecKey [ed25519.PrivateKeySize]byte
-}
-
-func (v *EncKey) Valid() bool {
- sum := sha512.Sum512(v.SecKey[:])
- return bytes.Equal(sum[:len(v.Checksum)], v.Checksum[:])
-}
-
-func (v *EncKey) Unmarshal(b []byte) error { return DecodeBase64(v, b) }
-func (v *EncKey) Marshal() ([]byte, error) { return EncodeBase64(v) }