-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
small updates to BBS benchmark scripts
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set title "Hamming distance between unlinkable proofs" | ||
set style fill transparent solid 0.25 border | ||
# set style fill pattern | ||
set terminal TERM | ||
set xlabel "hamming distance in bits" | ||
set ylabel "frequency" | ||
plot for[col=1:2] 'entropy.txt' using 1:col title columnheader smooth frequency with fillsteps linetype col |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
print 'BBS+ entropy benchmarks' | ||
print '' | ||
|
||
TOTAL = 10 | ||
B3 = BBS.ciphersuite'shake256' | ||
|
||
local kp = keygen(B3) | ||
|
||
|
||
|
||
local msg = { OCTET.random(512) } | ||
local idx = { 1 } | ||
|
||
local signed = sign(B3, kp, msg) | ||
|
||
print "Proof \t Rand" | ||
|
||
local prev = create_proof(B3, kp.pk, signed, msg, idx) | ||
local rlen = #prev | ||
for i=1,TOTAL do | ||
local proof = create_proof(B3, kp.pk, signed, msg, idx) | ||
local ham = O.hamming(proof, prev) | ||
local rand = O.hamming(O.random(rlen), O.random(rlen)) | ||
print(ham.." \t "..rand) | ||
prev = proof | ||
end | ||
|
||
|
||
print ("shannon "..prev:entropy()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
print 'BBS+ size benchmarks' | ||
print '' | ||
|
||
B3 = BBS.ciphersuite'shake256' | ||
local T, start | ||
start = os.clock() | ||
local kp = keygen(B3) | ||
print('TIME: '..os.clock()-start) | ||
I.print(kp) | ||
print'' | ||
|
||
|
||
local m = { OCTET.random(512) } | ||
local i = { 1 } | ||
|
||
start = os.clock() | ||
local signed = sign(B3, kp, m) | ||
print('TIME: '..os.clock()-start) | ||
I.print({signature=signed}) | ||
print'' | ||
|
||
start = os.clock() | ||
local proof = create_proof(B3, kp.pk, signed, m, i) | ||
print('TIME: '..os.clock()-start) | ||
I.print({proof=proof}) | ||
print'' | ||
|
||
print'verification' | ||
disclosed = disclosed_messages(m, i) | ||
start = os.clock() | ||
assert( verify_proof(B3, kp.pk, proof, disclosed, i) ) | ||
print('TIME: '..os.clock()-start) |