From 629bd7dd921d79ef99a9bf28a18c7ccda616676a Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 28 Aug 2016 09:28:53 +0100 Subject: [PATCH] No need for errors, as cipher block will always be valid --- util/cryp/cryp.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/util/cryp/cryp.go b/util/cryp/cryp.go index f162e48a..44b91c25 100644 --- a/util/cryp/cryp.go +++ b/util/cryp/cryp.go @@ -33,10 +33,7 @@ func Encrypt(key []byte, src []byte) (dst []byte, err error) { } // Initiate cipher - cipher, err := cipher.NewGCM(block) - if err != nil { - return - } + cipher, _ := cipher.NewGCM(block) nonce := rand.New(12) @@ -61,10 +58,7 @@ func Decrypt(key []byte, src []byte) (dst []byte, err error) { } // Initiate cipher - cipher, err := cipher.NewGCM(block) - if err != nil { - return - } + cipher, _ := cipher.NewGCM(block) return cipher.Open(nil, src[:12], src[12:], nil)