At we see, the matrices A and B are 2−SLT and matrix C is 2−Diag. Also AzoBz=Cz.
We consider multiplicative subgroup H of order n=ng+ni+1=5 with generator
ω=236≡59(mod181). Note that if g is a generator of field F of order p, then, gnp−1is a generator of a multiplicative subgroup of it of order n. Therefore, H={1,ω,ω2,ω3,ω4}={1,59,42,125,135}.
Also, consider multiplicative subgroup K of order m=2ng=6 where t=ni+1=2 with generator γ=gmp−1=230≡49(mod181). Therefore,K={1,γ,γ2,...,γ5}={1,49,48,180,132,133}.
1- The Prover Selects r=(r1,...,rsAHP(0)) of random space R.
2- The Prover calculates O=Enc(if=(A,B,C)) as encoded index as following:.
First, calculates the polynomial rowA(x). Since matrix A has three non-zero entries that the first of them is in the second row, so c0=2 and rowA(γ0)=ω2 , note that rows numbered of zero, the second is in the third row, so c1=3 and rowA(γ1)=ω3 and the third is in the fourth row, so c2=4 and rowA(γ2)=ω4. Note that to construct all three polynomials, we read the entries in the matrix in row or column order. Here they are read in row order.
According to the values defined for γ and ω, we have rowA(1)=42, rowA(43)=125 and rowA(39)=135. Therefore based on Lagrange polynomials, have rowA(x)=∑i=13yiLi(x), sorowA(x)=42L1(x)+125L2(x)+135L3(x), where L1(x)=(1−43)(1−39)(x−43)(x−39)=(−42)(−38)(x−43)(x−39). Now, since −42≡139(mod181), −38≡143(mod181), −43≡138(mod181)and −39≡142(mod181), therefore L1(x)=(139)(143)(x+138)(x+142)and since (139)(143)≡148(mod181)and 148−1≡170(mod181), have L1(x)=170(x+138)(x+142)=170x2+178x+15. We get in a similar way that L2(x)=167x2+17x+178 and L3(x)=25x2+167x+170. Therefore rowA(x)=77x2+109x+37.
Now, calculates colA(x). Since matrix A has three non-zero entries that the first of them is in the first column, so r0=1 and colA(γ0)=ω1 , note that columns numbered of zero, the second is in the zero column, so r1=0 and colA(γ1)=ω0 and the third is in the third column, so r2=3 and colA(γ2)=ω3. Therefore colA(1)=59, colA(43)=1 and colA(39)=125. So colA(x)=59L1(x)+L2(x)+125L3(x)=109x2+81x+50.
3- The Prover calculates commitment by using of KZG commitment scheme as following:
Now, calculates valA(x). Since matrix A has three non-zero entries such that the value of all of them is one, therefore v0=v1=v2=1. So, valA(x)=L1(x)+L2(x)+L3(x)=1.
Therefore, the matrix A is encoded by rowA(x)=77x2+109x+37, colA(x)=109x2+81x+50 and valA(x)=1.
Now, encodes the matrix B. First, calculates the polynomial rowB(x). Since matrix B has four non-zero entries such that the first of them is in the second row, so c0=2 and rowB(γ0)=ω2 . The second and the third are in the third row, so c1=c2=3 and rowB(γ1)=rowB(γ2)=ω3 and the fourth is in the fourth row, so c3=4 and rowB(γ3)=ω4. Therefore, rowB(1)=42, rowB(43)=125, rowB(39)=125 and rowB(48)=135. So rowB(x)=42L1(x)+125L2(x)+125L3(x)+135L4(x) where L1(x)=(1−43)(1−39)(1−48)(x−43)(x−39)(x−48)=(139)(143)(134)(x+138)(x+142)(x+133)=103(x+138)(x+142)(x+133). Since 103−1≡58(mod181), so L1(x)=58(x+138)(x+142)(x+133)=58x3+62x2+116x+127. We get in a similar way that L2(x)=39x3+7x2+19x+116, L3(x)=138x3+155x2+7x+62 and L4(x)=127x3+138x2+39x+58. Therefore rowB(x)=76x3+35x2+174x+119.
Now, calculates colB(x). Since matrix B has four non-zero entries that the first, second and fourth of them are in zero column, so r0=r1=r3=0 and colB(γ0)=colB(γ1)=colB(γ3)=ω0 and the third is in the second column, so r2=2 and colB(γ2)=ω2 . Therefore colB(1)=1, colB(43)=1, colB(39)=42and colB(48)=1. So colB(x)=L1(x)+L2(x)+42L3(x)+L4(x)=47x3+20x2+106x+9.
Now, calculates valB(x). Since matrix B has four non-zero entries that value of them are 5, 11, 1 and 26, respectively. Therefore v0=v1=v2=1valB(γ0)=5, valB(γ1)=11, valB(γ2)=1and valB(γ3)=26. So, valB(1)=5, valB(43)=11, valB(39)=1and valB(48)=26. Therefore, valB(x)=5L1(x)+11L2(x)+L3(x)+26L4(x)=177x3+148x2+42.
Therefore, the matrix B is encoded by rowB(x)=76x3+35x2+174x+119, colB(x)=47x3+20x2+106x+9 and valB(x)=177x3+148x2+42.
Now, calculates polynomial rowC(x). In a similar way, Since matrix C has three non-zero entries that are in the third, fourth and fifth rows, therefore rowC(γ0)=ω2 , rowC(γ1)=ω3 and rowC(γ2)=ω4. Then rowC(1)=42 , rowC(43)=125 and rowC(39)=135. SorowC(x)=42L1(x)+125L2(x)+135L3(x), therefore rowC(x)=77x2+109x+37.
Now, since C is a diagonal matrix, polynomials rowC(x) and colC(x)are equal. Also, since the matrix C has three non-zero entries such that the value of all of them is one, therefore v0=v1=v2=1. So, valC(x)=L1(x)+L2(x)+L3(x)=1.
Therefore, the matrix C is encoded by rowC(x)=77x2+109x+37, colC(x)=77x2+109x+37 and valC(x)=1. Therefore, encoding of i=(A,B,C) calculates as following:OPFR=(37,109,77,0,0,0,0,0,0,50,81,109,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,119,174,35,76,0,0,0,0,0,9,106,20,47,0,0,0,0,0,42,0,148,177,0,0,0,0,0,37,109,77,0,0,0,0,0,0,37,109,77,0,0,0,0,0,0,37,109,77,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0)
ComT=∑i=0degTaigτi=∑i=0degTaick(i) where ai is coefficient of xi in polynomial T(x).
ComrowB(x)=, ComcolB(x)=, ComvalB(x)=, ComrowC(x)=, ComcolC(x)= and ComvalC(x)=.
4- The Prover sends ComPFR= to the Verifier.
Commit(ck,if=(A,B,C),r∈R):
1 - The Prover Selects r=(r1,...,rsAHP(0)) of random space R.
2- The Prover calculates OAHP=Enc(if=(A,B,C)) as encoded index as following:
The polynomial rowA′:K={1,49,48,180,132,133}→H={1,59,42,125,135} with rowA′(k=γi)=ωri for 1≤i≤∣∣A∣∣ , and otherwise rowA′(k) returns an arbitrary element in H.
So rowA′(k) on K is a polynomial so that rowA′(1)=42 , rowA′(49)=125, rowA′(48)=135 and otherwise rowA′(k) returns arbitrary elements of H, for example rowA′(180)=125, rowA′(132)=135, rowA′(133)=1 Therefore, rowA′(x)=∑i=16yiLi(x)=162x5+62x4+161x3+169x2+88x+124.
Also, colA′:K={1,49,48,180,132,133}→H={1,59,42,125,135} with colA′(k=γi)=ωci for 1≤i≤∣∣A∣∣ and otherwise colA′(k) returns an arbitrary element in H.
So colA′(k) on K is a polynomial so that colA′(1)=59 , colA′(49)=1, colA′(48)=125 and otherwise colA′(k) returns arbitrary elements of H, for example colA′(180)=125, colA′(132)=135 and colA′(133)=1. Therefore, colA′(x)=∑i=16yiLi(x)=128x5+150x4+32x3+109x2+169x+14
and , valA′:K={1,49,48,180,132,133}→H={1,59,42,125,135} with valA′(k=γi)=uH(rowA′(k),rowA′(k))uH(colA′(k),colA′(k))vi for 1≤i≤∣∣A∣∣ where vi is value of ith nonzero entry and otherwise valA′(k) returns zero. Note that based on definition of uH(x,y), for each x∈H, uH(x,x)=∣H∣x∣H∣−1=5x4. So valA′(1)=(5rowA′4(1))(5colA′4(1))1=5×424×5×5941=1451≡5(mod181), valA′(49)=(5rowA′4(49))(5colA′4(49))1=5×1254×5×141=1451≡5(mod181) , valA′(48)=(5rowA′4(48))(5colA′4(48))1=5×1354×5×12541=481≡132(mod181) and valA′(k)=0 for k∈K−{1,49,48}. Therefore valA′(x)=∑i=16yiLi(x)=72x5+79x4+22x3+111x2+180x+84.
Now, rowA′^, colA′^ and valA′^ are extensions of rowA′, colA′ and valA′ so that are agree on K.
Similarly, rowB′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that rowB′(1)=42, rowB′(49)=125, rowB′(48)=125, rowB′(180)=135 and for the rest values of K, rowB′(k) returns arbitrary elements of H, for example rowB′(132)=135 and rowB′(133)=1. Therefore rowB′(x)=∑i=16yiLi(x)=20x5+85x4+37x3+151x2+168x+124.
Also, colB′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that colB′(1)=1 , colB′(49)=1, colB′(48)=42, colB′(180)=1 and for the rest values of K , colB′(k) returns arbitrary elements of H, for example colB′(132)=135 and colB′(133)=1. Therefore colB′(x)=∑i=16yiLi(x)=18x5+164x4+180x3+18x2+164x
and , valB′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that valB′(1)=(5rowB′4(1))(5colB′4(1))5=5×424×5×145=485≡117(mod181), valB′(49)=(5rowB′4(49))(5colB′4(49))11=5×1254×5×1411=14511≡55(mod181) , valB′(48)=(5rowB′4(48))(5colB′4(48))1=5×1254×5×4241=251≡29(mod181) , valB′(180)=(5rowB′4(180))(5colB′4(180))26=5×1354×5×1426=2726≡68(mod181) and valB′(k)=0 for k∈K−{1,49,48,180}. Therefore valB′(x)=∑i=16yiLi(x)=86x5+53x4+34x3+55x2+176x+75.
Now, rowB′^, colB′^ and valB′^ are extensions of rowB′, colB′ and valB′ so that are agree on K.
Similarly, rowC′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that rowC′(1)=42, rowC′(49)=125, rowC′(48)=135 and for the rest values of K, rowC′(k) returns arbitrary elements of H, for example rowC′(180)=125, rowC′(132)=135 and rowC′(133)=1. Therefore rowC′(x)=∑i=16yiLi(x)=162x5+62x4+161x3+169x2+88x+124.
Also, colC′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that colC′(1)=42 , colC′(49)=125, colC′(48)=135, colC′(180)=125 and for the rest values of K , colC′(k) returns arbitrary elements of H, for example colC′(132)=135 and colC′(133)=1. Therefore colC′(x)=∑i=16yiLi(x)=162x5+62x4+161x3+169x2+88x+124.
and , valC′:K={1,49,48,180,132,133}→H={1,59,42,125,135} so that valC′(1)=(5rowC′4(1))(5colC′4(1))1=5×424×5×4241=271≡114(mod181), valC′(49)=(5rowC′4(49))(5colC′4(49))1=5×1254×5×12541=1171≡82(mod181) , valC′(48)=(5rowC′4(48))(5colC′4(48))1=5×1354×5×13541=1451≡5(mod181) and valC′(k)=0 for k∈K−{1,49,48}. Therefore valC′(x)=∑i=16yiLi(x)=65x5+61x4+157x3+53x2+16x+124.
Now, rowC′^, colC′^ and valC′^ are extensions of rowC′, colC′ and valC′ so that are agree on K.