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

ZkFold.Base.Algebra.EllipticCurve.Class

Documentation

data Point curve Source #

Constructors

Point 

Fields

Inf 

Instances

Instances details
(EllipticCurve c, HomomorphicCommit a b (Point c), Foldable t) => HomomorphicCommit a (t b) (Point c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Commit

Methods

hcommit :: a -> t b -> Point c Source #

(EllipticCurve curve, AdditiveGroup (BaseField curve)) => Scale Integer (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

scale :: Integer -> Point curve -> Point curve Source #

EllipticCurve curve => Scale Natural (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

scale :: Natural -> Point curve -> Point curve Source #

(EllipticCurve curve, Eq s, BinaryExpansion s, Bits s ~ [s]) => Scale s (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

scale :: s -> Point curve -> Point curve Source #

(Symbolic ctx, EllipticCurve c, SymbolicData (Point c), Context (Point c) ~ ctx, PedersonSetup (Point c), Layout (Point c) ~ l, Representable l, Traversable l) => HomomorphicCommit (FieldElement ctx) (FieldElement ctx) (Point c) Source #

Pedersen commitment scheme Commitment key consists of field elements g and h, and randomness r

Instance details

Defined in ZkFold.Base.Protocol.Protostar.Commit

Methods

hcommit :: FieldElement ctx -> FieldElement ctx -> Point c Source #

(EllipticCurve c, SymbolicData (Point c), l ~ Layout (Point c), Representable l, Traversable l, ctx ~ Context (Point c), Symbolic ctx, a ~ BaseField ctx, bits ~ NumberOfBits a) => Scale (FieldElement ctx) (Point c) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

Methods

scale :: FieldElement ctx -> Point c -> Point c Source #

Symbolic c => Eq (Bool c) (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

Methods

(==) :: Point (Ed25519 c) -> Point (Ed25519 c) -> Bool c Source #

(/=) :: Point (Ed25519 c) -> Point (Ed25519 c) -> Bool c Source #

(EllipticCurve curve, Arbitrary (ScalarField curve)) => Arbitrary (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

arbitrary :: Gen (Point curve) #

shrink :: Point curve -> [Point curve] #

Generic (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Associated Types

type Rep (Point curve) :: Type -> Type #

Methods

from :: Point curve -> Rep (Point curve) x #

to :: Rep (Point curve) x -> Point curve #

(EllipticCurve curve, Show (BaseField curve)) => Show (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

showsPrec :: Int -> Point curve -> ShowS #

show :: Point curve -> String #

showList :: [Point curve] -> ShowS #

Binary (Point BLS12_381_G1) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

Binary (Point BLS12_381_G2) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

Binary (Point BN254_G1) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BN254

Binary (Point BN254_G2) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BN254

Binary (Point Pallas) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

Binary (Point Vesta) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

Methods

put :: Point Vesta -> Put #

get :: Get (Point Vesta) #

putList :: [Point Vesta] -> Put #

NFData (BaseField curve) => NFData (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

rnf :: Point curve -> () #

(EllipticCurve curve, Eq (BaseField curve)) => Eq (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

(==) :: Point curve -> Point curve -> Bool #

(/=) :: Point curve -> Point curve -> Bool #

(EllipticCurve curve, AdditiveGroup (BaseField curve)) => AdditiveGroup (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

(-) :: Point curve -> Point curve -> Point curve Source #

negate :: Point curve -> Point curve Source #

EllipticCurve curve => AdditiveMonoid (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

zero :: Point curve Source #

EllipticCurve curve => AdditiveSemigroup (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

(+) :: Point curve -> Point curve -> Point curve Source #

PedersonSetup (Point BLS12_381_G1) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Commit

(Symbolic c, FromConstant Natural (BaseField (Ed25519 c))) => PedersonSetup (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Base.Protocol.Protostar.Commit

(Symbolic c, BaseField c ~ a) => SymbolicData (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

Associated Types

type Context (Point (Ed25519 c)) :: (Type -> Type) -> Type Source #

type Support (Point (Ed25519 c)) Source #

type Layout (Point (Ed25519 c)) :: Type -> Type Source #

type Rep (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Rep (Point curve) = D1 ('MetaData "Point" "ZkFold.Base.Algebra.EllipticCurve.Class" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Point" 'PrefixI 'True) (S1 ('MetaSel ('Just "_x") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BaseField curve)) :*: S1 ('MetaSel ('Just "_y") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BaseField curve))) :+: C1 ('MetaCons "Inf" 'PrefixI 'False) (U1 :: Type -> Type))
type Context (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

type Context (Point (Ed25519 c)) = c
type Layout (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

type Support (Point (Ed25519 c)) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

class EllipticCurve curve where Source #

Associated Types

type BaseField curve :: Type Source #

type ScalarField curve :: Type Source #

Methods

inf :: Point curve Source #

gen :: Point curve Source #

add :: Point curve -> Point curve -> Point curve Source #

mul :: ScalarField curve -> Point curve -> Point curve Source #

Instances

Instances details
EllipticCurve BLS12_381_G1 Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

EllipticCurve BLS12_381_G2 Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

EllipticCurve BN254_G1 Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BN254

EllipticCurve BN254_G2 Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BN254

EllipticCurve Pallas Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

Associated Types

type BaseField Pallas Source #

type ScalarField Pallas Source #

EllipticCurve Vesta Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

Associated Types

type BaseField Vesta Source #

type ScalarField Vesta Source #

(Symbolic c, NFData (c (Vector Size))) => EllipticCurve (Ed25519 c :: Type) Source #

Ed25519 with UInt 256 ArithmeticCircuit a as computational backend

Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

Associated Types

type BaseField (Ed25519 c) Source #

type ScalarField (Ed25519 c) Source #

EllipticCurve (Ed25519 Void) Source #

The purely mathematical implementation of Ed25519. It is available for use as-is and serves as "backend" for the UInt 256 (Zp p) implementation as well.

Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Ed25519

Associated Types

type BaseField (Ed25519 Void) Source #

type ScalarField (Ed25519 Void) Source #

class (EllipticCurve curve1, EllipticCurve curve2, ScalarField curve1 ~ ScalarField curve2, Eq (TargetGroup curve1 curve2), MultiplicativeGroup (TargetGroup curve1 curve2), Exponent (TargetGroup curve1 curve2) (ScalarField curve1)) => Pairing curve1 curve2 where Source #

Associated Types

type TargetGroup curve1 curve2 :: Type Source #

Methods

pairing :: Point curve1 -> Point curve2 -> TargetGroup curve1 curve2 Source #

pointAdd :: Field (BaseField curve) => Eq (BaseField curve) => Point curve -> Point curve -> Point curve Source #

pointDouble :: Field (BaseField curve) => Point curve -> Point curve Source #

addPoints :: EllipticCurve curve => Field (BaseField curve) => Eq (BaseField curve) => Point curve -> Point curve -> Point curve Source #

pointNegate :: AdditiveGroup (BaseField curve) => Point curve -> Point curve Source #

pointMul :: forall curve s. EllipticCurve curve => BinaryExpansion s => Bits s ~ [s] => Eq s => s -> Point curve -> Point curve Source #

data PointCompressed curve Source #

compress :: (AdditiveGroup (BaseField curve), Ord (BaseField curve)) => Point curve -> PointCompressed curve Source #

decompress :: forall curve. (StandardEllipticCurve curve, FiniteField (BaseField curve), Ord (BaseField curve)) => PointCompressed curve -> Point curve Source #