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 :: Type) Source #

Constructors

Point 

Fields

Instances

Instances details
(EllipticCurve curve, Random (ScalarField curve)) => PedersonSetup List (Point curve :: Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.Commit

Methods

groupElements :: [Point curve] Source #

(PedersonSetup s (Point curve), Functor s) => PedersonSetup (s :: Type -> Type) (Constant (Point curve) a :: Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.Commit

Methods

groupElements :: s (Constant (Point curve) a) 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, BooleanOf curve ~ Bool, 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 #

(field ~ BaseField curve, bool ~ BooleanOf curve, BoolType bool) => Planar field (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

pointXY :: field -> field -> Point curve Source #

(EllipticCurve curve, bool ~ BooleanOf curve) => Conditional bool (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

bool :: Point curve -> Point curve -> bool -> Point curve Source #

(EllipticCurve curve, bool ~ BooleanOf curve) => Eq bool (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

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

(/=) :: Point curve -> Point curve -> bool Source #

(KnownNat n, EllipticCurve curve, Random (ScalarField curve), n <= PedersonSetupMaxSize) => PedersonSetup (Vector n :: Type -> Type) (Point curve :: Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.Commit

Methods

groupElements :: Vector n (Point curve) 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), Conditional (BooleanOf curve) String) => 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 #

(EllipticCurve curve, BooleanOf curve ~ Bool) => 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 #

(field ~ BaseField curve, BoolType (BooleanOf curve), AdditiveMonoid field) => ProjectivePlanar (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

pointInf :: Point curve Source #

(Symbolic ctx, SymbolicOutput bool, SymbolicOutput field, bool ~ BooleanOf curve, field ~ BaseField curve, Context bool ~ ctx, Context field ~ ctx) => SymbolicData (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Associated Types

type Context (Point curve) :: (Type -> Type) -> Type Source #

type Support (Point curve) Source #

type Layout (Point curve) :: Type -> Type Source #

type Payload (Point curve) :: Type -> Type Source #

Methods

arithmetize :: Point curve -> Support (Point curve) -> Context (Point curve) (Layout (Point curve)) Source #

payload :: Point curve -> Support (Point curve) -> Payload (Point curve) (WitnessField (Context (Point curve))) Source #

restore :: Context (Point curve) ~ c => (Support (Point curve) -> (c (Layout (Point curve)), Payload (Point curve) (WitnessField c))) -> Point curve Source #

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

Defined in ZkFold.Symbolic.Data.Ed25519

Methods

scale :: FieldElement ctx -> Point c -> Point c 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)) :*: S1 ('MetaSel ('Just "_isInf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BooleanOf curve)))))
type Context (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Context (Point curve) = GContext (Rep (Point curve))
type Layout (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Layout (Point curve) = GLayout (Rep (Point curve))
type Payload (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Payload (Point curve) = GPayload (Rep (Point curve))
type Support (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Support (Point curve) = GSupport (Rep (Point curve))

class Planar field plane where Source #

Methods

pointXY :: field -> field -> plane Source #

Instances

Instances details
(field ~ BaseField curve, bool ~ BooleanOf curve, BoolType bool) => Planar field (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

pointXY :: field -> field -> Point curve Source #

class ProjectivePlanar plane where Source #

Methods

pointInf :: plane Source #

Instances

Instances details
(field ~ BaseField curve, BoolType (BooleanOf curve), AdditiveMonoid field) => ProjectivePlanar (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

(field ~ BaseField curve, BoolType (BooleanOf curve), AdditiveMonoid field) => ProjectivePlanar (Point curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

pointInf :: Point curve Source #

class (BoolType (BooleanOf curve), AdditiveMonoid (BaseField curve), Conditional (BooleanOf curve) (BaseField curve), Conditional (BooleanOf curve) (BooleanOf curve), Eq (BooleanOf curve) (BaseField curve), Eq (BooleanOf curve) (BooleanOf curve)) => EllipticCurve curve where Source #

Associated Types

type BaseField curve :: Type Source #

type ScalarField curve :: Type Source #

type BooleanOf curve :: Type Source #

type BooleanOf curve = Bool

Methods

pointGen :: 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 Ed25519 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

EllipticCurve Pallas Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

EllipticCurve Vesta Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Pasta

EllipticCurve Secp256k1 Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Secp256k1

(Symbolic c, NFData (c (Vector Size))) => EllipticCurve (AcEd25519 c) Source #

Ed25519 with UInt 256 ArithmeticCircuit a as computational backend

Instance details

Defined in ZkFold.Symbolic.Data.Ed25519

Associated Types

type BaseField (AcEd25519 c) Source #

type ScalarField (AcEd25519 c) Source #

type BooleanOf (AcEd25519 c) 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 :: EllipticCurve curve => Field (BaseField curve) => Point curve -> Point curve -> Point curve Source #

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

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

pointNegate :: EllipticCurve curve => 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 #

class EllipticCurve curve => WeierstrassCurve curve where Source #

data CompressedPoint curve Source #

Constructors

CompressedPoint 

Fields

Instances

Instances details
(EllipticCurve curve, bool ~ BooleanOf curve) => Conditional bool (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

bool :: CompressedPoint curve -> CompressedPoint curve -> bool -> CompressedPoint curve Source #

(EllipticCurve curve, bool ~ BooleanOf curve) => Eq bool (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

(==) :: CompressedPoint curve -> CompressedPoint curve -> bool Source #

(/=) :: CompressedPoint curve -> CompressedPoint curve -> bool Source #

(EllipticCurve curve, AdditiveGroup (BaseField curve), Ord (BooleanOf curve) (BaseField curve), Arbitrary (ScalarField curve)) => Arbitrary (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

arbitrary :: Gen (CompressedPoint curve) #

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

Generic (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Associated Types

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

Methods

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

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

(Show (BaseField curve), Conditional (BooleanOf curve) String, Show (BooleanOf curve)) => Show (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Binary (CompressedPoint BLS12_381_G1) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

Binary (CompressedPoint BLS12_381_G2) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.BLS12_381

(EllipticCurve curve, BooleanOf curve ~ Bool) => Eq (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

Methods

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

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

(field ~ BaseField curve, BoolType (BooleanOf curve), AdditiveMonoid field) => ProjectivePlanar (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Rep (CompressedPoint curve) Source # 
Instance details

Defined in ZkFold.Base.Algebra.EllipticCurve.Class

type Rep (CompressedPoint curve) = D1 ('MetaData "CompressedPoint" "ZkFold.Base.Algebra.EllipticCurve.Class" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CompressedPoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "_x") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BaseField curve)) :*: (S1 ('MetaSel ('Just "_bigY") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BooleanOf curve)) :*: S1 ('MetaSel ('Just "_isInf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BooleanOf curve)))))

compress :: (AdditiveGroup (BaseField curve), EllipticCurve curve, Ord (BooleanOf curve) (BaseField curve)) => Point curve -> CompressedPoint curve Source #

decompress :: forall curve. (WeierstrassCurve curve, FiniteField (BaseField curve), Ord (BooleanOf curve) (BaseField curve)) => CompressedPoint curve -> Point curve Source #