Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Wring
- mix3Parts :: Vector Word8 -> Int -> Vector Word8
- permut8 :: Seq a -> Word16 -> Seq a
- mul65537 :: Word16 -> Word16 -> Word16
- wringName :: Wring -> String
- xorn :: (Integral a, Bits a) => a -> Word8
- linearWring :: Wring
- keyedWring :: ByteString -> Wring
- encrypt :: Wring -> Vector Word8 -> Vector Word8
- decrypt :: Wring -> Vector Word8 -> Vector Word8
- encryptFixed :: Wring -> Vector Word8 -> Vector Word8
Documentation
mix3Parts :: Vector Word8 -> Int -> Vector Word8 Source #
Splits buf
into three equal parts, with 0-2 bytes left over,
and mixes the three parts. Exported for testing.
mul65537 :: Word16 -> Word16 -> Word16 Source #
Multiplies two nonzero numbers mod 65537. Exported for testing.
wringName :: Wring -> String Source #
Generates a name from the first four bytes of the S-box. Used to tag events in a profiling log.
xorn :: (Integral a, Bits a) => a -> Word8 Source #
Exclusive-ors all bytes in a nonnegative number. The only reason this
function is public is that it's used to generate a long ByteString
for a test.
linearWring :: Wring Source #
A Wring
with linear S-boxes. Used only for testing and cryptanalysis.
keyedWring :: ByteString -> Wring Source #
:: Wring | The |
-> Vector Word8 | The plaintext |
-> Vector Word8 | The returned ciphertext |
Encrypts a message.