Package tlslite :: Package utils :: Module chacha20_poly1305 :: Class CHACHA20_POLY1305
[hide private]
[frames] | no frames]

type CHACHA20_POLY1305

source code


Pure python implementation of ChaCha20/Poly1305 AEAD cipher

Instance Methods [hide private]
 
__init__(self, key, implementation)
Set the initial state for the ChaCha20 AEAD
source code
 
open(self, nonce, ciphertext, data)
Decrypts and authenticates ciphertext using nonce and data.
source code
 
seal(self, nonce, plaintext, data)
Encrypts and authenticates plaintext using nonce and data.
source code
Static Methods [hide private]
 
pad16(data)
Return padding for the Associated Authenticated Data
source code
 
poly1305_key_gen(key, nonce)
Generate the key for the Poly1305 authenticator
source code
Method Details [hide private]

__init__(self, key, implementation)
(Constructor)

source code 

Set the initial state for the ChaCha20 AEAD

Overrides: object.__init__

open(self, nonce, ciphertext, data)

source code 

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(self, nonce, plaintext, data)

source code 

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