@@ -350,7 +350,9 @@ def decode(
350350 DecodeError: Failed to decode data.
351351 VerifyError: Failed to verify data.
352352 """
353- _ , _ , res = self .decode_with_headers (data , keys , context , external_aad , detached_payload , enable_non_aead , hpke_psk , hpke_info , hpke_aad , extra_info )
353+ _ , _ , res = self .decode_with_headers (
354+ data , keys , context , external_aad , detached_payload , enable_non_aead , hpke_psk , hpke_info , hpke_aad , extra_info
355+ )
354356 return res
355357
356358 def decode_with_headers (
@@ -365,7 +367,7 @@ def decode_with_headers(
365367 hpke_info : bytes = b"" ,
366368 hpke_aad : bytes = b"" ,
367369 extra_info : bytes = b"" ,
368- ) -> Tuple [Dict [int , Any ], Dict [int , Any ], bytes ]:
370+ ) -> Tuple [Dict [Union [ str , int ] , Any ], Dict [Union [ str , int ] , Any ], bytes ]:
369371 """
370372 Verifies and decodes COSE data, and returns protected headers, unprotected headers and payload.
371373
@@ -490,7 +492,9 @@ def decode_with_headers(
490492
491493 # Encrypt
492494 if data .tag == 96 :
493- rs = Recipients .from_list (data .value [3 ], self ._verify_kid , context , hpke_psk = hpke_psk , extra_info = extra_info , hpke_aad = hpke_aad )
495+ rs = Recipients .from_list (
496+ data .value [3 ], self ._verify_kid , context , hpke_psk = hpke_psk , extra_info = extra_info , hpke_aad = hpke_aad
497+ )
494498 nonce = u .get (5 , b"" )
495499 enc_key = rs .derive_key (keys , alg , external_aad , "Enc_Recipient" )
496500 aad = self ._dumps (["Encrypt" , data .value [0 ], external_aad ])
0 commit comments