MCPcopy
hub / github.com/authlib/authlib / compute_fixed_info

Method compute_fixed_info

authlib/jose/rfc7518/jwe_algs.py:223–239  ·  view source on GitHub ↗
(self, headers, bit_size)

Source from the content-addressed store, hash-verified

221 return preset
222
223 def compute_fixed_info(self, headers, bit_size):
224 # AlgorithmID
225 if self.key_size is None:
226 alg_id = u32be_len_input(headers["enc"])
227 else:
228 alg_id = u32be_len_input(headers["alg"])
229
230 # PartyUInfo
231 apu_info = u32be_len_input(headers.get("apu"), True)
232
233 # PartyVInfo
234 apv_info = u32be_len_input(headers.get("apv"), True)
235
236 # SuppPubInfo
237 pub_info = struct.pack(">I", bit_size)
238
239 return alg_id + apu_info + apv_info + pub_info
240
241 def compute_derived_key(self, shared_key, fixed_info, bit_size):
242 ckdf = ConcatKDFHash(

Calls 2

u32be_len_inputFunction · 0.85
getMethod · 0.45