module Crypto.Lol.Benchmarks.Standard where
import Crypto.Lol.Benchmarks
import Crypto.Lol.Benchmarks.TensorBenches
import Crypto.Lol.Benchmarks.UCycBenches
import Crypto.Lol.Benchmarks.CycBenches
import Crypto.Lol.Factored
import Crypto.Lol.Types
import Crypto.Lol.Utils.ShowType
import Crypto.Random.DRBG
import Data.Int
import Data.Proxy
type Zq (q :: k) = ZqBasic q Int64
instance Show (ArgType HashDRBG) where
show _ = "HashDRBG"
defaultBenches :: _ => Proxy t -> IO [Benchmark]
defaultBenches pt = sequence [
benchGroup "Single Index" $ (($ (Proxy::Proxy HashDRBG)) . ($ pt)) <$> [
oneIdxBenches (Proxy::Proxy '(F1024, Zq 12289)),
oneIdxBenches (Proxy::Proxy '(F2048, Zq 12289)),
oneIdxBenches (Proxy::Proxy '(F64*F27, Zq 3457)),
oneIdxBenches (Proxy::Proxy '(F64*F81, Zq 10369)),
oneIdxBenches (Proxy::Proxy '(F64*F9*F25, Zq 14401))],
benchGroup "Twace-Embed" $ ($ pt) <$> [
twoIdxBenches (Proxy::Proxy '(F8*F7*F13, F32*F7*F13, Zq 8737)),
twoIdxBenches (Proxy::Proxy '(F8*F7*F13, F8*F5*F7*F13, Zq 14561)),
twoIdxBenches (Proxy::Proxy '(F128, F128*F7*F13, Zq 23297))]
]
oneIdxBenches :: forall t m r gen . _ => Proxy '(m,r) -> Proxy t -> Proxy gen -> IO Benchmark
oneIdxBenches _ _ pgen =
let ptmr = Proxy :: Proxy '(t,m,r)
in benchGroup (showType ptmr) $ (($ pgen) . ($ ptmr)) <$> [
--simpleTensorBenches1,
tensorBenches1,
--simpleUCycBenches1,
ucycBenches1,
cycBenches1
]
twoIdxBenches :: forall t m m' r . _ => Proxy '(m,m',r) -> Proxy t -> IO Benchmark
twoIdxBenches _ _ =
let ptmr = Proxy :: Proxy '(t,m,m',r)
in benchGroup (showType ptmr) $ ($ ptmr) <$> [
--simpleTensorBenches2,
tensorBenches2,
--simpleUCycBenches2,
ucycBenches2,
cycBenches2
]