From 7e53d911577881d87ce30291cef68e24f3c1b763 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 7 Jun 2017 18:08:57 -1000 Subject: ChaCha20Poly1305 support (#3680) * chacha20poly1305 support * add chacha20poly1305 backend and some fixes * refactor * forgot to remove this * pep8 * review feedback and a lot of type/value checking * review feedback * raise unsupportedalgorithm when creating a ChaCha20Poly1305 object if it's not supported. * switch to ciphertext||tag * typo * remove a branch we don't need * review feedback * decrypts is *also* a word * use reasons --- src/cryptography/utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cryptography/utils.py') diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py index cb7137cc..d28dc71d 100644 --- a/src/cryptography/utils.py +++ b/src/cryptography/utils.py @@ -18,6 +18,11 @@ PersistentlyDeprecated = DeprecationWarning DeprecatedIn19 = DeprecationWarning +def _check_bytes(name, value): + if not isinstance(value, bytes): + raise TypeError("{0} must be bytes".format(name)) + + def read_only_property(name): return property(lambda self: getattr(self, name)) -- cgit v1.2.3