diff options
author | Donald Stufft <donald@stufft.io> | 2013-08-10 15:13:22 -0400 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2013-08-10 15:13:22 -0400 |
commit | adacdb85a6e102a0b9ee188ccfce93c22bde182e (patch) | |
tree | af2ec4e72ca88f1faf62a9760797d5c4078e2ade /tests/primitives | |
parent | 93e768b52c03fb33ff46124c17d4e1b2a13693fe (diff) | |
download | cryptography-adacdb85a6e102a0b9ee188ccfce93c22bde182e.tar.gz cryptography-adacdb85a6e102a0b9ee188ccfce93c22bde182e.tar.bz2 cryptography-adacdb85a6e102a0b9ee188ccfce93c22bde182e.zip |
BlockCiphers should know their own name
We normalize on CIPHER-KEYSIZE-MODE for the block cipher name.
Diffstat (limited to 'tests/primitives')
-rw-r--r-- | tests/primitives/test_block.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/primitives/test_block.py b/tests/primitives/test_block.py index 7dccda4b..aa670be3 100644 --- a/tests/primitives/test_block.py +++ b/tests/primitives/test_block.py @@ -19,6 +19,13 @@ from cryptography.primitives.block import BlockCipher, ciphers, modes, padding class TestBlockCipher(object): + def test_cipher_name(self): + cipher = BlockCipher( + ciphers.AES(binascii.unhexlify(b"0" * 32)), + modes.CBC(binascii.unhexlify(b"0" * 32), padding.NoPadding()) + ) + assert cipher.name == "AES-128-CBC" + def test_use_after_finalize(self): cipher = BlockCipher( ciphers.AES(binascii.unhexlify(b"0" * 32)), |