Commit 4a4dda17 authored by root's avatar root
Browse files

Minor bug fixes

parent 5c02c77a
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,16 +6,17 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
import argparse
import time
import random
import sys
from pathlib import Path
from collections import namedtuple
from charm.toolbox.pairinggroup import PairingGroup, ZR, G1, G2
from openpyxl import load_workbook
from openpyxl import load_workbook, Workbook
from texttable import Texttable
from uuhd.jsonobjects import (
......@@ -113,6 +114,12 @@ WitnessRecord = namedtuple(
InstanceRecord = namedtuple("InstanceRecord", "ccom_i ccom_ri")
def draw_table(headings, data):
table = Texttable()
table.add_rows([headings, data])
print(table.draw())
# Sets up the CRS (public parameters for a Vector Commitment with a database of size 'nsize', and parameters for the Pedersen commitment scheme
def setup(nsize):
par = vector_commitment.setup(nsize)
......@@ -935,11 +942,20 @@ output_headings = [
"10 Entry Profiling",
"Setup",
]
results_workbook = load_workbook("Res.xlsx")
file_name = "UUHD-PPLS-Timing-data.xlsx"
if not Path(file_name).exists():
results_workbook = Workbook()
results_counter = 1
results_max_row = 0
else:
results_workbook = load_workbook(file_name)
results_max_row = results_workbook.active.max_row
results_counter = (
results_workbook.active["A" + str(results_max_row)].value + 1
)
results_worksheet = results_workbook.active
results_max_row = results_worksheet.max_row
results_counter = results_worksheet["A" + str(results_max_row)].value + 1
if results_max_row == 0:
results_worksheet.append(output_headings)
timing_data = [
......@@ -960,13 +976,8 @@ timing_data = [
float(t_setup),
]
results_worksheet.append(timing_data)
results_workbook.save("UUHD-PPLS-Timing-data.xlsx")
t = Texttable()
t.add_rows(
[
output_headings,
timing_data,
]
)
print(t.draw())
results_workbook.save(file_name)
draw_table(output_headings[:5], timing_data[:5])
draw_table(output_headings[5:10], timing_data[5:10])
draw_table(output_headings[10:], timing_data[10:])
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,7 +6,7 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
import weakref
......
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,7 +6,8 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
def dict_from_class(cls):
excluded_keys = ["__dict__", "__doc__", "__module__", "__weakref__"]
......
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,7 +6,7 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
import sys
......
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,7 +6,7 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
from __future__ import print_function
import hashlib
......@@ -25,7 +25,7 @@ from charm.toolbox.integergroup import (
from charm.core.math import integer as charminteger
from charm.toolbox.integergroup import lcm, integer
from uuhd.measurementutil import get_real_size
from uuhd.measurement_util import get_real_size
# Paillier Enc
from charm.schemes.pkenc import pkenc_paillier99
......
'''
"""
SPDX-FileCopyrightText: 2021 University of Luxembourg
SPDX-License-Identifier: GPL-3.0-or-later
SPDXVersion: SPDX-2.2
......@@ -6,7 +6,7 @@ SPDXVersion: SPDX-2.2
Authors:
Aditya Damodaran, aditya.damodaran@uni.lu
Alfredo Rial, alfredo.rial@uni.lu
'''
"""
import json
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment