예제 #1
0
from StatKeeper import StatKeeper
from petlib.bindings import _C, _FFI, Const
from petlib.ec import *
from commonFuncs import *
from partialDecryptor import *
from cryptoCounter import *

import random

num_TKS = 2
num_websites =1

if __name__ == "__main__":
  random.seed("PrivEx")
  TKS = partialDecryptor()

  pk = None
  pk = TKS.combinekey(pk)

  labels = range(num_websites)
  DC = crypto_counts(labels, pk)

  items = 1
  for i in range(items):
    DC.addone(i % len(labels))

  DC.randomize()

  data = None
  hashes = []
  eqDLproofs = []
예제 #2
0
파일: run-test.py 프로젝트: TariqEE/PrivEx
num_websites=1

if __name__ == "__main__":
  stats = StatKeeper()
  random.seed('PrivEx')
  
  #ctx = sha256()
  #ctx.update("he")
  #ctx.update("llo")
  #md = ctx.digest()
  #print md.encode("hex")

  D = []
  for _ in range(num_TKG): #changed from 5 to 10 TKGs.
    with(stats["decrypt_init"]):
      D += [partialDecryptor()]

  pk = None
  for Di in D:
    with(stats["decrypt_combinekey"]):
      pk = Di.combinekey(pk)

  labels = range(num_websites)
  clients = []
  for _ in range(num_DC): #changed from 10 to 1 clients
    with(stats["client_init"]):
      c = crypto_counts(labels, pk)
      clients += [c]

  items = 1
#  mock = [0] * len(labels)
예제 #3
0
파일: run-D2.py 프로젝트: TariqEE/PrivEx
if __name__ == "__main__":
    stats = StatKeeper()
    random.seed('PrivEx')
    #ctx = _FFI.new("SHA256_CTX *")
    #md = _FFI.new("unsigned char[]", 32)
    #_C.SHA256_Init(ctx)
    #_C.SHA256_Update(ctx, "he", 2)
    #_C.SHA256_Update(ctx, "llo", 3)
    #_C.SHA256_Final(md, ctx)
    #print _FFI.buffer(md, 32)[:].encode("hex")

    D = []
    for _ in range(num_TKG):  #changed from 5 to 10 TKGs.
        with (stats["decrypt_init"]):
            D += [partialDecryptor()]

    pk = None
    for Di in D:
        with (stats["decrypt_combinekey"]):
            pk = Di.combinekey(pk)

    labels = range(num_websites)
    clients = []
    for _ in range(num_DC):  #changed from 10 to 1000 clients
        with (stats["client_init"]):
            c = crypto_counts(labels, pk)
            clients += [c]

    items = 100000
    mock = [0] * len(labels)
예제 #4
0
from StatKeeper import StatKeeper
from petlib.bindings import _C, _FFI, Const
from petlib.ec import *
from commonFuncs import *
from partialDecryptor import *
from cryptoCounter import *

import random

num_TKS = 2
num_websites = 1

if __name__ == "__main__":
    random.seed("PrivEx")
    TKS = partialDecryptor()

    pk = None
    pk = TKS.combinekey(pk)

    labels = range(num_websites)
    DC = crypto_counts(labels, pk)

    items = 1
    for i in range(items):
        DC.addone(i % len(labels))

    DC.randomize()

    data = None
    hashes = []
    eqDLproofs = []