{-# LANGUAGE UndecidableInstances #-}

module ZkFold.Base.Protocol.Plonkup.Proof where

import           Prelude                                 hiding (Num (..), drop, length, sum, take, (!!), (/), (^))

import           ZkFold.Base.Algebra.EllipticCurve.Class (EllipticCurve (..), Point)

data PlonkupProof c = PlonkupProof {
        forall {k} (c :: k). PlonkupProof c -> Point c
cmA     :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmB     :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmC     :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmF     :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmH1    :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmH2    :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmZ1    :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmZ2    :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmQlow  :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmQmid  :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
cmQhigh :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
proof1  :: Point c,
        forall {k} (c :: k). PlonkupProof c -> Point c
proof2  :: Point c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
a_xi    :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
b_xi    :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
c_xi    :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
s1_xi   :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
s2_xi   :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
f_xi    :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
t_xi    :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
t_xi'   :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
z1_xi'  :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
z2_xi'  :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
h1_xi'  :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
h2_xi   :: ScalarField c,
        forall {k} (c :: k). PlonkupProof c -> ScalarField c
l1_xi   :: ScalarField c
        -- ^ The denominator in the L_1 polynomial evaluation
    }
instance (Show (ScalarField c), Show (BaseField c), EllipticCurve c) => Show (PlonkupProof c) where
    show :: PlonkupProof c -> String
show PlonkupProof {ScalarField c
Point c
cmA :: forall {k} (c :: k). PlonkupProof c -> Point c
cmB :: forall {k} (c :: k). PlonkupProof c -> Point c
cmC :: forall {k} (c :: k). PlonkupProof c -> Point c
cmF :: forall {k} (c :: k). PlonkupProof c -> Point c
cmH1 :: forall {k} (c :: k). PlonkupProof c -> Point c
cmH2 :: forall {k} (c :: k). PlonkupProof c -> Point c
cmZ1 :: forall {k} (c :: k). PlonkupProof c -> Point c
cmZ2 :: forall {k} (c :: k). PlonkupProof c -> Point c
cmQlow :: forall {k} (c :: k). PlonkupProof c -> Point c
cmQmid :: forall {k} (c :: k). PlonkupProof c -> Point c
cmQhigh :: forall {k} (c :: k). PlonkupProof c -> Point c
proof1 :: forall {k} (c :: k). PlonkupProof c -> Point c
proof2 :: forall {k} (c :: k). PlonkupProof c -> Point c
a_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
b_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
c_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
s1_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
s2_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
f_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
t_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
t_xi' :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
z1_xi' :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
z2_xi' :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
h1_xi' :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
h2_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
l1_xi :: forall {k} (c :: k). PlonkupProof c -> ScalarField c
cmA :: Point c
cmB :: Point c
cmC :: Point c
cmF :: Point c
cmH1 :: Point c
cmH2 :: Point c
cmZ1 :: Point c
cmZ2 :: Point c
cmQlow :: Point c
cmQmid :: Point c
cmQhigh :: Point c
proof1 :: Point c
proof2 :: Point c
a_xi :: ScalarField c
b_xi :: ScalarField c
c_xi :: ScalarField c
s1_xi :: ScalarField c
s2_xi :: ScalarField c
f_xi :: ScalarField c
t_xi :: ScalarField c
t_xi' :: ScalarField c
z1_xi' :: ScalarField c
z2_xi' :: ScalarField c
h1_xi' :: ScalarField c
h2_xi :: ScalarField c
l1_xi :: ScalarField c
..} =
        String
"Plonkup Proof: "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmA String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmB String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmC String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmF String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmH1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmH2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmZ1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmZ2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmQlow String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmQmid String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
cmQhigh String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
proof1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ Point c -> String
forall a. Show a => a -> String
show Point c
proof2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
a_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
b_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
c_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
s1_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
s2_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
f_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
t_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
t_xi' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
z1_xi' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
z2_xi' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
h1_xi' String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
h2_xi String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" "
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ ScalarField c -> String
forall a. Show a => a -> String
show ScalarField c
l1_xi