1# This file is dual licensed under the terms of the Apache License, Version 2# 2.0, and the BSD License. See the LICENSE file in the root of this repository 3# for complete details. 4 5from __future__ import absolute_import, division, print_function 6 7from cryptography import utils 8from cryptography.hazmat.primitives import hashes, serialization 9from cryptography.hazmat.primitives.asymmetric import padding 10from cryptography.hazmat.primitives.ciphers import CipherAlgorithm 11from cryptography.hazmat.primitives.ciphers.modes import Mode 12 13 14@utils.register_interface(CipherAlgorithm) 15class DummyCipherAlgorithm(object): 16 name = "dummy-cipher" 17 block_size = 128 18 key_size = None 19 20 21@utils.register_interface(Mode) 22class DummyMode(object): 23 name = "dummy-mode" 24 25 def validate_for_algorithm(self, algorithm): 26 pass 27 28 29@utils.register_interface(hashes.HashAlgorithm) 30class DummyHashAlgorithm(object): 31 name = "dummy-hash" 32 block_size = None 33 digest_size = None 34 35 36@utils.register_interface(serialization.KeySerializationEncryption) 37class DummyKeySerializationEncryption(object): 38 pass 39 40 41@utils.register_interface(padding.AsymmetricPadding) 42class DummyAsymmetricPadding(object): 43 name = "dummy-padding" 44