From 35d2e3956e4bd5b2e3ded860d05293cba405d5cf Mon Sep 17 00:00:00 2001 From: mjalalzai <33738574+MForensic@users.noreply.github.com> Date: Mon, 28 Aug 2023 11:01:55 -0700 Subject: [PATCH] Sig verification cost for each committee size and depth of the overlay --- scripts/authenticator_cost.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/authenticator_cost.py diff --git a/scripts/authenticator_cost.py b/scripts/authenticator_cost.py new file mode 100644 index 0000000..81edb2f --- /dev/null +++ b/scripts/authenticator_cost.py @@ -0,0 +1,20 @@ +import time +import ecdsa + +def verify_signatures(committee_size, depth): + # Simulate verifying depth * committee_size signatures + start_time = time.time() + + # ECDSA key generation + private_key = ecdsa.SigningKey.generate() + public_key = private_key.get_verifying_key() + + # Simulate depth * committee_size signature verifications + for _ in range(depth * committee_size): + message = b"Message to be signed" + signature = private_key.sign(message) + public_key.verify(signature, message) + + end_time = time.time() + elapsed_time = end_time - start_time + return elapsed_time