Commit 5dcc5b19 authored by Aditya Damodaran's avatar Aditya Damodaran
Browse files

Added licensing headers

parent 616847b7
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="Log in to Jira, Confluence, and all other Atlassian Cloud products here. Not an Atlassian user? Sign up for free."><meta name="google-site-verification" content="HNNnCkeVQ-w56fqPpX2TTEMRmta5QJ-bDunwoaUep-o"><meta name="" content=""><meta name="" content=""><link rel="shortcut icon" href="https://cpfs-cdn.atlassian.com/assets/shared/id-summit/id-summit-aa-favicon.ico"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="preconnect" href="https://t.castle.io"><link rel="preconnect" href="https://api.segment.io" crossorigin><link rel="preconnect" href="https://accounts.google.com"><link rel="preconnect" href="https://sentry.io" crossorigin><title>Log in with Atlassian account</title><style>.grecaptcha-badge{visibility:hidden}.scriptLoadError{display:flex;align-content:center;background-color:#0747a6;position:absolute;top:0;left:0;width:100%;height:100%;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857142857143;letter-spacing:-.005em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.scriptLoadError .container{color:#fff;margin:0 auto;align-items:center;display:flex;flex-direction:column}.scriptLoadError .content{background:#fff;border-radius:3px;box-shadow:0 10px 10px rgba(0,0,0,.1);box-sizing:border-box;color:#172b4d;padding:48px;width:400px}.scriptLoadError .content{margin-top:48px}.scriptLoadError .content p:first-child{margin-top:0}.scriptLoadError .content a{text-decoration:none;color:#0052cc}.scriptLoadError .logo{margin-top:48px;margin-bottom:0;font-size:40px;line-height:48px}.scriptLoadError .heading{color:#deebff;font-size:24px;font-weight:500;line-height:28px;margin-top:48px}</style><link href="https://aid-frontend.prod.atl-paas.net/atlassian-id/front-end/5.0.215/static/css/40.508e9338.chunk.css" rel="stylesheet"></head><body data-app-state="{&quot;appConfig&quot;:{&quot;contextPath&quot;:&quot;&quot;,&quot;recaptchaEnterpriseInvisibleKeySite&quot;:&quot;6LcTpeAZAAAAACEXJuZmTp5YVTOUVXnN3TYR_fLM&quot;,&quot;auth0Config&quot;:{&quot;clientId&quot;:&quot;tDP5by46cc3gEck7d2vbHZsqsfrDK6t9&quot;,&quot;tenant&quot;:&quot;atlassian-account-prod&quot;,&quot;domain&quot;:&quot;auth.atlassian.com&quot;,&quot;tokenIssuer&quot;:&quot;https://atlassian-account-prod.pus2.auth0.com&quot;,&quot;callbackUrl&quot;:&quot;https://id.atlassian.com/login/callback&quot;},&quot;recaptchaEnterpriseCheckboxKeySite&quot;:&quot;6LfnteAZAAAAAH3vsGy_TA6P6wBH6jtbMqAeVI8k&quot;,&quot;recaptchaKeySite&quot;:&quot;6LewHQcTAAAAAJgaYVKlQOahz4gnQME8wqUA0z0J&quot;,&quot;segmentIoKey&quot;:&quot;cb2egpwag7&quot;,&quot;recaptchaInvisibleKeySite&quot;:&quot;6LcqAHAUAAAAAKcO583Ymvnq-uRBDPq4njcoW-jK&quot;,&quot;castleAppId&quot;:&quot;337683121243755&quot;,&quot;bitbucketSignupUrlOverrideEnabled&quot;:false,&quot;sentryUrl&quot;:&quot;https://71e54c28be0d49f0bcd732ab30f35faa@sentry.io/275199&quot;,&quot;recaptchaEnable&quot;:true,&quot;bitbucketSignupUrl&quot;:&quot;https://bitbucket.org/account/signup&quot;,&quot;marketingConsentApiUrl&quot;:&quot;https://preferences.atlassian.com/rest&quot;,&quot;googleAuthClientId&quot;:&quot;596149463257-9oquqfivs9on8t8erq23c8qso6vk3cp1.apps.googleusercontent.com&quot;},&quot;featureFlags&quot;:{&quot;aid_signup.microsoft.auth.enabled&quot;:true,&quot;aid_signup.authenticate.via.id.authentication&quot;:false,&quot;aid_signup.disallow.bitbucket.username.login&quot;:true,&quot;aid_signup.apple.auth.enabled&quot;:true,&quot;aid_signup.email_reverification.social_login.enabled&quot;:false,&quot;aid_signup.domain.claim.data.signup.analytics&quot;:true,&quot;aid_signup.make.debug.dcs.call.for.google.auth&quot;:true,&quot;aid_signup.block.csrf.mismatches.login.authorize&quot;:true,&quot;sign-in-with-slack.enabled&quot;:false,&quot;aid_signup.experiment.user_segmentation&quot;:&quot;variation&quot;,&quot;aid_signup.email_reverification.existing_flows.enabled&quot;:false,&quot;aid_signup.passwordless.signup&quot;:false,&quot;aid_signup.logout.adg3&quot;:true,&quot;aid_signup.disallow.passwordless.login.for.google.users&quot;:true,&quot;aid_signup.apple.show.hidden.email.warning.enabled&quot;:true,&quot;aid_signup.google.auth.call.get.user.info&quot;:true,&quot;aid_signup.google.require.otp.verification&quot;:false,&quot;aid_signup.sev.enabled&quot;:true,&quot;aid_signup.default.continue.skip.profile.action&quot;:true,&quot;aid_signup.domain.claim.data.login.analytics&quot;:true,&quot;aid_signup.forced.redirect.session.distribution.enabled&quot;:false,&quot;aid_signup.recaptcha.threshold&quot;:true,&quot;aid_signup.bans.validate.authentication&quot;:true},&quot;hashedCsrfToken&quot;:&quot;2fe2c58429daf3efecfab3e840f8413e326233eff0ff7f45365c2f7aeba2b162&quot;,&quot;csrfToken&quot;:&quot;5494e2fecfa570ad015118b6a90e131b5da6458b&quot;,&quot;microbranding&quot;:{&quot;application&quot;:&quot;bitbucket&quot;,&quot;applicationNameShort&quot;:&quot;Bitbucket&quot;,&quot;applicationLogoClass&quot;:&quot;bitbucket&quot;,&quot;isEmbedded&quot;:&quot;false&quot;,&quot;applicationName&quot;:&quot;Bitbucket&quot;,&quot;applicationBaseURI&quot;:&quot;https://bitbucket.org&quot;}}"><div id="root"><noscript><div class="scriptLoadError"><div class="container"><h1 class="logo">Atlassian</h1><div class="heading">JavaScript is disabled</div><div class="content"><p>You should enable JavaScript to work with this page.</p></div></div></div></noscript><div id="javaScriptLoadError" style="display:none"><div class="scriptLoadError"><div class="container"><h1 class="logo">Atlassian</h1><div class="heading">JavaScript load error</div><div class="content"><p>We tried to load scripts but something went wrong.</p><p>Please make sure that your network settings allow you to download scripts from the following domain:</p><p><b>https://aid-frontend.prod.atl-paas.net/atlassian-id/front-end/5.0.215</b></p></div></div></div></div></div><script>var mfaServerUrl="",ticket="",requestToken="",postActionURL="",userData={userId:"",email:"",friendlyUserId:"",tenant:"",tenantFriendlyName:""},globalTrackingId="";window.onload=function(){document.getElementById("javaScriptLoadError")&&(document.getElementById("javaScriptLoadError").style.display="block")}</script><script>!function(e){function t(t){for(var n,c,f=t[0],i=t[1],u=t[2],l=0,s=[];l<f.length;l++)c=f[l],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&s.push(o[c][0]),o[c]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(d&&d(t);s.length;)s.shift()();return a.push.apply(a,u||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,f=1;f<r.length;f++){var i=r[f];0!==o[i]&&(n=!1)}n&&(a.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={39:0},a=[];function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var a,f=document.createElement("script");f.charset="utf-8",f.timeout=120,c.nc&&f.setAttribute("nonce",c.nc),f.src=function(e){return c.p+"static/js/"+({28:"cancel.account.delete",29:"delete.request.confirmation",30:"expired.password",31:"inactive.account",32:"login",34:"mfa",35:"mfa.apps",36:"mfa.enrollment",37:"multi.factor",38:"pending.deletion"}[e]||e)+"."+{0:"4affbdd5",1:"cb864870",2:"788a6906",3:"febc1b4b",4:"48053a44",5:"5a5ea63e",6:"afeb2962",7:"fd42c014",8:"9d3ec86b",9:"f56384ef",10:"a148f99b",11:"8f1f20a2",12:"13ac8176",13:"69b25e12",14:"1c06953d",15:"6c15c60f",16:"0aee1bda",17:"ee34aeab",18:"8c1595c6",19:"15feb98d",20:"6ba29f7b",21:"052ace4e",22:"7789c2ed",23:"3b8336b0",24:"15cd28b7",25:"b6ee60e7",26:"dd3bdeec",27:"bab41009",28:"7857862a",29:"6cc8dbde",30:"f9b1acf9",31:"87c595db",32:"b0a702c7",34:"e0fded5e",35:"f01b5fc4",36:"34e828f2",37:"20018db2",38:"b3d6016c",41:"0cc26102",42:"bbc93f54",43:"bf78a770",44:"a5b76f1d"}[e]+".chunk.js"}(e);var i=new Error;a=function(t){f.onerror=f.onload=null,clearTimeout(u);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",i.name="ChunkLoadError",i.type=n,i.request=a,r[1](i)}o[e]=void 0}};var u=setTimeout((function(){a({type:"timeout",target:f})}),12e4);f.onerror=f.onload=a,document.head.appendChild(f)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="https://aid-frontend.prod.atl-paas.net/atlassian-id/front-end/5.0.215/",c.oe=function(e){throw console.error(e),e};var f=this["webpackJsonpaid-frontend"]=this["webpackJsonpaid-frontend"]||[],i=f.push.bind(f);f.push=t,f=f.slice();for(var u=0;u<f.length;u++)t(f[u]);var d=i;r()}([])</script><script src="https://aid-frontend.prod.atl-paas.net/atlassian-id/front-end/5.0.215/static/js/40.b457d8d5.chunk.js"></script><script src="https://aid-frontend.prod.atl-paas.net/atlassian-id/front-end/5.0.215/static/js/main.4412f9ee.chunk.js"></script></body></html>
\ No newline at end of file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
.vagrant/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
.idea/
# Output
# *.xlsx
\ No newline at end of file
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
import argparse
import time
import random
......@@ -31,22 +36,24 @@ from uuhd.primitives import (
)
from uuhd.measurement_util import get_real_size
parser = argparse.ArgumentParser(description="Implementation of the protocol described in the paper titled 'Unlinkable Updatable Hiding Databases and Privacy-Preserving Loyalty Programs'")
parser = argparse.ArgumentParser(
description="Implementation of the protocol described in the paper titled 'Unlinkable Updatable Hiding Databases and Privacy-Preserving Loyalty Programs'"
)
parser.add_argument("size", metavar="N", type=int, help="Database size")
parser.add_argument(
"-k",
"--keylength",
metavar = "K",
type = int,
help = "Paillier Encryption key size. (Supported values: 1024, 2048)",
metavar="K",
type=int,
help="Paillier Encryption key size. (Supported values: 1024, 2048)",
)
parser.add_argument(
"-r",
"--randomise",
action = 'store_true',
default = False,
help = "Randomise database state",
action="store_true",
default=False,
help="Randomise database state",
)
# parser.add_argument('-w','--writetofile', action='writetofile', help='Paillier
......@@ -58,7 +65,7 @@ args = parser.parse_args()
if args.keylength == 1024 or args.keylength == 2048:
keylength = args.keylength
if args.size != None and int(args.size) > 10 and int(args.size) > 800000:
db_size = int(args.size)
......@@ -167,7 +174,9 @@ class Updater:
+ str(record["coms"])
)
else:
print("Abort: (Updater) Unrecognised message: " + str(m["message"]))
print(
"Abort: (Updater) Unrecognised message: " + str(m["message"])
)
exit()
# Responses from U to messages from other FZKs
......@@ -420,7 +429,9 @@ class Reader:
def test_witness_update(self, sid, p, i_list):
if len(self.l_par) == 0 or len(self.l_store) == 0:
print("Abort: (Reader) Party hasn't been initialised. (HD witness update tests)")
print(
"Abort: (Reader) Party hasn't been initialised. (HD witness update tests)"
)
exit()
r2 = self.l_par[0]["par"]["group"].random(ZR)
......@@ -434,7 +445,9 @@ class Reader:
for i_list_item in i_list:
if self.l_store[0]["x"][i_list_item.i] != i_list_item.vr:
print("Abort: (Reader) input tuples do not match HD state. (HD witness update tests)")
print(
"Abort: (Reader) input tuples do not match HD state. (HD witness update tests)"
)
exit()
temp_witness_record = WitnessRecord(
i_list_item.i,
......@@ -468,7 +481,6 @@ class Reader:
self.l_store[0]["x"][i_list_item.i],
self.l_store[0]["x"][i_list_item.i] + 2,
)
def read(self, sid, p, i_list):
......@@ -486,7 +498,9 @@ class Reader:
instance_records = []
for i_list_item in i_list:
if self.l_store[0]["x"][i_list_item.i] != i_list_item.vr:
print("Abort: (Reader) input tuples do not match HD state. (read)")
print(
"Abort: (Reader) input tuples do not match HD state. (read)"
)
exit()
t_comp_vcom_start = time.time()
temp_witness_record = WitnessRecord(
......@@ -700,7 +714,7 @@ def register():
p = reader_k.first_read(sid, 0)
for i in range(0, db_size):
if args.randomise == True:
db_list.append(random.randint(0,99))
db_list.append(random.randint(0, 99))
else:
db_list.append(0)
empty_db_list.append(0)
......@@ -733,7 +747,9 @@ def redeem(points):
# TODO: Store positional coms
t_redeem_start = time.time()
if points > reader_k.l_store[0]["x"][db_size]:
print("Abort: (Reader) Insufficient loyalty points for this operation. (redeem)")
print(
"Abort: (Reader) Insufficient loyalty points for this operation. (redeem)"
)
else:
com_db_size = pedersen_commitment.commit(
reader_k.l_par[0]["par_c"], db_size
......@@ -753,7 +769,7 @@ def redeem(points):
"N": db_size,
"openN": com_db_size["open"],
}
f_zkrd = FZK_RD(f_nym,keylength)
f_zkrd = FZK_RD(f_nym, keylength)
f_zkrd.prove(
sid,
witness_rd,
......@@ -771,7 +787,9 @@ def redeem(points):
)
== 0
):
print("Abort: (Updater) Loyalty point commitments do not hold. (redeem)")
print(
"Abort: (Updater) Loyalty point commitments do not hold. (redeem)"
)
exit()
com_list = reader_k.prepare_committed_record(
......@@ -896,28 +914,28 @@ com_list = reader_k.prepare_committed_record([5])
p = reader_k.test_witness_update(sid, 0, com_list)
output_headings = [
"N",
"DB Size",
"Paillier Key Length",
"First Update",
"Computation of Vcom",
"1 Entry Update",
"1 Entry Read",
"5 Entry Read",
"Registration",
"Purchase",
"Redemption",
"1 Entry Profiling",
"5 Entry Profiling",
"10 Entry Profiling",
"Setup",
]
"N",
"DB Size",
"Paillier Key Length",
"First Update",
"Computation of Vcom",
"1 Entry Update",
"1 Entry Read",
"5 Entry Read",
"Registration",
"Purchase",
"Redemption",
"1 Entry Profiling",
"5 Entry Profiling",
"10 Entry Profiling",
"Setup",
]
results_workbook = load_workbook("Res.xlsx")
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):
if results_max_row == 0:
results_worksheet.append(output_headings)
timing_data = [
results_counter,
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
import time
import subprocess
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
import weakref
from charm.toolbox.pairinggroup import ZR, G1, G2, pair
......@@ -93,7 +98,7 @@ class FZK:
subinstance_list = instance["ins_i"]
subwitnesss_list = witness["wit_i"]
sigma_protocol = SigmaProtocol(instance, "BN256",self.keylength)
sigma_protocol = SigmaProtocol(instance, "BN256", self.keylength)
y1 = sigma_protocol.compute_ppe_1(d1, d2, d3, d4, "lhs")
y2 = sigma_protocol.compute_ppe_2(d1, d5, "lhs")
......@@ -274,10 +279,10 @@ class FZK_RD:
rsa_group = RSAGroup()
self.paillier_encryption = PaillierEncryption(rsa_group)
(self.public_key, self.secret_key) = self.paillier_encryption.keygen(
self.keylength )
self.keylength
)
# Verifier picks x rand
x = group.random(ZR)
......@@ -488,9 +493,9 @@ class FZK_RD:
dsa_q = integer(
78026701315845642650478533423290697952946810503781545303994043249263895825417197979312263873458290625951595165648634453837959641616221499853309829737663096055610272863216947901196216467463121276681626666630641061058671702351757348054165492211737848899078287026481329186785666349501358041565106233731785681339
)
dsa = DSA(dsa_p,dsa_q)
dsa = DSA(dsa_p, dsa_q)
dsa_keys = dsa.generate_keys(self.keylength)
hash_y = SHA256(str(y_2).encode("utf-8"))
dsa_a = dsa.generate_random()
......@@ -560,7 +565,7 @@ class FZK_PR3:
dsa_q = integer(
78026701315845642650478533423290697952946810503781545303994043249263895825417197979312263873458290625951595165648634453837959641616221499853309829737663096055610272863216947901196216467463121276681626666630641061058671702351757348054165492211737848899078287026481329186785666349501358041565106233731785681339
)
ic_p = integer(
333437049425486136095925931727629203622119239282802038455917646172563395024265917241890473852501318262109839243221497854682815506880304349748481648877420618747530394310060738051284980323398797638078562462943477904211178707988798971266777314022673227003284335883622084916018185539789562312940907090712386355299
)
......@@ -570,8 +575,8 @@ class FZK_PR3:
integer_commitment = IntegerCommitment(ic_p, ic_q, self.keylength)
par_ic = integer_commitment.setup()
dsa = DSA(dsa_p,dsa_q)
dsa = DSA(dsa_p, dsa_q)
dsa_keys = dsa.generate_keys(self.keylength)
c = group.random(ZR)
hash_c = integer(SHA256(bytes(str(c), "utf-8")))
......@@ -626,7 +631,7 @@ class FZK_PR3:
)
self.paillier_encryption = PaillierEncryption(RSAGroup())
(
self.public_key,
self.secret_key,
......@@ -754,7 +759,9 @@ class FZK_PR3:
)
% paillier_n_2
):
print("Abort: (FZK_PR) Paillier ciphertext verification failed.")
print(
"Abort: (FZK_PR) Paillier ciphertext verification failed."
)
exit()
c_t = {
"c": paillier_ciphertext_random_open_v[0]["c"]
......@@ -777,7 +784,9 @@ class FZK_PR3:
)
% paillier_n_2
):
print("Abort: (FZK_PR) Paillier ciphertext verification failed.")
print(
"Abort: (FZK_PR) Paillier ciphertext verification failed."
)
exit()
ppe = ppe * pair(g, gt) ** random_v
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
def dict_from_class(cls):
excluded_keys = ["__dict__", "__doc__", "__module__", "__weakref__"]
return dict(
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
import sys
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
from __future__ import print_function
import hashlib
import multiprocessing
......@@ -216,7 +221,7 @@ class IntegerCommitment:
def __init__(self, p, q, keylength):
self.keylength = keylength
if p == 0 or q == 0:
#(p, q, n) = rsa_group.paramgen(self.keylength)
# (p, q, n) = rsa_group.paramgen(self.keylength)
self.group = IntegerGroup()
self.group.paramgen(keylength)
p = self.group.p
......
# Copyright © 2021 by University of Luxembourg.
# Developed at SnT APSIA by:
# Aditya Damodaran, aditya.damodaran@uni.lu
# Alfredo Rial, alfredo.rial@uni.lu
import json
from charm.core.engine.util import objectToBytes, bytesToObject
from charm.toolbox.pairinggroup import PairingGroup, pair, ZR
......@@ -48,7 +53,7 @@ class SigmaProtocol:
public_key["Z"],
public_key["U"][1],
)
self.keylength = keylength
self.one = 1
......@@ -74,9 +79,8 @@ class SigmaProtocol:
dsa_q = integer(
78026701315845642650478533423290697952946810503781545303994043249263895825417197979312263873458290625951595165648634453837959641616221499853309829737663096055610272863216947901196216467463121276681626666630641061058671702351757348054165492211737848899078287026481329186785666349501358041565106233731785681339
)
self.dsa = DSA(dsa_p,dsa_q)
self.dsa = DSA(dsa_p, dsa_q)
self.dsa_keys = self.dsa.generate_keys(keylength)
rsa_group = RSAGroup()
......@@ -91,9 +95,8 @@ class SigmaProtocol:
ic_q = integer(
294092988306368388636535355362351220952777074915662080329740789451817968606482246364359892865057621298389179478994706465098262699509935804409002480293234947971872131356003427444279672200378079370695651721652248116723483318427208508192689675310517884904089979454005634358395042846262967137935407297336359215239
)
self.integer_commitment = IntegerCommitment(ic_p,ic_q, self.keylength)
self.integer_commitment = IntegerCommitment(ic_p, ic_q, self.keylength)
self.par_ic = self.integer_commitment.setup()
......@@ -455,7 +458,7 @@ class SigmaProtocol:
rdi_3 + (hash_c * di_3),
rdi_4 + (hash_c * di_4),
rdi_5 + (hash_c * di_5),
)
)
s_o_j.append_subwitnesses(temp_s_j_i)
return s_j, hashes_j, hash_c
......@@ -572,7 +575,9 @@ class SigmaProtocol:
)
)
):
print("Abort: (Sigma Protocol) Paillier ciphertext verification failed.")
print(
"Abort: (Sigma Protocol) Paillier ciphertext verification failed."
)
exit()
for subwitness in witness_paillier_ciphertexts["wit_i"]:
if (
......@@ -617,7 +622,9 @@ class SigmaProtocol:
)
)
):
print("Abort: (Sigma Protocol) Paillier ciphertext verification failed.")
print(
"Abort: (Sigma Protocol) Paillier ciphertext verification failed."
)
exit()
if (
not (
......@@ -671,7 +678,9 @@ class SigmaProtocol:
)
)
):
print("Abort: (Sigma Protocol) Paillier ciphertext verification failed.")
print(
"Abort: (Sigma Protocol) Paillier ciphertext verification failed."
)
exit()
return 1
......@@ -936,7 +945,9 @@ class SigmaProtocol:
)
)
):
print("Abort: (Sigma Protocol) Integer commitment check failed.")
print(
"Abort: (Sigma Protocol) Integer commitment check failed."
)
exit()
return 1
......
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