lol-0.7.0.0: A library for lattice cryptography.

Copyright(c) Eric Crockett 2011-2017
Chris Peikert 2011-2017
LicenseGPL-3
Maintainerecrockett0@email.com
Stabilityexperimental
PortabilityPOSIX \( \def\C{\mathbb{C}} \)
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Benchmarks

Contents

Description

Benchmarks for individual layers of the Lol stack (Tensor, CycRep, Cyc), plus default parameters and helper functions for diplaying results.

Synopsis

Default parameters for benchmarks

defaultLolBenches :: (forall m r. (Fact m, NFData r) => NFData (t m r), _) => Proxy t -> Proxy h -> [Benchmark] Source #

Benchmark parameters reported in the paper. We suggest running these benchmarks to quickly compare performance on your system or with your Tensor backend.

oneIdxBenches :: forall t m r gen. _ => Proxy '(m, r) -> Proxy t -> Proxy gen -> Benchmark Source #

Collection of all single-index operations at all levels of the library.

twoIdxBenches :: forall t m m' r. _ => Proxy '(m, m', r) -> Proxy t -> Benchmark Source #

Collection of all inter-ring operations at all levels of the library.

Benchmarks for different layers of Lol

tensorBenches1 :: forall (t :: Factored -> * -> *) (m :: Factored) (r :: *) gen. (Fact m, _) => Proxy '(t, m, r) -> Proxy gen -> Benchmark Source #

Benchmarks for single-index Tensor operations. There must be a CRT basis for \(O_m\) over r. These cover the same functions as cycBenches1, but may have different performance due to how GHC interacts with Lol.

tensorBenches2 :: forall (t :: Factored -> * -> *) (m :: Factored) (m' :: Factored) (r :: *). _ => Proxy '(t, m, m', r) -> Benchmark Source #

Benchmarks for inter-ring Tensor operations. There must be a CRT basis for \(O_{m'}\) over r. These cover the same functions as cycBenches1, but may have different performance due to how GHC interacts with Lol.

cycRepBenches1 :: forall t m r gen. _ => Proxy '(t, m, r) -> Proxy gen -> Benchmark Source #

Benchmarks for single-index CycRep operations. There must be a CRT basis for \(O_m\) over r. These cover the same functions as cycBenches1, but may have different performance due to how GHC interacts with Lol.

cycRepBenches2 :: forall t m m' r. _ => Proxy '(t, m, m', r) -> Benchmark Source #

Benchmarks for inter-ring CycRep operations. There must be a CRT basis for \(O_{m'}\) over r. These cover the same functions as cycBenches2, but may have different performance due to how GHC interacts with Lol.

cycBenches1 :: forall t m r gen. _ => Proxy '(t, m, r) -> Proxy gen -> Benchmark Source #

Benchmarks for single-index Cyc operations. There must be a CRT basis for \(O_m\) over r.

cycBenches2 :: forall t m m' r. _ => Proxy '(t, m, m', r) -> Benchmark Source #

Benchmarks for inter-ring Cyc operations. There must be a CRT basis for \(O_{m'}\) over r.

Utilities for creating benchmarks

mkBench :: NFData b => String -> (a -> b) -> a -> Benchmark Source #

Make a Benchmark from a function and its input

mkBenchIO :: NFData b => String -> IO b -> Benchmark Source #

Make a Benchmark from an IO function and its input

bgroup #

Arguments

:: String

A name to identify the group of benchmarks.

-> [Benchmark]

Benchmarks to group under this name.

-> Benchmark 

Group several benchmarks together under a common name.

data Benchmark #

Specification of a collection of benchmarks and environments. A benchmark may consist of:

  • An environment that creates input data for benchmarks, created with env.
  • A single Benchmarkable item with a name, created with bench.
  • A (possibly nested) group of Benchmarks, created with bgroup.
Instances
Show Benchmark 
Instance details

Defined in Criterion.Measurement.Types

Utilities for showing benchmark results

data Verb Source #

Verbosity of benchmark output.

Constructors

Progress

prints a '.' when each benchmark completes

Abridged

prints a one-line summary for each benchmark

Full

prints full criterion output for each benchmark

Instances
Eq Verb Source # 
Instance details

Defined in Crypto.Lol.Utils.PrettyPrint

Methods

(==) :: Verb -> Verb -> Bool #

(/=) :: Verb -> Verb -> Bool #

prettyBenchesTable :: TableOpts -> Benchmark -> IO () Source #

Takes benchmark options an a benchmark group nested as params/level/op, and prints a table comparing operations across all selected levels of Lol.

defaultTableOpts :: Maybe String -> TableOpts Source #

Runs all benchmarks with verbosity Progress.

data TableOpts Source #

Options for the simple benchmark format.

Constructors

TOpts

Character width of row labels

Fields

prettyBenchesDiagnostic :: DiagnosticOpts -> Benchmark -> IO () Source #

Takes benchmark options an a benchmark group nested as params/level/op, and prints a table comparing operations across all selected levels of Lol.

defaultDiagnosticOpts :: DiagnosticOpts Source #

Runs all benchmarks with verbosity Progress.

data DiagnosticOpts Source #

Options for the diagnostic benchmark printout.

Constructors

DOpts

Character width of row labels

Fields

  • verb :: Verb

    Verbosity

  • levels :: [String]

    Which levels of Lol to benchmark. The empty list means run all levels.

  • benches :: [String]

    Which operations to benchmark. The empty list means run all benchmarks.

  • redThreshold :: Double

    How many times larger a benchmark must be (compared to the minimum benchmark for that parameter, across all levels), to be printed in red

  • colWidth :: Int

    Character width of data columns

  • testNameWidth :: Int