Merge pull request #226 from reaperhulk/blockcipher-rename

Reorganize Block Cipher
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index 69ffde1..0c3d22d 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -20,10 +20,12 @@
 
 from cryptography.exceptions import UnsupportedAlgorithm
 from cryptography.hazmat.primitives import interfaces
-from cryptography.hazmat.primitives.block.ciphers import (
+from cryptography.hazmat.primitives.ciphers.algorithms import (
     AES, Blowfish, Camellia, CAST5, TripleDES,
 )
-from cryptography.hazmat.primitives.block.modes import CBC, CTR, ECB, OFB, CFB
+from cryptography.hazmat.primitives.ciphers.modes import (
+    CBC, CTR, ECB, OFB, CFB
+)
 
 
 class Backend(object):
diff --git a/cryptography/hazmat/primitives/block/__init__.py b/cryptography/hazmat/primitives/ciphers/__init__.py
similarity index 87%
rename from cryptography/hazmat/primitives/block/__init__.py
rename to cryptography/hazmat/primitives/ciphers/__init__.py
index 5b8942b..e5a8ca5 100644
--- a/cryptography/hazmat/primitives/block/__init__.py
+++ b/cryptography/hazmat/primitives/ciphers/__init__.py
@@ -13,9 +13,9 @@
 
 from __future__ import absolute_import, division, print_function
 
-from cryptography.hazmat.primitives.block.base import BlockCipher
+from cryptography.hazmat.primitives.ciphers.base import Cipher
 
 
 __all__ = [
-    "BlockCipher",
+    "Cipher",
 ]
diff --git a/cryptography/hazmat/primitives/block/ciphers.py b/cryptography/hazmat/primitives/ciphers/algorithms.py
similarity index 100%
rename from cryptography/hazmat/primitives/block/ciphers.py
rename to cryptography/hazmat/primitives/ciphers/algorithms.py
diff --git a/cryptography/hazmat/primitives/block/base.py b/cryptography/hazmat/primitives/ciphers/base.py
similarity index 77%
rename from cryptography/hazmat/primitives/block/base.py
rename to cryptography/hazmat/primitives/ciphers/base.py
index ece3b32..1599308 100644
--- a/cryptography/hazmat/primitives/block/base.py
+++ b/cryptography/hazmat/primitives/ciphers/base.py
@@ -16,26 +16,28 @@
 from cryptography.hazmat.primitives import interfaces
 
 
-class BlockCipher(object):
-    def __init__(self, cipher, mode, backend=None):
-        super(BlockCipher, self).__init__()
+class Cipher(object):
+    def __init__(self, algorithm, mode, backend=None):
+        super(Cipher, self).__init__()
 
         if backend is None:
             from cryptography.hazmat.bindings import (
                 _default_backend as backend,
             )
 
-        self.cipher = cipher
+        self.algorithm = algorithm
         self.mode = mode
         self._backend = backend
 
     def encryptor(self):
         return _CipherContext(
-            self._backend.ciphers.create_encrypt_ctx(self.cipher, self.mode))
+            self._backend.ciphers.create_encrypt_ctx(self.algorithm,
+                                                     self.mode))
 
     def decryptor(self):
         return _CipherContext(
-            self._backend.ciphers.create_decrypt_ctx(self.cipher, self.mode))
+            self._backend.ciphers.create_decrypt_ctx(self.algorithm,
+                                                     self.mode))
 
 
 @interfaces.register(interfaces.CipherContext)
diff --git a/cryptography/hazmat/primitives/block/modes.py b/cryptography/hazmat/primitives/ciphers/modes.py
similarity index 100%
rename from cryptography/hazmat/primitives/block/modes.py
rename to cryptography/hazmat/primitives/ciphers/modes.py
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index c1c8d24..7d3b072 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -4,7 +4,7 @@
 Symmetric Encryption
 ====================
 
-.. currentmodule:: cryptography.hazmat.primitives.block
+.. currentmodule:: cryptography.hazmat.primitives.ciphers
 
 .. testsetup::
 
@@ -16,24 +16,23 @@
 Symmetric encryption is a way to encrypt (hide the plaintext value) material
 where the encrypter and decrypter both use the same key.
 
-.. class:: BlockCipher(cipher, mode)
+.. class:: Cipher(algorithm, mode)
 
-    Block ciphers work by encrypting content in chunks, often 64- or 128-bits.
-    They combine an underlying algorithm (such as AES), with a mode (such as
+    Cipher objects combine an algorithm (such as AES) with a mode (such as
     CBC, CTR, or GCM). A simple example of encrypting (and then decrypting)
     content with AES is:
 
     .. doctest::
 
-        >>> from cryptography.hazmat.primitives.block import BlockCipher, ciphers, modes
-        >>> cipher = BlockCipher(ciphers.AES(key), modes.CBC(iv))
+        >>> from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
+        >>> cipher = Cipher(algorithms.AES(key), modes.CBC(iv))
         >>> encryptor = cipher.encryptor()
         >>> ct = encryptor.update(b"a secret message") + encryptor.finalize()
         >>> decryptor = cipher.decryptor()
         >>> decryptor.update(ct) + decryptor.finalize()
         'a secret message'
 
-    :param cipher: One of the ciphers described below.
+    :param algorithms: One of the algorithms described below.
     :param mode: One of the modes described below.
 
     .. method:: encryptor()
@@ -61,7 +60,7 @@
 
 .. class:: CipherContext
 
-    When calling ``encryptor()`` or ``decryptor()`` on a ``BlockCipher`` object
+    When calling ``encryptor()`` or ``decryptor()`` on a ``Cipher`` object
     you will receive a return object conforming to the ``CipherContext``
     interface. You can then call ``update(data)`` with data until you have fed
     everything into the context. Once that is done call ``finalize()`` to
@@ -72,9 +71,9 @@
         :param bytes data: The data you wish to pass into the context.
         :return bytes: Returns the data that was encrypted or decrypted.
 
-        When the ``BlockCipher`` was constructed in a mode turns it into a
+        When the ``Cipher`` was constructed in a mode that turns it into a
         stream cipher (e.g.
-        :class:`cryptography.hazmat.primitives.block.modes.CTR`), this will
+        :class:`cryptography.hazmat.primitives.ciphers.modes.CTR`), this will
         return bytes immediately, however in other modes it will return chunks,
         whose size is determined by the cipher's block size.
 
@@ -82,10 +81,10 @@
 
         :return bytes: Returns the remainder of the data.
 
-Ciphers
-~~~~~~~
+Algorithms
+~~~~~~~~~~
 
-.. currentmodule:: cryptography.hazmat.primitives.block.ciphers
+.. currentmodule:: cryptography.hazmat.primitives.ciphers.algorithms
 
 .. class:: AES(key)
 
@@ -153,7 +152,7 @@
 Modes
 ~~~~~
 
-.. currentmodule:: cryptography.hazmat.primitives.block.modes
+.. currentmodule:: cryptography.hazmat.primitives.ciphers.modes
 
 .. class:: CBC(initialization_vector)
 
diff --git a/tests/hazmat/bindings/test_openssl.py b/tests/hazmat/bindings/test_openssl.py
index f283a7d..f1493e8 100644
--- a/tests/hazmat/bindings/test_openssl.py
+++ b/tests/hazmat/bindings/test_openssl.py
@@ -15,9 +15,9 @@
 
 from cryptography.exceptions import UnsupportedAlgorithm
 from cryptography.hazmat.bindings.openssl.backend import backend, Backend
-from cryptography.hazmat.primitives.block import BlockCipher
-from cryptography.hazmat.primitives.block.ciphers import AES
-from cryptography.hazmat.primitives.block.modes import CBC
+from cryptography.hazmat.primitives.ciphers import Cipher
+from cryptography.hazmat.primitives.ciphers.algorithms import AES
+from cryptography.hazmat.primitives.ciphers.modes import CBC
 
 
 class FakeMode(object):
@@ -62,7 +62,7 @@
             FakeMode,
             lambda backend, cipher, mode: backend.ffi.NULL
         )
-        cipher = BlockCipher(
+        cipher = Cipher(
             FakeCipher(), FakeMode(), backend=b,
         )
         with pytest.raises(UnsupportedAlgorithm):
diff --git a/tests/hazmat/primitives/test_3des.py b/tests/hazmat/primitives/test_3des.py
index 6b3e041..af6bdc0 100644
--- a/tests/hazmat/primitives/test_3des.py
+++ b/tests/hazmat/primitives/test_3des.py
@@ -20,7 +20,7 @@
 import binascii
 import os
 
-from cryptography.hazmat.primitives.block import ciphers, modes
+from cryptography.hazmat.primitives.ciphers import algorithms, modes
 
 from .utils import generate_encrypt_test
 from ...utils import load_nist_vectors_from_file
@@ -37,7 +37,7 @@
             "TCBCvarkey.rsp",
             "TCBCvartext.rsp",
         ],
-        lambda keys, iv: ciphers.TripleDES(binascii.unhexlify(keys)),
+        lambda keys, iv: algorithms.TripleDES(binascii.unhexlify(keys)),
         lambda keys, iv: modes.CBC(binascii.unhexlify(iv)),
     )
 
@@ -50,7 +50,7 @@
             "TCBCMMT3.rsp",
         ],
         lambda key1, key2, key3, iv: (
-            ciphers.TripleDES(binascii.unhexlify(key1 + key2 + key3))
+            algorithms.TripleDES(binascii.unhexlify(key1 + key2 + key3))
         ),
         lambda key1, key2, key3, iv: modes.CBC(binascii.unhexlify(iv)),
     )
@@ -67,7 +67,7 @@
             "TOFBvartext.rsp",
             "TOFBinvperm.rsp",
         ],
-        lambda keys, iv: ciphers.TripleDES(binascii.unhexlify(keys)),
+        lambda keys, iv: algorithms.TripleDES(binascii.unhexlify(keys)),
         lambda keys, iv: modes.OFB(binascii.unhexlify(iv)),
     )
 
@@ -80,7 +80,7 @@
             "TOFBMMT3.rsp",
         ],
         lambda key1, key2, key3, iv: (
-            ciphers.TripleDES(binascii.unhexlify(key1 + key2 + key3))
+            algorithms.TripleDES(binascii.unhexlify(key1 + key2 + key3))
         ),
         lambda key1, key2, key3, iv: modes.OFB(binascii.unhexlify(iv)),
     )
@@ -97,7 +97,7 @@
             "TCFB64varkey.rsp",
             "TCFB64vartext.rsp",
         ],
-        lambda keys, iv: ciphers.TripleDES(binascii.unhexlify(keys)),
+        lambda keys, iv: algorithms.TripleDES(binascii.unhexlify(keys)),
         lambda keys, iv: modes.CFB(binascii.unhexlify(iv)),
     )
 
@@ -110,7 +110,7 @@
             "TCFB64MMT3.rsp",
         ],
         lambda key1, key2, key3, iv: (
-            ciphers.TripleDES(binascii.unhexlify(key1 + key2 + key3))
+            algorithms.TripleDES(binascii.unhexlify(key1 + key2 + key3))
         ),
         lambda key1, key2, key3, iv: modes.CFB(binascii.unhexlify(iv)),
     )
diff --git a/tests/hazmat/primitives/test_aes.py b/tests/hazmat/primitives/test_aes.py
index 192da64..66471fa 100644
--- a/tests/hazmat/primitives/test_aes.py
+++ b/tests/hazmat/primitives/test_aes.py
@@ -16,7 +16,7 @@
 import binascii
 import os
 
-from cryptography.hazmat.primitives.block import ciphers, modes
+from cryptography.hazmat.primitives.ciphers import algorithms, modes
 
 from .utils import generate_encrypt_test
 from ...utils import (
@@ -45,7 +45,7 @@
             "CBCMMT192.rsp",
             "CBCMMT256.rsp",
         ],
-        lambda key, iv: ciphers.AES(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.AES(binascii.unhexlify(key)),
         lambda key, iv: modes.CBC(binascii.unhexlify(iv)),
     )
 
@@ -69,7 +69,7 @@
             "ECBMMT192.rsp",
             "ECBMMT256.rsp",
         ],
-        lambda key: ciphers.AES(binascii.unhexlify(key)),
+        lambda key: algorithms.AES(binascii.unhexlify(key)),
         lambda key: modes.ECB(),
     )
 
@@ -93,7 +93,7 @@
             "OFBMMT192.rsp",
             "OFBMMT256.rsp",
         ],
-        lambda key, iv: ciphers.AES(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.AES(binascii.unhexlify(key)),
         lambda key, iv: modes.OFB(binascii.unhexlify(iv)),
     )
 
@@ -117,7 +117,7 @@
             "CFB128MMT192.rsp",
             "CFB128MMT256.rsp",
         ],
-        lambda key, iv: ciphers.AES(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.AES(binascii.unhexlify(key)),
         lambda key, iv: modes.CFB(binascii.unhexlify(iv)),
     )
 
@@ -125,10 +125,10 @@
         load_openssl_vectors_from_file,
         os.path.join("ciphers", "AES", "CTR"),
         ["aes-128-ctr.txt", "aes-192-ctr.txt", "aes-256-ctr.txt"],
-        lambda key, iv: ciphers.AES(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.AES(binascii.unhexlify(key)),
         lambda key, iv: modes.CTR(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.AES("\x00" * 16), modes.CTR("\x00" * 16)
+            algorithms.AES("\x00" * 16), modes.CTR("\x00" * 16)
         ),
         skip_message="Does not support AES CTR",
     )
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index dd9c54c..28f3447 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -19,35 +19,37 @@
 
 from cryptography.exceptions import UnsupportedAlgorithm
 from cryptography.hazmat.primitives import interfaces
-from cryptography.hazmat.primitives.block import BlockCipher, ciphers, modes
+from cryptography.hazmat.primitives.ciphers import (
+    Cipher, algorithms, modes
+)
 
 
-class TestBlockCipher(object):
+class TestCipher(object):
     def test_instantiate_without_backend(self):
-        BlockCipher(
-            ciphers.AES(binascii.unhexlify(b"0" * 32)),
+        Cipher(
+            algorithms.AES(binascii.unhexlify(b"0" * 32)),
             modes.CBC(binascii.unhexlify(b"0" * 32))
         )
 
     def test_creates_encryptor(self):
-        cipher = BlockCipher(
-            ciphers.AES(binascii.unhexlify(b"0" * 32)),
+        cipher = Cipher(
+            algorithms.AES(binascii.unhexlify(b"0" * 32)),
             modes.CBC(binascii.unhexlify(b"0" * 32))
         )
         assert isinstance(cipher.encryptor(), interfaces.CipherContext)
 
     def test_creates_decryptor(self):
-        cipher = BlockCipher(
-            ciphers.AES(binascii.unhexlify(b"0" * 32)),
+        cipher = Cipher(
+            algorithms.AES(binascii.unhexlify(b"0" * 32)),
             modes.CBC(binascii.unhexlify(b"0" * 32))
         )
         assert isinstance(cipher.decryptor(), interfaces.CipherContext)
 
 
-class TestBlockCipherContext(object):
+class TestCipherContext(object):
     def test_use_after_finalize(self, backend):
-        cipher = BlockCipher(
-            ciphers.AES(binascii.unhexlify(b"0" * 32)),
+        cipher = Cipher(
+            algorithms.AES(binascii.unhexlify(b"0" * 32)),
             modes.CBC(binascii.unhexlify(b"0" * 32)),
             backend
         )
@@ -67,8 +69,8 @@
             decryptor.finalize()
 
     def test_unaligned_block_encryption(self, backend):
-        cipher = BlockCipher(
-            ciphers.AES(binascii.unhexlify(b"0" * 32)),
+        cipher = Cipher(
+            algorithms.AES(binascii.unhexlify(b"0" * 32)),
             modes.ECB(),
             backend
         )
@@ -86,8 +88,8 @@
         assert pt == b"a" * 80
         decryptor.finalize()
 
-    def test_nonexistant_cipher(self, backend):
-        cipher = BlockCipher(
+    def test_nonexistent_cipher(self, backend):
+        cipher = Cipher(
             object(), object(), backend
         )
         with pytest.raises(UnsupportedAlgorithm):
diff --git a/tests/hazmat/primitives/test_blowfish.py b/tests/hazmat/primitives/test_blowfish.py
index cd5e03a..a7f1382 100644
--- a/tests/hazmat/primitives/test_blowfish.py
+++ b/tests/hazmat/primitives/test_blowfish.py
@@ -16,7 +16,7 @@
 import binascii
 import os
 
-from cryptography.hazmat.primitives.block import ciphers, modes
+from cryptography.hazmat.primitives.ciphers import algorithms, modes
 
 from .utils import generate_encrypt_test
 from ...utils import load_nist_vectors_from_file
@@ -27,10 +27,10 @@
         lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
         os.path.join("ciphers", "Blowfish"),
         ["bf-ecb.txt"],
-        lambda key: ciphers.Blowfish(binascii.unhexlify(key)),
+        lambda key: algorithms.Blowfish(binascii.unhexlify(key)),
         lambda key: modes.ECB(),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Blowfish("\x00" * 56), modes.ECB()
+            algorithms.Blowfish("\x00" * 56), modes.ECB()
         ),
         skip_message="Does not support Blowfish ECB",
     )
@@ -39,10 +39,10 @@
         lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
         os.path.join("ciphers", "Blowfish"),
         ["bf-cbc.txt"],
-        lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)),
         lambda key, iv: modes.CBC(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Blowfish("\x00" * 56), modes.CBC("\x00" * 8)
+            algorithms.Blowfish("\x00" * 56), modes.CBC("\x00" * 8)
         ),
         skip_message="Does not support Blowfish CBC",
     )
@@ -51,10 +51,10 @@
         lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
         os.path.join("ciphers", "Blowfish"),
         ["bf-ofb.txt"],
-        lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)),
         lambda key, iv: modes.OFB(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Blowfish("\x00" * 56), modes.OFB("\x00" * 8)
+            algorithms.Blowfish("\x00" * 56), modes.OFB("\x00" * 8)
         ),
         skip_message="Does not support Blowfish OFB",
     )
@@ -63,10 +63,10 @@
         lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
         os.path.join("ciphers", "Blowfish"),
         ["bf-cfb.txt"],
-        lambda key, iv: ciphers.Blowfish(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)),
         lambda key, iv: modes.CFB(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Blowfish("\x00" * 56), modes.CFB("\x00" * 8)
+            algorithms.Blowfish("\x00" * 56), modes.CFB("\x00" * 8)
         ),
         skip_message="Does not support Blowfish CFB",
     )
diff --git a/tests/hazmat/primitives/test_camellia.py b/tests/hazmat/primitives/test_camellia.py
index 605c18d..e1be5d1 100644
--- a/tests/hazmat/primitives/test_camellia.py
+++ b/tests/hazmat/primitives/test_camellia.py
@@ -16,7 +16,7 @@
 import binascii
 import os
 
-from cryptography.hazmat.primitives.block import ciphers, modes
+from cryptography.hazmat.primitives.ciphers import algorithms, modes
 
 from .utils import generate_encrypt_test
 from ...utils import (
@@ -33,10 +33,10 @@
             "camellia-192-ecb.txt",
             "camellia-256-ecb.txt"
         ],
-        lambda key: ciphers.Camellia(binascii.unhexlify((key))),
+        lambda key: algorithms.Camellia(binascii.unhexlify((key))),
         lambda key: modes.ECB(),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Camellia("\x00" * 16), modes.ECB()
+            algorithms.Camellia("\x00" * 16), modes.ECB()
         ),
         skip_message="Does not support Camellia ECB",
     )
@@ -45,10 +45,10 @@
         load_openssl_vectors_from_file,
         os.path.join("ciphers", "Camellia"),
         ["camellia-cbc.txt"],
-        lambda key, iv: ciphers.Camellia(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Camellia(binascii.unhexlify(key)),
         lambda key, iv: modes.CBC(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Camellia("\x00" * 16), modes.CBC("\x00" * 16)
+            algorithms.Camellia("\x00" * 16), modes.CBC("\x00" * 16)
         ),
         skip_message="Does not support Camellia CBC",
     )
@@ -57,10 +57,10 @@
         load_openssl_vectors_from_file,
         os.path.join("ciphers", "Camellia"),
         ["camellia-ofb.txt"],
-        lambda key, iv: ciphers.Camellia(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Camellia(binascii.unhexlify(key)),
         lambda key, iv: modes.OFB(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Camellia("\x00" * 16), modes.OFB("\x00" * 16)
+            algorithms.Camellia("\x00" * 16), modes.OFB("\x00" * 16)
         ),
         skip_message="Does not support Camellia OFB",
     )
@@ -69,10 +69,10 @@
         load_openssl_vectors_from_file,
         os.path.join("ciphers", "Camellia"),
         ["camellia-cfb.txt"],
-        lambda key, iv: ciphers.Camellia(binascii.unhexlify(key)),
+        lambda key, iv: algorithms.Camellia(binascii.unhexlify(key)),
         lambda key, iv: modes.CFB(binascii.unhexlify(iv)),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.Camellia("\x00" * 16), modes.CFB("\x00" * 16)
+            algorithms.Camellia("\x00" * 16), modes.CFB("\x00" * 16)
         ),
         skip_message="Does not support Camellia CFB",
     )
diff --git a/tests/hazmat/primitives/test_cast5.py b/tests/hazmat/primitives/test_cast5.py
index bd86115..b298843 100644
--- a/tests/hazmat/primitives/test_cast5.py
+++ b/tests/hazmat/primitives/test_cast5.py
@@ -16,7 +16,7 @@
 import binascii
 import os
 
-from cryptography.hazmat.primitives.block import ciphers, modes
+from cryptography.hazmat.primitives.ciphers import algorithms, modes
 
 from .utils import generate_encrypt_test
 from ...utils import load_nist_vectors_from_file
@@ -29,10 +29,10 @@
         [
             "cast5-ecb.txt",
         ],
-        lambda key: ciphers.CAST5(binascii.unhexlify((key))),
+        lambda key: algorithms.CAST5(binascii.unhexlify((key))),
         lambda key: modes.ECB(),
         only_if=lambda backend: backend.ciphers.supported(
-            ciphers.CAST5("\x00" * 16), modes.ECB()
+            algorithms.CAST5("\x00" * 16), modes.ECB()
         ),
         skip_message="Does not support CAST5 ECB",
     )
diff --git a/tests/hazmat/primitives/test_ciphers.py b/tests/hazmat/primitives/test_ciphers.py
index d3870a0..dfafab3 100644
--- a/tests/hazmat/primitives/test_ciphers.py
+++ b/tests/hazmat/primitives/test_ciphers.py
@@ -17,7 +17,7 @@
 
 import pytest
 
-from cryptography.hazmat.primitives.block.ciphers import (
+from cryptography.hazmat.primitives.ciphers.algorithms import (
     AES, Camellia, TripleDES, Blowfish, CAST5
 )
 
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index b4a8a3e..e6e97d1 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -6,7 +6,7 @@
 from cryptography.hazmat.bindings import _ALL_BACKENDS
 from cryptography.hazmat.primitives import hashes
 from cryptography.hazmat.primitives import hmac
-from cryptography.hazmat.primitives.block import BlockCipher
+from cryptography.hazmat.primitives.ciphers import Cipher
 
 
 def generate_encrypt_test(param_loader, path, file_names, cipher_factory,
@@ -34,7 +34,7 @@
         pytest.skip(skip_message)
     plaintext = params.pop("plaintext")
     ciphertext = params.pop("ciphertext")
-    cipher = BlockCipher(
+    cipher = Cipher(
         cipher_factory(**params),
         mode_factory(**params),
         backend