[#114] simplified some code by returning early and added cap for slices
This commit is contained in:
@@ -66,10 +66,5 @@ func Decrypt(cipherText string, key string) ([]byte, error) {
|
||||
}
|
||||
|
||||
nonce, cipherByteClean := cipherByte[:nonceSize], cipherByte[nonceSize:]
|
||||
plainData, err := gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return plainData, nil
|
||||
return gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user