aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--key/enc.go4
-rw-r--r--key/key.go4
-rw-r--r--key/pub.go4
-rw-r--r--key/sig.go4
-rw-r--r--sign.go2
5 files changed, 9 insertions, 9 deletions
diff --git a/key/enc.go b/key/enc.go
index b9286c5..2283b07 100644
--- a/key/enc.go
+++ b/key/enc.go
@@ -38,11 +38,11 @@ func (v *Enc) Err() error {
}
func (v *Enc) MarshalBinary() ([]byte, error) {
- return Marshal(v)
+ return marshal(v)
}
func (v *Enc) UnmarshalBinary(data []byte) error {
- return Unmarshal(data, v)
+ return unmarshal(data, v)
}
func ParseEnc(data []byte, d KeyDeriver) (*Enc, error) {
diff --git a/key/key.go b/key/key.go
index e7463e8..32aa2e8 100644
--- a/key/key.go
+++ b/key/key.go
@@ -64,7 +64,7 @@ func NewKey(d KeyDeriver) (*Pub, *Enc, error) {
return pub, enc, nil
}
-func Unmarshal(data []byte, v interface{}) error {
+func unmarshal(data []byte, v interface{}) error {
buf := bytes.NewReader(data)
if err := binary.Read(buf, binary.BigEndian, v); err != nil {
return err
@@ -72,7 +72,7 @@ func Unmarshal(data []byte, v interface{}) error {
return nil
}
-func Marshal(v interface{}) ([]byte, error) {
+func marshal(v interface{}) ([]byte, error) {
buf := new(bytes.Buffer)
if err := binary.Write(buf, binary.BigEndian, v); err != nil {
return nil, err
diff --git a/key/pub.go b/key/pub.go
index c1eb388..2d955d7 100644
--- a/key/pub.go
+++ b/key/pub.go
@@ -26,11 +26,11 @@ func (v *Pub) Verify(message []byte, sig *Sig) error {
}
func (v *Pub) MarshalBinary() ([]byte, error) {
- return Marshal(v)
+ return marshal(v)
}
func (v *Pub) UnmarshalBinary(data []byte) error {
- return Unmarshal(data, v)
+ return unmarshal(data, v)
}
func ParsePub(data []byte) (*Pub, error) {
diff --git a/key/sig.go b/key/sig.go
index 6b35e1e..6921812 100644
--- a/key/sig.go
+++ b/key/sig.go
@@ -16,11 +16,11 @@ func (v *Sig) Err() error {
}
func (v *Sig) MarshalBinary() ([]byte, error) {
- return Marshal(v)
+ return marshal(v)
}
func (v *Sig) UnmarshalBinary(data []byte) error {
- return Unmarshal(data, v)
+ return unmarshal(data, v)
}
func ParseSig(data []byte) (*Sig, error) {
diff --git a/sign.go b/sign.go
index 1f4f3d7..56e7e03 100644
--- a/sign.go
+++ b/sign.go
@@ -43,7 +43,7 @@ func sign(args []string) error {
return err
}
sig := encKey.Sign(body)
- raw, err := key.Marshal(sig)
+ raw, err := sig.MarshalBinary()
if err != nil {
return err
}