{-# LINE 1 "Z/Botan/Errno.hsc" #-}
{-|
Module      : Z.Botan.Errno
Description : Errno provided by botan
Copyright   : (c) Dong Han, 2020 - 2021
License     : BSD
Maintainer  : winterland1989@gmail.com
Stability   : experimental
Portability : non-portable

INTERNAL MODULE, provides all botan errno.

-}

module Z.Botan.Errno where

import Foreign.C.Types



-- | Generally returned to indicate success
pattern BOTAN_FFI_SUCCESS                         :: CInt
-- | Note this value is positive, but still represents an error condition. In indicates that the function completed successfully, but the value provided was not correct. For example botan_bcrypt_is_valid returns this value if the password did not match the hash.
pattern BOTAN_FFI_INVALID_VERIFIER                :: CInt
-- | The input was invalid. (Currently this error return is not used.)
pattern BOTAN_FFI_ERROR_INVALID_INPUT             :: CInt
-- | While decrypting in an AEAD mode, the tag failed to verify.
pattern BOTAN_FFI_ERROR_BAD_MAC                   :: CInt
-- | Functions which write a variable amount of space return this if the indicated buffer length was insufficient to write the data. In that case, the output length parameter is set to the size that is required.
pattern BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE :: CInt
-- | An exception was thrown while processing this request, but no further details are available.
pattern BOTAN_FFI_ERROR_EXCEPTION_THROWN          :: CInt
-- | Memory allocation failed
pattern BOTAN_FFI_ERROR_OUT_OF_MEMORY             :: CInt
-- | A value provided in a flag variable was unknown.
pattern BOTAN_FFI_ERROR_BAD_FLAG                  :: CInt
-- | A null pointer was provided as an argument where that is not allowed.
pattern BOTAN_FFI_ERROR_NULL_POINTER              :: CInt
-- | An argument did not match the function.
pattern BOTAN_FFI_ERROR_BAD_PARAMETER             :: CInt
-- | An object that requires a key normally must be keyed before use (eg before encrypting or MACing data). If this is not done, the operation will fail and return this error code.
pattern BOTAN_FFI_ERROR_KEY_NOT_SET               :: CInt
-- | An invalid key length was provided with a call to x_set_key.
pattern BOTAN_FFI_ERROR_INVALID_KEY_LENGTH        :: CInt
-- | This is returned if the functionality is not available for some reason. For example if you call botan_hash_init with a named hash function which is not enabled, this error is returned.
pattern BOTAN_FFI_ERROR_NOT_IMPLEMENTED           :: CInt
-- | This is used if an object provided did not match the function. For example calling botan_hash_destroy on a botan_rng_t object will cause this return.
pattern BOTAN_FFI_ERROR_INVALID_OBJECT            :: CInt
-- | Something bad happened, but we are not sure why or how.
pattern BOTAN_FFI_ERROR_UNKNOWN_ERROR             :: CInt
pattern BOTAN_FFI_SUCCESS                         = (0)
{-# LINE 51 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_INVALID_VERIFIER                = (1)
{-# LINE 52 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_INVALID_INPUT             = (-1)
{-# LINE 53 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_BAD_MAC                   = (-2)
{-# LINE 54 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE = (-10)
{-# LINE 55 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_EXCEPTION_THROWN          = (-20)
{-# LINE 56 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_OUT_OF_MEMORY             = (-21)
{-# LINE 57 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_BAD_FLAG                  = (-30)
{-# LINE 58 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_NULL_POINTER              = (-31)
{-# LINE 59 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_BAD_PARAMETER             = (-32)
{-# LINE 60 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_KEY_NOT_SET               = (-33)
{-# LINE 61 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_INVALID_KEY_LENGTH        = (-34)
{-# LINE 62 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_NOT_IMPLEMENTED           = (-40)
{-# LINE 63 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_INVALID_OBJECT            = (-50)
{-# LINE 64 "Z/Botan/Errno.hsc" #-}
pattern BOTAN_FFI_ERROR_UNKNOWN_ERROR             = (-100)
{-# LINE 65 "Z/Botan/Errno.hsc" #-}