From 5bc52732bdc004371d31771ff5fff4a421eceb97 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 28 Jun 2018 14:07:41 -0400 Subject: Add test functionally equivalent to the one Joachim is using. --- aes_keywrap.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit v1.2.3