saltine-0.2.0.1: Cryptography that's easy to digest (NaCl/libsodium bindings).
Copyright(c) Max Amanshauser 2021
LicenseMIT
Maintainermax@lambdalifting.org
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Description

 
Synopsis

Documentation

aead_xchacha20poly1305_ietf_keybytes :: Int Source #

Size of a XChaCha20-Poly1305 key

aead_xchacha20poly1305_ietf_npubbytes :: Int Source #

Size of a XChaCha20-Poly1305 nonce

aead_xchacha20poly1305_ietf_abytes :: Int Source #

Size of a XChaCha20-Poly1305 authentication tag

c_aead Source #

Arguments

:: Ptr CChar

Cipher output buffer

-> Ptr CULLong

Cipher output bytes used

-> Ptr CChar

Constant message input buffer

-> CULLong

Length of message input buffer

-> Ptr CChar

Constant aad input buffer

-> CULLong

Length of aad input buffer

-> Ptr CChar

Unused nsec value (must be NULL)

-> Ptr CChar

Constant nonce buffer

-> Ptr CChar

Constant key buffer

-> IO CInt 

The aead C API uses C strings. Always returns 0.

c_aead_open Source #

Arguments

:: Ptr CChar

Message output buffer

-> Ptr CULLong

Message output bytes used

-> Ptr CChar

Unused nsec value (must be NULL)

-> Ptr CChar

Constant ciphertext input buffer

-> CULLong

Length of ciphertext input buffer

-> Ptr CChar

Constant aad input buffer

-> CULLong

Length of aad input buffer

-> Ptr CChar

Constant nonce buffer

-> Ptr CChar

Constant key buffer

-> IO CInt 

The aead open C API uses C strings. Returns 0 if successful.

c_aead_detached Source #

Arguments

:: Ptr CChar

Cipher output buffer

-> Ptr CChar

Tag output buffer

-> Ptr CULLong

Tag bytes used

-> Ptr CChar

Constant message input buffer

-> CULLong

Length of message input buffer

-> Ptr CChar

Constant aad input buffer

-> CULLong

Length of aad input buffer

-> Ptr CChar

Unused nsec value (must be NULL)

-> Ptr CChar

Constant nonce buffer

-> Ptr CChar

Constant key buffer

-> IO CInt 

The aead C API uses C strings. Always returns 0.

c_aead_open_detached Source #

Arguments

:: Ptr CChar

Message output buffer

-> Ptr CChar

Unused nsec value (must be NULL)

-> Ptr CChar

Constant ciphertext input buffer

-> CULLong

Length of ciphertext input buffer

-> Ptr CChar

Constant tag input buffer

-> Ptr CChar

Constant aad input buffer

-> CULLong

Length of aad input buffer

-> Ptr CChar

Constant nonce buffer

-> Ptr CChar

Constant key buffer

-> IO CInt 

The aead open C API uses C strings. Returns 0 if successful.

newtype Key Source #

An opaque XChaCha20Poly1305 cryptographic key.

Constructors

Key 

Fields

Instances

Instances details
Eq Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Data Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Key -> c Key #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Key #

toConstr :: Key -> Constr #

dataTypeOf :: Key -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Key) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key) #

gmapT :: (forall b. Data b => b -> b) -> Key -> Key #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r #

gmapQ :: (forall d. Data d => d -> u) -> Key -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Key -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Key -> m Key #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key #

Ord Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Show Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Generic Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Associated Types

type Rep Key :: Type -> Type #

Methods

from :: Key -> Rep Key x #

to :: Rep Key x -> Key #

NFData Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

rnf :: Key -> () #

Hashable Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

hashWithSalt :: Int -> Key -> Int #

hash :: Key -> Int #

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

type Rep Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

type Rep Key = D1 ('MetaData "Key" "Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305" "saltine-0.2.0.1-inplace" 'True) (C1 ('MetaCons "Key" 'PrefixI 'True) (S1 ('MetaSel ('Just "unKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

newtype Nonce Source #

An opaque XChaCha20Poly1305 nonce.

Constructors

Nonce 

Fields

Instances

Instances details
Eq Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

(==) :: Nonce -> Nonce -> Bool #

(/=) :: Nonce -> Nonce -> Bool #

Data Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Nonce -> c Nonce #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Nonce #

toConstr :: Nonce -> Constr #

dataTypeOf :: Nonce -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Nonce) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Nonce) #

gmapT :: (forall b. Data b => b -> b) -> Nonce -> Nonce #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Nonce -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Nonce -> r #

gmapQ :: (forall d. Data d => d -> u) -> Nonce -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Nonce -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce #

Ord Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

compare :: Nonce -> Nonce -> Ordering #

(<) :: Nonce -> Nonce -> Bool #

(<=) :: Nonce -> Nonce -> Bool #

(>) :: Nonce -> Nonce -> Bool #

(>=) :: Nonce -> Nonce -> Bool #

max :: Nonce -> Nonce -> Nonce #

min :: Nonce -> Nonce -> Nonce #

Show Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

showsPrec :: Int -> Nonce -> ShowS #

show :: Nonce -> String #

showList :: [Nonce] -> ShowS #

Generic Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Associated Types

type Rep Nonce :: Type -> Type #

Methods

from :: Nonce -> Rep Nonce x #

to :: Rep Nonce x -> Nonce #

NFData Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

rnf :: Nonce -> () #

Hashable Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

Methods

hashWithSalt :: Int -> Nonce -> Int #

hash :: Nonce -> Int #

IsNonce Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

type Rep Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

type Rep Nonce = D1 ('MetaData "Nonce" "Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305" "saltine-0.2.0.1-inplace" 'True) (C1 ('MetaCons "Nonce" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))