mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
refactor: use a more straightforward return value
Signed-off-by: fuyangpengqi <995764973@qq.com>
This commit is contained in:
parent
68d477670c
commit
ae956727b7
1 changed files with 2 additions and 2 deletions
|
|
@ -110,7 +110,7 @@ func aesCTRXOR(key, inText, iv []byte) ([]byte, error) {
|
||||||
stream := cipher.NewCTR(aesBlock, iv)
|
stream := cipher.NewCTR(aesBlock, iv)
|
||||||
outText := make([]byte, len(inText))
|
outText := make([]byte, len(inText))
|
||||||
stream.XORKeyStream(outText, inText)
|
stream.XORKeyStream(outText, inText)
|
||||||
return outText, err
|
return outText, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func aesCBCDecrypt(key, cipherText, iv []byte) ([]byte, error) {
|
func aesCBCDecrypt(key, cipherText, iv []byte) ([]byte, error) {
|
||||||
|
|
@ -125,7 +125,7 @@ func aesCBCDecrypt(key, cipherText, iv []byte) ([]byte, error) {
|
||||||
if plaintext == nil {
|
if plaintext == nil {
|
||||||
return nil, ErrDecrypt
|
return nil, ErrDecrypt
|
||||||
}
|
}
|
||||||
return plaintext, err
|
return plaintext, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// From https://leanpub.com/gocrypto/read#leanpub-auto-block-cipher-modes
|
// From https://leanpub.com/gocrypto/read#leanpub-auto-block-cipher-modes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue