lol-apps-0.2.0.0: Lattice-based cryptographic applications using Lol.

Copyright(c) Eric Crockett 2011-2017
Chris Peikert 2011-2017
LicenseGPL-2
Maintainerecrockett0@email.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Applications.KeyHomomorphicPRF

Description

Key-homomorphic PRF from [BP14].

Synopsis

Documentation

data FullBinTree Source #

Full binary tree.

Constructors

L 
I Int FullBinTree FullBinTree 

Instances

evalTree :: Int -> PRFState rq rp -> (Matrix rq, PRFState rq rp) Source #

Evaluates the tree at the new input, reusing as much prior work as possible.

randomTree :: MonadRandom rnd => Int -> rnd FullBinTree Source #

Given the desired number of leaves, produces a random full binary tree.

balancedTree :: Int -> FullBinTree Source #

Given the desired number of leaves, produces a full binary tree which is complete, except possibly for the last level, which is left-biased.

leftSpineTree :: Int -> FullBinTree Source #

Given the desired number of leaves, produces a full binary right-spine tree.

rightSpineTree :: Int -> FullBinTree Source #

Given the desired number of leaves, produces a full binary left-spine tree.

data PRFFamily gad rq rp Source #

Parameters for PRF

Instances

NFData rq => NFData (PRFFamily gad rq rp) Source # 

Methods

rnf :: PRFFamily gad rq rp -> () #

makeFamily :: forall rq rp gad. Gadget gad rq => Matrix rq -> Matrix rq -> FullBinTree -> PRFFamily gad rq rp Source #

Smart constructor

randomFamily :: forall gad rnd rq rp. (MonadRandom rnd, Random rq, Gadget gad rq) => Int -> rnd (PRFFamily gad rq rp) Source #

Randomly generate ring-based PRF family.

grayCode :: Int -> [Int] Source #

Constructs an n-bit Gray code, useful for efficiently evaluating the PRF.

data PRFState rq rp Source #

State of the PRF computation. This permits incremental computation.

Instances

NFData rq => NFData (PRFState rq rp) Source # 

Methods

rnf :: PRFState rq rp -> () #

prfState :: forall gad rq rp. Decompose gad rq => PRFFamily gad rq rp -> Maybe Int -> PRFState rq rp Source #

Given PRF parameters and an optional inital input value (default is 0), produces an initial PRF state.

latticePRF :: Rescale zq zp => Matrix zq -> Int -> PRFState zq zp -> Matrix zp Source #

Single-ouptut lattice PRF.

latticePRFM :: (MonadState (PRFState zq zp) mon, Rescale zq zp) => Matrix zq -> Int -> mon (Matrix zp) Source #

Multi-output lattice PRF with monadic memoized internal state.

ringPRF :: (Fact m, RescaleCyc (Cyc t) zq zp, Ring rq, rq ~ Cyc t m zq, rp ~ Cyc t m zp) => rq -> Int -> PRFState rq rp -> Matrix rp Source #

Single-output ring PRF.

ringPRFM :: (MonadState (PRFState rq rp) mon, Fact m, RescaleCyc (Cyc t) zq zp, Ring rq, rq ~ Cyc t m zq, rp ~ Cyc t m zp) => rq -> Int -> mon (Matrix rp) Source #

Multi-output ring PRF with monadic memoized internal state.