diff options
Diffstat (limited to 'cryptography/primitives/interfaces.py')
| -rw-r--r-- | cryptography/primitives/interfaces.py | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/cryptography/primitives/interfaces.py b/cryptography/primitives/interfaces.py index c1fc9910..49c19d0e 100644 --- a/cryptography/primitives/interfaces.py +++ b/cryptography/primitives/interfaces.py @@ -18,9 +18,30 @@ import abc  import six +def register(iface): +    def register_decorator(klass): +        iface.register(klass) +        return klass +    return register_decorator + +  class ModeWithInitializationVector(six.with_metaclass(abc.ABCMeta)):      pass  class ModeWithNonce(six.with_metaclass(abc.ABCMeta)):      pass + + +class CipherContext(six.with_metaclass(abc.ABCMeta)): +    @abc.abstractmethod +    def update(self, data): +        """ +        update takes bytes and return bytes +        """ + +    @abc.abstractmethod +    def finalize(self): +        """ +        finalize return bytes +        """ | 
