Signature aggregation cost at top committees

This commit is contained in:
mjalalzai 2023-08-28 13:35:50 -07:00
parent 95f2931d54
commit 72d02e3cc3
1 changed files with 17 additions and 0 deletions

View File

@ -18,3 +18,20 @@ def verify_signatures(committee_size, depth):
elapsed_time = end_time - start_time elapsed_time = end_time - start_time
return elapsed_time return elapsed_time
def aggregate_signatures(committee_size, root_members):
# Simulate aggregating 3 * committee_size signatures
start_time = time.time()
# Generate multiple EdDSA key pairs for signature aggregation
private_keys = [ed25519.create_keypair() for _ in range(root_members * committee_size)]
# Simulate signature aggregation
shared_message = b"Shared message to be signed"
signatures = [private_key[0].sign(shared_message) for private_key in private_keys]
# Aggregation isn't straightforward for EdDSA; we'll skip it in this example
end_time = time.time()
elapsed_time = end_time - start_time
return elapsed_time