1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
-- HOBlockCipher.hs: abstraction for the different BlockCipher classes, plus crazy CFB mode stuff
-- Copyright © 2016-2024 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 "crypton" 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 = cfbEncrypt
paddedCfbDecrypt ::
cipher -> B.ByteString -> B.ByteString -> Either String B.ByteString
paddedCfbDecrypt = cfbDecrypt
|