From e322c768df439cf34049dd62c4c0b6d3e2c1112b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 18 Jul 2017 23:50:23 +0200 Subject: Unexport --- key/enc.go | 4 ++-- key/key.go | 4 ++-- key/pub.go | 4 ++-- key/sig.go | 4 ++-- sign.go | 2 +- 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 } -- cgit v1.2.3