aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2018-06-28 14:07:41 -0400
committerRob Austein <sra@hactrn.net>2018-06-28 14:07:41 -0400
commit5bc52732bdc004371d31771ff5fff4a421eceb97 (patch)
tree45ea196095a718a7560d3d5b7d086dcff7a23e1f
parent825493299896cd34e4f4188805c254667e68c077 (diff)
Add test functionally equivalent to the one Joachim is using.HEADmaster
-rwxr-xr-xaes_keywrap.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/aes_keywrap.py b/aes_keywrap.py
index a026518..382c310 100755
--- a/aes_keywrap.py
+++ b/aes_keywrap.py
@@ -210,4 +210,12 @@ if __name__ == "__main__":
def test_loopback_9(self):
self.loopback_test("Hello! My name is Inigo Montoya. You killed my AES key wrapper. Prepare to die.")
+ def test_joachim_loopback(self):
+ from os import urandom
+ I = "31:32:33"
+ K = AESKeyWrapWithPadding(urandom(256/8))
+ C = K.wrap_key(I)
+ O = K.unwrap_key(C)
+ self.assertEqual(I, O, "Input and output plaintext did not match: {!r} <> {!r}".format(I, O))
+
unittest.main(verbosity = 9)