aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-07 18:08:57 -1000
committerAlex Gaynor <alex.gaynor@gmail.com>2017-06-08 00:08:57 -0400
commit7e53d911577881d87ce30291cef68e24f3c1b763 (patch)
tree3a8a0b43fdaae7d3d44549f7282048f5f3f1db58 /src/cryptography/utils.py
parentf12955cd242664cffbaa041ef815579a8d6b2d3a (diff)
downloadcryptography-7e53d911577881d87ce30291cef68e24f3c1b763.tar.gz
cryptography-7e53d911577881d87ce30291cef68e24f3c1b763.tar.bz2
cryptography-7e53d911577881d87ce30291cef68e24f3c1b763.zip
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
Diffstat (limited to 'src/cryptography/utils.py')
-rw-r--r--src/cryptography/utils.py5
1 files changed, 5 insertions, 0 deletions
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))