Esempio n. 1
0
 def test_nonexistent_cipher(self, mode):
     b = Backend()
     b.register_cipher_adapter(
         DummyCipherAlgorithm, type(mode),
         lambda backend, cipher, mode: backend._ffi.NULL)
     cipher = Cipher(
         DummyCipherAlgorithm(),
         mode,
         backend=b,
     )
     with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
         cipher.encryptor()
Esempio n. 2
0
 def test_nonexistent_cipher(self, mode):
     b = Backend()
     b.register_cipher_adapter(
         DummyCipher,
         type(mode),
         lambda backend, cipher, mode: backend._ffi.NULL
     )
     cipher = Cipher(
         DummyCipher(), mode, backend=b,
     )
     with pytest.raises(UnsupportedCipher):
         cipher.encryptor()
Esempio n. 3
0
 def test_nonexistent_cipher(self, mode):
     b = Backend()
     b.register_cipher_adapter(
         DummyCipherAlgorithm,
         type(mode),
         lambda backend, cipher, mode: backend._ffi.NULL
     )
     cipher = Cipher(
         DummyCipherAlgorithm(), mode, backend=b,
     )
     with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
         cipher.encryptor()
Esempio n. 4
0
 def test_nonexistent_cipher(self, mode):
     b = Backend()
     b.register_cipher_adapter(
         DummyCipher,
         type(mode),
         lambda backend, cipher, mode: backend._ffi.NULL
     )
     cipher = Cipher(
         DummyCipher(), mode, backend=b,
     )
     with pytest.raises(UnsupportedAlgorithm):
         cipher.encryptor()