{-# 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)
forall (f :: * -> *) a. Functor f => f a -> f ()
void forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> IO a
evaluate forall a b. (a -> b) -> a -> b
$ ForeignPtr SECP256k1Context
secpCtxPtr
#endif