raaz-0.1.1: The raaz cryptographic library.

Safe Haskell | None
Language | Haskell2010

Raaz.Cipher.ChaCha20

Synopsis

- data ChaCha20
- chacha20 :: ChaCha20
- data KEY
- data IV
- data Counter

# Documentation

data ChaCha20 Source #

Instances

Describable ChaCha20 Source # |
Methods name :: ChaCha20 -> String Source # description :: ChaCha20 -> String Source #
Primitive ChaCha20 Source # |
Associated Types type Implementation ChaCha20 :: * Source # Methods blockSize :: ChaCha20 -> BYTES Int Source #
StreamCipher ChaCha20 Source # |
Cipher ChaCha20 Source # |
type Key ChaCha20 Source # |
type Key ChaCha20 = (KEY, IV, Counter)
type Implementation ChaCha20 Source # |
type Implementation ChaCha20 = SomeCipherI ChaCha20

chacha20 :: ChaCha20 Source #

The chacha20 stream cipher.

data KEY Source #

The key type.

Instances

Show KEY Source # |
Methods showsPrec :: Int -> KEY -> ShowS # show :: KEY -> String # showList :: [KEY] -> ShowS #
IsString KEY Source # |
Methods fromString :: String -> KEY #
Storable KEY Source # |
Methods sizeOf :: KEY -> Int # alignment :: KEY -> Int # peekElemOff :: Ptr KEY -> Int -> IO KEY # pokeElemOff :: Ptr KEY -> Int -> KEY -> IO () # peekByteOff :: Ptr b -> Int -> IO KEY # pokeByteOff :: Ptr b -> Int -> KEY -> IO () # peek :: Ptr KEY -> IO KEY # poke :: Ptr KEY -> KEY -> IO () #
EndianStore KEY Source # |
Methods store :: Ptr KEY -> KEY -> IO () Source # load :: Ptr KEY -> IO KEY Source # adjustEndian :: Ptr KEY -> Int -> IO () Source #
Encodable KEY Source # |
Methods toByteString :: KEY -> ByteString Source # fromByteString :: ByteString -> Maybe KEY Source # unsafeFromByteString :: ByteString -> KEY Source #
Random KEY Source # |
Methods random :: Memory mem => RT mem KEY Source #

data IV Source #

The IV for the chacha20

Instances

Show IV Source # |
Methods showsPrec :: Int -> IV -> ShowS # show :: IV -> String # showList :: [IV] -> ShowS #
IsString IV Source # |
Methods fromString :: String -> IV #
Storable IV Source # |
Methods sizeOf :: IV -> Int # alignment :: IV -> Int # peekElemOff :: Ptr IV -> Int -> IO IV # pokeElemOff :: Ptr IV -> Int -> IV -> IO () # peekByteOff :: Ptr b -> Int -> IO IV # pokeByteOff :: Ptr b -> Int -> IV -> IO () # peek :: Ptr IV -> IO IV # poke :: Ptr IV -> IV -> IO () #
EndianStore IV Source # |
Methods store :: Ptr IV -> IV -> IO () Source # load :: Ptr IV -> IO IV Source # adjustEndian :: Ptr IV -> Int -> IO () Source #
Encodable IV Source # |
Methods toByteString :: IV -> ByteString Source # fromByteString :: ByteString -> Maybe IV Source # unsafeFromByteString :: ByteString -> IV Source #
Random IV Source # |
Methods random :: Memory mem => RT mem IV Source #

data Counter Source #

The counter type for chacha20

Instances

Eq Counter Source # |
Methods (==) :: Counter -> Counter -> Bool # (/=) :: Counter -> Counter -> Bool #
Num Counter Source # |
Methods (+) :: Counter -> Counter -> Counter # (-) :: Counter -> Counter -> Counter # (*) :: Counter -> Counter -> Counter # negate :: Counter -> Counter # abs :: Counter -> Counter # signum :: Counter -> Counter # fromInteger :: Integer -> Counter #
Ord Counter Source # |
Methods compare :: Counter -> Counter -> Ordering # (<) :: Counter -> Counter -> Bool # (<=) :: Counter -> Counter -> Bool # (>) :: Counter -> Counter -> Bool # (>=) :: Counter -> Counter -> Bool # max :: Counter -> Counter -> Counter # min :: Counter -> Counter -> Counter #
Show Counter Source # |
Methods showsPrec :: Int -> Counter -> ShowS # show :: Counter -> String # showList :: [Counter] -> ShowS #
Storable Counter Source # |
Methods sizeOf :: Counter -> Int # alignment :: Counter -> Int # peekElemOff :: Ptr Counter -> Int -> IO Counter # pokeElemOff :: Ptr Counter -> Int -> Counter -> IO () # peekByteOff :: Ptr b -> Int -> IO Counter # pokeByteOff :: Ptr b -> Int -> Counter -> IO () # peek :: Ptr Counter -> IO Counter # poke :: Ptr Counter -> Counter -> IO () #
EndianStore Counter Source # |
Methods store :: Ptr Counter -> Counter -> IO () Source # load :: Ptr Counter -> IO Counter Source # adjustEndian :: Ptr Counter -> Int -> IO () Source #