aboutsummaryrefslogtreecommitdiffstats
path: root/poc/spike5_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'poc/spike5_client.py')
-rw-r--r--poc/spike5_client.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/poc/spike5_client.py b/poc/spike5_client.py
index 11b3ac0..cc79ebf 100644
--- a/poc/spike5_client.py
+++ b/poc/spike5_client.py
@@ -12,16 +12,23 @@ Acts as the "file requester":
- Reports timing and results
"""
-import asyncio, json, base64, struct, time, sys
+import asyncio
+import base64
+import json
+import struct
+import sys
+import time
+
+import blake3
+from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
-from cryptography.hazmat.primitives import hashes
-import blake3
PORT = 19003
CHUNK_INDEX = 0
-PASS = "✓"; FAIL = "✗"
+PASS = "✓"
+FAIL = "✗"
# ── Wire helpers ───────────────────────────────────────────────────────────────
@@ -115,7 +122,7 @@ async def handle_node(reader, writer):
total_ms = recv_ms + verify_ms
print(f"\n {'='*50}")
- print(f" Timings:")
+ print(" Timings:")
print(f" Network receive : {recv_ms:.0f} ms")
print(f" Verify+decrypt : {verify_ms:.1f} ms")
print(f" Total : {total_ms:.0f} ms")
@@ -133,7 +140,7 @@ async def main():
async with server:
try:
await asyncio.wait_for(server.serve_forever(), timeout=30)
- except asyncio.TimeoutError:
+ except TimeoutError:
print(f" {FAIL} Timeout — node did not connect within 30s")
sys.exit(1)