summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2015-03-30 23:18:33 -0400
committerJesse Luehrs <doy@tozt.net>2015-03-30 23:18:33 -0400
commit6aac313a011ad9727b0939f90a2253636f544886 (patch)
tree7506ef5722e20836264faec271c4a4d2663b169c /tests
parent59aaa954858f4ef5199dc65145b81b2d19238a75 (diff)
downloadmatasano-6aac313a011ad9727b0939f90a2253636f544886.tar.gz
matasano-6aac313a011ad9727b0939f90a2253636f544886.zip
not sure how to do this one
also it seems tedious
Diffstat (limited to 'tests')
-rw-r--r--tests/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs
index f15fefe..08fb2a9 100644
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -19,6 +19,14 @@ fn read_as_hex_lines (filename: &str) -> Vec<Vec<u8>> {
.collect();
}
+fn read_as_base64_lines (filename: &str) -> Vec<Vec<u8>> {
+ let fh = File::open(filename).unwrap();
+ return std::io::BufStream::new(fh)
+ .lines()
+ .map(|line| line.unwrap().from_base64().unwrap())
+ .collect();
+}
+
fn read_as_base64 (filename: &str) -> Vec<u8> {
let fh = File::open(filename).unwrap();
return std::io::BufStream::new(fh)
@@ -407,3 +415,13 @@ fn problem_18 () {
);
assert_eq!(got, plaintext);
}
+
+// #[test]
+// fn problem_19 () {
+// let key = random_aes_128_key();
+// let ciphertexts = read_as_base64_lines("data/19.txt")
+// .iter()
+// .map(|line| matasano::aes_128_ctr(&line[..], &key[..], 0))
+// .collect();
+// let plaintexts = matasano::crack_fixed_nonce_ctr_substitutions();
+// }