2121
2222@pytest .mark .supported (
2323 only_if = lambda backend : backend .cipher_supported (
24- algorithms .TripleDES (b"\x00 " * 8 ), modes .CBC (b"\x00 " * 8 )
24+ algorithms .TripleDES (b"\x00 " * 24 ), modes .CBC (b"\x00 " * 8 )
2525 ),
2626 skip_message = "Does not support TripleDES CBC" ,
2727)
@@ -36,7 +36,9 @@ class TestTripleDESModeCBC:
3636 "TCBCvarkey.rsp" ,
3737 "TCBCvartext.rsp" ,
3838 ],
39- lambda keys , ** kwargs : algorithms .TripleDES (binascii .unhexlify (keys )),
39+ lambda keys , ** kwargs : algorithms .TripleDES (
40+ binascii .unhexlify (keys ) * 3
41+ ),
4042 lambda iv , ** kwargs : modes .CBC (binascii .unhexlify (iv )),
4143 )
4244
@@ -53,7 +55,7 @@ class TestTripleDESModeCBC:
5355
5456@pytest .mark .supported (
5557 only_if = lambda backend : backend .cipher_supported (
56- algorithms .TripleDES (b"\x00 " * 8 ), OFB (b"\x00 " * 8 )
58+ algorithms .TripleDES (b"\x00 " * 24 ), OFB (b"\x00 " * 8 )
5759 ),
5860 skip_message = "Does not support TripleDES OFB" ,
5961)
@@ -68,7 +70,9 @@ class TestTripleDESModeOFB:
6870 "TOFBvartext.rsp" ,
6971 "TOFBinvperm.rsp" ,
7072 ],
71- lambda keys , ** kwargs : algorithms .TripleDES (binascii .unhexlify (keys )),
73+ lambda keys , ** kwargs : algorithms .TripleDES (
74+ binascii .unhexlify (keys ) * 3
75+ ),
7276 lambda iv , ** kwargs : OFB (binascii .unhexlify (iv )),
7377 )
7478
@@ -85,7 +89,7 @@ class TestTripleDESModeOFB:
8589
8690@pytest .mark .supported (
8791 only_if = lambda backend : backend .cipher_supported (
88- algorithms .TripleDES (b"\x00 " * 8 ), CFB (b"\x00 " * 8 )
92+ algorithms .TripleDES (b"\x00 " * 24 ), CFB (b"\x00 " * 8 )
8993 ),
9094 skip_message = "Does not support TripleDES CFB" ,
9195)
@@ -100,7 +104,9 @@ class TestTripleDESModeCFB:
100104 "TCFB64varkey.rsp" ,
101105 "TCFB64vartext.rsp" ,
102106 ],
103- lambda keys , ** kwargs : algorithms .TripleDES (binascii .unhexlify (keys )),
107+ lambda keys , ** kwargs : algorithms .TripleDES (
108+ binascii .unhexlify (keys ) * 3
109+ ),
104110 lambda iv , ** kwargs : CFB (binascii .unhexlify (iv )),
105111 )
106112
@@ -117,7 +123,7 @@ class TestTripleDESModeCFB:
117123
118124@pytest .mark .supported (
119125 only_if = lambda backend : backend .cipher_supported (
120- algorithms .TripleDES (b"\x00 " * 8 ), CFB8 (b"\x00 " * 8 )
126+ algorithms .TripleDES (b"\x00 " * 24 ), CFB8 (b"\x00 " * 8 )
121127 ),
122128 skip_message = "Does not support TripleDES CFB8" ,
123129)
@@ -132,7 +138,9 @@ class TestTripleDESModeCFB8:
132138 "TCFB8varkey.rsp" ,
133139 "TCFB8vartext.rsp" ,
134140 ],
135- lambda keys , ** kwargs : algorithms .TripleDES (binascii .unhexlify (keys )),
141+ lambda keys , ** kwargs : algorithms .TripleDES (
142+ binascii .unhexlify (keys ) * 3
143+ ),
136144 lambda iv , ** kwargs : CFB8 (binascii .unhexlify (iv )),
137145 )
138146
@@ -149,7 +157,7 @@ class TestTripleDESModeCFB8:
149157
150158@pytest .mark .supported (
151159 only_if = lambda backend : backend .cipher_supported (
152- algorithms .TripleDES (b"\x00 " * 8 ), modes .ECB ()
160+ algorithms .TripleDES (b"\x00 " * 24 ), modes .ECB ()
153161 ),
154162 skip_message = "Does not support TripleDES ECB" ,
155163)
@@ -164,7 +172,9 @@ class TestTripleDESModeECB:
164172 "TECBvarkey.rsp" ,
165173 "TECBvartext.rsp" ,
166174 ],
167- lambda keys , ** kwargs : algorithms .TripleDES (binascii .unhexlify (keys )),
175+ lambda keys , ** kwargs : algorithms .TripleDES (
176+ binascii .unhexlify (keys ) * 3
177+ ),
168178 lambda ** kwargs : modes .ECB (),
169179 )
170180
0 commit comments