summaryrefslogtreecommitdiffstats
path: root/lib/aes.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/aes.go')
-rw-r--r--lib/aes.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/aes.go b/lib/aes.go
index 6121f41..47c3291 100644
--- a/lib/aes.go
+++ b/lib/aes.go
@@ -3,6 +3,22 @@
package lib
+func AESDecryptCBC(cipher, key, iv []byte) []byte {
+ iter := len(cipher) / 16
+
+ lc := iv
+ output := make([]byte, 0)
+ for i := 0; i < iter; i++ {
+ s := (i * 16)
+ e := (i * 16) + 16
+ c := cipher[s:e]
+ output = append(output, FixedXORBytes(aesInvCipher(c, key), lc)...)
+
+ lc = c
+ }
+ return output
+}
+
func AESDecrypt(cipher, key []byte) []byte {
iter := len(cipher) / 16