Skip to content

Commit

Permalink
Replace ctrutil with cipherio for AES-CBC
Browse files Browse the repository at this point in the history
  • Loading branch information
connesc committed May 26, 2020
1 parent 5a5ecda commit 646d2d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 102 deletions.
4 changes: 3 additions & 1 deletion cia.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"io"
"io/ioutil"

"github.com/connesc/cipherio"

"github.com/connesc/ctrsigcheck/ctrutil"
)

Expand Down Expand Up @@ -217,7 +219,7 @@ func CheckCIA(input io.Reader) (*CIA, error) {
}
contentIV := make([]byte, contentCipher.BlockSize())
binary.BigEndian.PutUint16(contentIV, uint16(content.Index))
data = ctrutil.NewCipherReader(data, cipher.NewCBCDecrypter(contentCipher, contentIV))
data = cipherio.NewBlockReader(data, cipher.NewCBCDecrypter(contentCipher, contentIV))
}

hash := sha256.New()
Expand Down
101 changes: 0 additions & 101 deletions ctrutil/cipher.go

This file was deleted.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/connesc/ctrsigcheck
go 1.14

require (
github.com/connesc/cipherio v0.1.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.3
)

0 comments on commit 646d2d5

Please sign in to comment.