cleanup gp scripts
This commit is contained in:
parent
885b37bac1
commit
8cf93a6c18
@ -31,11 +31,6 @@ pe=ffgen(minpoly(ffprimroot(ffgen(ffinit(q,1))),var),var) \\ get primitive ele
|
||||
1/(fforder(pe) == q-1) \\ error out, if ord(pe) is wrong
|
||||
g = Mod(eval(Str(pe)), q) \\ dirty hack to convert t_FFELEM to t_INT
|
||||
|
||||
\\ setup static matrices
|
||||
U = matrix(k,k,i,j,Mod(i<=j,q))
|
||||
L = matrix(k,k,i,j,Mod(i>=j,q))
|
||||
Id = matrix(k,k,i,j,Mod(i==j,q))
|
||||
|
||||
\\\\\\\\\\\\
|
||||
\\ PROLOG
|
||||
\\\\\\\\\\\\
|
||||
@ -47,13 +42,11 @@ yshares = vector(n,i,g^x[i])
|
||||
\\ shared public key
|
||||
y = prod(X=1,n,yshares[X])
|
||||
|
||||
\\ what is m?
|
||||
\\ first index level = agent id (additive share)
|
||||
\\ first index level = owning agent id (additive share)
|
||||
\\ second index level = agent id, price id
|
||||
m = vector(n,i,matrix(n,k,a,b,random(q)))
|
||||
|
||||
\\ what is r?
|
||||
\\ index = agent id, price id
|
||||
\\ index = owning agent id, price id
|
||||
r = matrix(n,k,i,j,random(q))
|
||||
\\ bid matrix
|
||||
b = matrix(n,k,i,j,g^(bid[i]==j))
|
||||
@ -71,7 +64,7 @@ beta = matrix(n,k,i,j, g^r[i,j])
|
||||
\\\\\\\\\\\\
|
||||
|
||||
\\ multiplicative shares
|
||||
\\ first index level = agent id (multiplicative share)
|
||||
\\ first index level = owning agent id (multiplicative share)
|
||||
\\ second index level = agent id, price id
|
||||
Gamma = vector(n,a,matrix(n,k,i,j, ( prod(h=1,n,prod(d=j+1,k,alpha[h,d])) * prod(d=1,j-1,alpha[i,d]) * prod(h=1,i-1,alpha[h,j]) )^m[a][i,j] ))
|
||||
Delta = vector(n,a,matrix(n,k,i,j, ( prod(h=1,n,prod(d=j+1,k, beta[h,d])) * prod(d=1,j-1, beta[i,d]) * prod(h=1,i-1, beta[h,j]) )^m[a][i,j] ))
|
||||
@ -81,7 +74,7 @@ Delta = vector(n,a,matrix(n,k,i,j, ( prod(h=1,n,prod(d=j+1,k, beta[h,d])) * prod
|
||||
\\\\\\\\\\\\
|
||||
|
||||
\\ multiplicative shares (decryption)
|
||||
\\ first index level = agent id (multiplicative share)
|
||||
\\ first index level = owning agent id (multiplicative share)
|
||||
\\ second index level = agent id, price id
|
||||
Phi = vector(n,a,matrix(n,k,i,j, prod(h=1,n,Delta[h][i,j])^x[a] ))
|
||||
|
Loading…
Reference in New Issue
Block a user