From f7dacb6eb820b553e1d565e177f77ab176f18897 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 12 Dec 2020 00:30:04 -0500 Subject: lib/blocks: rename CipherIsECB -> CipherUsesECB --- challenge/c08.go | 2 +- challenge/c11.go | 2 +- lib/blocks.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/challenge/c08.go b/challenge/c08.go index bd1a934..0d312e0 100644 --- a/challenge/c08.go +++ b/challenge/c08.go @@ -12,7 +12,7 @@ func C8() { for i := 0; i < len(c08); i++ { bs := lib.HexStrToBytes(c08[i]) - block := lib.CipherIsECB(bs) + block := lib.CipherUsesECB(bs) if block != nil { fmt.Printf("Cipher at line %d (%s)", i+1, c08[i]) fmt.Printf(" might be AES encrypted in ECB mode.\n") diff --git a/challenge/c11.go b/challenge/c11.go index 5836758..e91d60b 100644 --- a/challenge/c11.go +++ b/challenge/c11.go @@ -14,7 +14,7 @@ func C11() { for i := 0; i < 10; i++ { o := lib.OracleAESRandomEncrypt(p) - if lib.CipherIsECB(o) != nil { + if lib.CipherUsesECB(o) != nil { fmt.Printf("%d -> Enciphered with ECB: %v (%d)\n", i, o, len(o)) } else { fmt.Printf("%d -> Enciphered with CBC: %v (%d)\n", i, o, len(o)) diff --git a/lib/blocks.go b/lib/blocks.go index 4dbd365..a82feb2 100644 --- a/lib/blocks.go +++ b/lib/blocks.go @@ -61,7 +61,7 @@ func BlocksEqual(a, b []byte) bool { return true } -func CipherIsECB(bs []byte) []byte { +func CipherUsesECB(bs []byte) []byte { blocks := BreakIntoBlocks(bs, 16) for i := 0; i < len(blocks); i++ { -- cgit v1.2.3