MCPcopy Create free account
hub / github.com/authlib/authlib / compute_fixed_info

Method compute_fixed_info

authlib/jose/drafts/_jwe_algorithms.py:50–71  ·  view source on GitHub ↗
(self, headers, bit_size, tag)

Source from the content-addressed store, hash-verified

48 return shared_key_e + shared_key_s
49
50 def compute_fixed_info(self, headers, bit_size, tag):
51 if tag is None:
52 cctag = b""
53 else:
54 cctag = u32be_len_input(tag)
55
56 # AlgorithmID
57 if self.key_size is None:
58 alg_id = u32be_len_input(headers["enc"])
59 else:
60 alg_id = u32be_len_input(headers["alg"])
61
62 # PartyUInfo
63 apu_info = u32be_len_input(headers.get("apu"), True)
64
65 # PartyVInfo
66 apv_info = u32be_len_input(headers.get("apv"), True)
67
68 # SuppPubInfo
69 pub_info = struct.pack(">I", bit_size) + cctag
70
71 return alg_id + apu_info + apv_info + pub_info
72
73 def compute_derived_key(self, shared_key, fixed_info, bit_size):
74 ckdf = ConcatKDFHash(

Callers 2

deliver_at_senderMethod · 0.95
deliver_at_recipientMethod · 0.95

Calls 2

u32be_len_inputFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected