-
Notifications
You must be signed in to change notification settings - Fork 0
/
99_strings_test.go
44 lines (38 loc) · 939 Bytes
/
99_strings_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package matasano_test
import (
"fmt"
"testing"
)
var teststrings = []string{
"1. Convert hex to base64 and back",
"2. Fixed XOR",
"3. Single-character XOR Cipher",
"4. Detect single-character XOR",
"5. Repeating-key XOR Cipher",
"6. Break repeating-key XOR",
"7. AES in ECB Mode",
"8. Detecting ECB",
"9. Implement PKCS#7 padding",
"10. Implement CBC Mode",
"11. Oracle function to detect ECB",
"12. Byte-at-a time ECB decryption, Full control version",
"13. ECB cut-and-paste",
"14. Byte-at-a-time ECB decryption, Partial control version",
"15. PKCS#7 padding validation",
"16. CBC bit flipping",
}
var testpass = make([]bool, len(teststrings))
func logpass(t *testing.T, n int) {
if !t.Failed() {
testpass[n] = true
}
}
func _TestMain(t *testing.T) {
for n, v := range testpass {
if v {
fmt.Printf("PASS:\t%s\n", teststrings[n])
} else {
fmt.Printf(" :\t%s\n", teststrings[n])
}
}
}