Safe Haskell | None |
---|---|
Language | Haskell2010 |
Libsodium initialisation.
Synopsis
- sodiumInit :: IO ()
- data SodiumInitException = SodiumInitFailed
Documentation
sodiumInit :: IO () Source #
Initialise libsodium.
This is just sodium_init()
from libsodium. Calling it before using
any Sodium functions is optional, but strongly recommended.
This function does the following:
- Open
/dev/urandom
(on Unix) to make it accessible even afterchroot()
. - Make all libsodium functions thread-safe.
- Benchmark different implementations of cryptographic primitives provided and choose the best ones.
This function itself is thread-safe (since libsodium-1.0.11).
data SodiumInitException Source #
Exception thrown by sodiumInit
.
SodiumInitFailed | libsodium failed to initialise. |
Instances
Show SodiumInitException Source # | |
Defined in Crypto.Init showsPrec :: Int -> SodiumInitException -> ShowS # show :: SodiumInitException -> String # showList :: [SodiumInitException] -> ShowS # | |
Exception SodiumInitException Source # | |
Defined in Crypto.Init |