{-# LANGUAGE CPP #-}
module Cardano.Crypto.Init (
cryptoInit
) where
import Cardano.Crypto.Libsodium.Init (sodiumInit)
#if defined(SECP256K1_ENABLED)
import Control.Monad (void)
import Cardano.Crypto.SECP256K1.C (secpCtxPtr)
import Control.Exception (evaluate)
#endif
cryptoInit :: IO ()
cryptoInit :: IO ()
cryptoInit = do
IO ()
sodiumInit
#if defined(SECP256K1_ENABLED)
IO (ForeignPtr SECP256k1Context) -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (IO (ForeignPtr SECP256k1Context) -> IO ())
-> (ForeignPtr SECP256k1Context
-> IO (ForeignPtr SECP256k1Context))
-> ForeignPtr SECP256k1Context
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ForeignPtr SECP256k1Context -> IO (ForeignPtr SECP256k1Context)
forall a. a -> IO a
evaluate (ForeignPtr SECP256k1Context -> IO ())
-> ForeignPtr SECP256k1Context -> IO ()
forall a b. (a -> b) -> a -> b
$ ForeignPtr SECP256k1Context
secpCtxPtr
#endif