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

Method __init__

authlib/jose/rfc7518/jwe_encs.py:28–39  ·  view source on GitHub ↗
(self, key_size, hash_type)

Source from the content-addressed store, hash-verified

26 IV_SIZE = 128
27
28 def __init__(self, key_size, hash_type):
29 self.name = f"A{key_size}CBC-HS{hash_type}"
30 tpl = "AES_{}_CBC_HMAC_SHA_{} authenticated encryption algorithm"
31 self.description = tpl.format(key_size, hash_type)
32
33 # bit length
34 self.key_size = key_size
35 # byte length
36 self.key_len = key_size // 8
37
38 self.CEK_SIZE = key_size * 2
39 self.hash_alg = getattr(hashlib, f"sha{hash_type}")
40
41 def _hmac(self, ciphertext, aad, iv, key):
42 al = encode_int(len(aad) * 8, 64)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected