symbolic-base-0.1.0.0: ZkFold Symbolic compiler and zero-knowledge proof protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Synopsis

Documentation

class AccumulatorScheme i f c m ctx a where Source #

Accumulator scheme for V_NARK as described in Chapter 3.4 of the Protostar paper

Methods

prover :: a -> f -> Accumulator i f c m -> InstanceProofPair i c m -> (Accumulator i f c m, [c]) Source #

verifier :: i -> [c] -> AccumulatorInstance i f c -> AccumulatorInstance i f c -> [c] -> Bool ctx Source #

decider :: a -> (f, KeyScale f) -> Accumulator i f c m -> Bool ctx Source #

Instances

Instances details
(Symbolic ctx, Eq (Bool ctx) c, Eq (Bool ctx) i, Eq (Bool ctx) f, Eq (Bool ctx) [f], Eq (Bool ctx) [c], AdditiveGroup c, AdditiveSemigroup m, Ring f, Scale f c, Scale f m, MapInput f a ~ i, deg ~ (Degree (CommitOpen m c a) + 1), KnownNat deg, LinearCombination (MapMessage f a) (MapMessage (PolyVec f deg) a), LinearCombination (MapInput f a) (MapInput (PolyVec f deg) a), LinearCombinationWith f (MapInput f a), MapMessage f a ~ m, AlgebraicMap f (CommitOpen m c a), AlgebraicMap (PolyVec f deg) a, RandomOracle c f, RandomOracle i f, HomomorphicCommit f [m] c, HomomorphicCommit f [f] c) => AccumulatorScheme i f c m ctx (FiatShamir f (CommitOpen m c a)) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Methods

prover :: FiatShamir f (CommitOpen m c a) -> f -> Accumulator i f c m -> InstanceProofPair i c m -> (Accumulator i f c m, [c]) Source #

verifier :: i -> [c] -> AccumulatorInstance i f c -> AccumulatorInstance i f c -> [c] -> Bool ctx Source #

decider :: FiatShamir f (CommitOpen m c a) -> (f, KeyScale f) -> Accumulator i f c m -> Bool ctx Source #

data KeyScale f Source #

Constructors

KeyScale f f 

Instances

Instances details
Generic (KeyScale f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Associated Types

type Rep (KeyScale f) :: Type -> Type #

Methods

from :: KeyScale f -> Rep (KeyScale f) x #

to :: Rep (KeyScale f) x -> KeyScale f #

Show f => Show (KeyScale f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Methods

showsPrec :: Int -> KeyScale f -> ShowS #

show :: KeyScale f -> String #

showList :: [KeyScale f] -> ShowS #

NFData f => NFData (KeyScale f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Methods

rnf :: KeyScale f -> () #

type Rep (KeyScale f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

type Rep (KeyScale f) = D1 ('MetaData "KeyScale" "ZkFold.Base.Protocol.Protostar.AccumulatorScheme" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "KeyScale" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 f)))

class LinearCombination a b where Source #

Class describing types which can form a polynomial linear combination: linearCombination a1 a2 -> a1 * X + a2

Methods

linearCombination :: a -> a -> b Source #

Instances

Instances details
(Ring a, Ord key, KnownNat k) => LinearCombination (Map key a) (Map key (PolyVec a k)) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Fold

Methods

linearCombination :: Map key a -> Map key a -> Map key (PolyVec a k) Source #

(Ring a, KnownNat n, KnownNat k) => LinearCombination (Vector n a) (Vector n (PolyVec a k)) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Fold

Methods

linearCombination :: Vector n a -> Vector n a -> Vector n (PolyVec a k) Source #

class LinearCombinationWith a b where Source #

Same as above, but with a coefficient known at runtime linearCombination coeff b1 b2 -> b1 * coeff + b2

Methods

linearCombinationWith :: a -> b -> b -> b Source #

Instances

Instances details
(Scale f a, AdditiveSemigroup a) => LinearCombinationWith f [a] Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.AccumulatorScheme

Methods

linearCombinationWith :: f -> [a] -> [a] -> [a] Source #

(Ring a, KnownNat n) => LinearCombinationWith a (Vector n a) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Fold

Methods

linearCombinationWith :: a -> Vector n a -> Vector n a -> Vector n a Source #