    -- HOBlockCipher.hs: abstraction for the different BlockCipher classes, plus crazy CFB mode stuff
    -- Copyright © 2016  Clint Adams
    -- This software is released under the terms of the Expat license.
    -- (See the LICENSE file).
    {-# LANGUAGE PackageImports #-}

    module Codec.Encryption.OpenPGP.Internal.HOBlockCipher
      ( HOBlockCipher(..)
      ) where

    import qualified "cryptonite" Crypto.Cipher.Types as CCT

    import qualified Data.ByteString as B

    class HOBlockCipher cipher where
      cipherInit :: B.ByteString -> Either String cipher
      cipherName :: cipher -> String
      cipherKeySize :: cipher -> CCT.KeySizeSpecifier
      blockSize :: cipher -> Int
      cfbEncrypt ::
           cipher -> B.ByteString -> B.ByteString -> Either String B.ByteString
      cfbDecrypt ::
           cipher -> B.ByteString -> B.ByteString -> Either String B.ByteString
      paddedCfbEncrypt ::
           cipher -> B.ByteString -> B.ByteString -> Either String B.ByteString
      paddedCfbEncrypt = cipher -> ByteString -> ByteString -> Either String ByteString
    forall cipher.
    HOBlockCipher cipher =>
    cipher -> ByteString -> ByteString -> Either String ByteString
    cfbEncrypt
      paddedCfbDecrypt ::
           cipher -> B.ByteString -> B.ByteString -> Either String B.ByteString
      paddedCfbDecrypt = cipher -> ByteString -> ByteString -> Either String ByteString
    forall cipher.
    HOBlockCipher cipher =>
    cipher -> ByteString -> ByteString -> Either String ByteString
    cfbDecrypt