Change increment and decrement operations according to Golang coding standards

This commit is contained in:
Ola Bini 2019-12-21 23:03:06 +00:00
parent 1ca218ec53
commit 99d5ad7857
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F
9 changed files with 25 additions and 25 deletions

View file

@ -145,7 +145,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error {
} else if ivbyte < cs.DecryptIV[0] {
cs.DecryptIV[0] = ivbyte
for i := 1; i < len(cs.DecryptIV); i++ {
cs.DecryptIV[i] += 1
cs.DecryptIV[i]++
if cs.DecryptIV[i] > 0 {
break
}
@ -175,7 +175,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error {
lost = -1
cs.DecryptIV[0] = ivbyte
for i := 1; i < len(cs.DecryptIV); i++ {
cs.DecryptIV[i] -= 1
cs.DecryptIV[i]--
if cs.DecryptIV[i] > 0 {
break
}
@ -190,7 +190,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error {
lost = int(256 - int(cs.DecryptIV[0]) + int(ivbyte) - 1)
cs.DecryptIV[0] = ivbyte
for i := 1; i < len(cs.DecryptIV); i++ {
cs.DecryptIV[i] += 1
cs.DecryptIV[i]++
if cs.DecryptIV[i] > 0 {
break
}
@ -216,7 +216,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error {
cs.DecryptIV = saveiv
}
cs.Good += 1
cs.Good++
if late > 0 {
cs.Late += uint32(late)
} else {
@ -237,7 +237,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error {
func (cs *CryptState) Encrypt(dst, src []byte) {
// First, increase our IV
for i := range cs.EncryptIV {
cs.EncryptIV[i] += 1
cs.EncryptIV[i]++
if cs.EncryptIV[i] > 0 {
break
}