MCPcopy Index your code
hub / github.com/authlib/authlib / decrypt

Method decrypt

authlib/jose/drafts/_jwe_enc_cryptodome.py:40–53  ·  view source on GitHub ↗

Content Decryption with AEAD_XCHACHA20_POLY1305. :param ciphertext: ciphertext in bytes :param aad: additional authenticated data in bytes :param iv: initialization vector in bytes :param tag: authentication tag in bytes :param key: encrypted key in bytes

(self, ciphertext, aad, iv, tag, key)

Source from the content-addressed store, hash-verified

38 return ciphertext, tag
39
40 def decrypt(self, ciphertext, aad, iv, tag, key):
41 """Content Decryption with AEAD_XCHACHA20_POLY1305.
42
43 :param ciphertext: ciphertext in bytes
44 :param aad: additional authenticated data in bytes
45 :param iv: initialization vector in bytes
46 :param tag: authentication tag in bytes
47 :param key: encrypted key in bytes
48 :return: message
49 """
50 self.check_iv(iv)
51 chacha = Cryptodome_ChaCha20_Poly1305.new(key=key, nonce=iv)
52 chacha.update(aad)
53 return chacha.decrypt_and_verify(ciphertext, tag)

Callers

nothing calls this directly

Calls 1

check_ivMethod · 0.80

Tested by

no test coverage detected