Copyright | (c) Eric Crockett 2011-2017 Chris Peikert 2011-2017 |
---|---|
License | GPL-2 |
Maintainer | ecrockett0@email.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Key-homomorphic PRF from [BP14].
- data FullBinTree
- = L
- | I Int FullBinTree FullBinTree
- evalTree :: Int -> PRFState rq rp -> (Matrix rq, PRFState rq rp)
- randomTree :: MonadRandom rnd => Int -> rnd FullBinTree
- balancedTree :: Int -> FullBinTree
- leftSpineTree :: Int -> FullBinTree
- rightSpineTree :: Int -> FullBinTree
- data PRFFamily gad rq rp
- makeFamily :: forall rq rp gad. Gadget gad rq => Matrix rq -> Matrix rq -> FullBinTree -> PRFFamily gad rq rp
- randomFamily :: forall gad rnd rq rp. (MonadRandom rnd, Random rq, Gadget gad rq) => Int -> rnd (PRFFamily gad rq rp)
- grayCode :: Int -> [Int]
- data PRFState rq rp
- prfState :: forall gad rq rp. Decompose gad rq => PRFFamily gad rq rp -> Maybe Int -> PRFState rq rp
- latticePRF :: Rescale zq zp => Matrix zq -> Int -> PRFState zq zp -> Matrix zp
- latticePRFM :: (MonadState (PRFState zq zp) mon, Rescale zq zp) => Matrix zq -> Int -> mon (Matrix zp)
- 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
- 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)
Documentation
data FullBinTree Source #
Full binary tree.
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.
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.
State of the PRF computation. This permits incremental computation.
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.