cryptostore-0.3.1.0: Serialization of cryptographic data types
LicenseBSD-style
MaintainerOlivier Chéron <olivier.cheron@gmail.com>
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.Store.KeyWrap.RC2

Description

RC2 Key Wrap (RFC 3217)

Should be used with a cipher from module Crypto.Store.Cipher.RC2.

Synopsis

Documentation

wrap :: (MonadRandom m, BlockCipher cipher, ByteArray ba) => cipher -> IV cipher -> ba -> m (Either StoreError ba) Source #

Wrap an RC2 key with the specified RC2 cipher.

Input must be between 0 and 255 bytes. A fresh IV should be generated randomly for each invocation.

wrap' :: (ByteArray ba, BlockCipher cipher) => (StoreError -> result) -> ((ba -> ba) -> Int -> result) -> cipher -> IV cipher -> ba -> result Source #

Wrap an RC2 key with the specified RC2 cipher, using the given source of random padding data.

Input must be between 0 and 255 bytes. A fresh IV should be generated randomly for each invocation.

unwrap :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> Either StoreError ba Source #

Unwrap an encrypted RC2 key with the specified RC2 cipher.