From 8cf93a6c188d6a726bce46aa987c11611cf2baac Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Wed, 8 Jun 2016 13:04:53 +0200 Subject: [PATCH] cleanup gp scripts --- firstPrice.gp => gp-scripts/firstPrice | 15 ++++----------- smc.gp => gp-scripts/smc.gp | 0 2 files changed, 4 insertions(+), 11 deletions(-) rename firstPrice.gp => gp-scripts/firstPrice (87%) rename smc.gp => gp-scripts/smc.gp (100%) diff --git a/firstPrice.gp b/gp-scripts/firstPrice similarity index 87% rename from firstPrice.gp rename to gp-scripts/firstPrice index 6935ab6..d936e36 100644 --- a/firstPrice.gp +++ b/gp-scripts/firstPrice @@ -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] )) diff --git a/smc.gp b/gp-scripts/smc.gp similarity index 100% rename from smc.gp rename to gp-scripts/smc.gp