tlslite.utils.aesgcm module

class tlslite.utils.aesgcm.AESGCM(key, implementation, rawAesEncrypt)[source]

Bases: object

AES-GCM implementation. Note: this implementation does not attempt to be side-channel resistant. It’s also rather slow.

__init__(key, implementation, rawAesEncrypt)[source]
open(nonce, ciphertext, data)[source]

Decrypts and authenticates ciphertext using nonce and data. If the tag is valid, the plaintext is returned. If the tag is invalid, returns None.

seal(nonce, plaintext, data)[source]

Encrypts and authenticates plaintext using nonce and data. Returns the ciphertext, consisting of the encrypted plaintext and tag concatenated.