-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Fast RC4 cipher implementation
--   
--   Fast RC4 cipher implementation
@package cipher-rc4
@version 0.1.4


-- | Simple implementation of the RC4 stream cipher.
--   <a>http://en.wikipedia.org/wiki/RC4</a>
--   
--   Initial FFI implementation by Peter White <a>peter@janrain.com</a>
--   
--   Reorganized and simplified to have an opaque context.
module Crypto.Cipher.RC4

-- | RC4 Stream cipher
data RC4

-- | The encryption context for RC4
newtype Ctx
Ctx :: ByteString -> Ctx

-- | RC4 context initialization.
--   
--   seed the context with an initial key. the key size need to be adequate
--   otherwise security takes a hit.
initCtx :: ByteString -> Ctx

-- | generate the next len bytes of the rc4 stream without combining it to
--   anything.
generate :: Ctx -> Int -> (Ctx, ByteString)

-- | RC4 xor combination of the rc4 stream with an input
combine :: Ctx -> ByteString -> (Ctx, ByteString)

-- | <i>Deprecated: use combine instead</i>
encrypt :: Ctx -> ByteString -> (Ctx, ByteString)

-- | <i>Deprecated: use combine instead</i>
decrypt :: Ctx -> ByteString -> (Ctx, ByteString)
instance Data.Byteable.Byteable Crypto.Cipher.RC4.RC4
instance Crypto.Cipher.Types.Base.Cipher Crypto.Cipher.RC4.RC4
instance Crypto.Cipher.Types.Stream.StreamCipher Crypto.Cipher.RC4.RC4
instance GHC.Show.Show Crypto.Cipher.RC4.Ctx
