cryptostore-0.3.1.0: Serialization of cryptographic data types

License | BSD-style
Maintainer | Olivier Chéron <olivier.cheron@gmail.com>
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell2010

Crypto.Store.KeyWrap.RC2

Description

RC2 Key Wrap (RFC 3217)

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

Synopsis

- wrap :: (MonadRandom m, BlockCipher cipher, ByteArray ba) => cipher -> IV cipher -> ba -> m (Either StoreError ba)
- wrap' :: (ByteArray ba, BlockCipher cipher) => (StoreError -> result) -> ((ba -> ba) -> Int -> result) -> cipher -> IV cipher -> ba -> result
- unwrap :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> Either StoreError ba

# 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.