
================================================================================
MASTERCHAIN CRYPTOGRAPHIC PERFORMANCE TEST SUITE
Academic Paper Validation - ECDSA vs RSA Comparison
================================================================================

This test suite validates claims from Tables 1 and 2 of the academic paper.
All tests use PURE implementations without extra code for fair comparison.


================================================================================
TEST 1: Signature Size Comparison (Table 1)
================================================================================

Algorithm            Key Size (bits)      Signature Size (bytes)    Reduction
------------------------------------------------------------------------------------------
RSA-2048             2048                 256                       Baseline
ECDSA secp256k1      256                  71                        72.3%

Claim Validation:
  Paper claims ECDSA: 64 bytes → Actual: 71 bytes (✗ FAIL)
  Paper claims RSA-2048: 256 bytes → Actual: 256 bytes (✓ PASS)
  Paper claims 75% reduction → Actual: 72.3% (✗ FAIL)

================================================================================
TEST 2: Signing Performance Comparison (Table 2)
================================================================================

Operation       ECDSA (ms)      RSA-2048 (ms)   Performance Ratio
----------------------------------------------------------------------
Sign            0.053           3.134           59.5x faster

Detailed Statistics:
  ECDSA Signing:
    Mean: 0.053 ms
    Median: 0.044 ms
    Std Dev: 0.034 ms
    Min: 0.043 ms, Max: 0.422 ms

  RSA-2048 Signing:
    Mean: 3.134 ms
    Median: 2.944 ms
    Std Dev: 0.942 ms
    Min: 1.951 ms, Max: 10.295 ms

Claim Validation:
  Paper claims ECDSA: 0.094ms → Actual: 0.053ms (✓ PASS)
  Paper claims RSA: 1.78ms → Actual: 3.134ms (⚠ VARIANCE)
  Paper claims 18.9x faster → Actual: 59.5x (⚠ VARIANCE)

================================================================================
TEST 3: Verification Performance Comparison (Table 2)
================================================================================

Operation       ECDSA (ms)      RSA-2048 (ms)   Performance Ratio
----------------------------------------------------------------------
Verify          0.088           0.923           0.10x (slower)

Detailed Statistics:
  ECDSA Verification:
    Mean: 0.088 ms
    Median: 0.051 ms
    Std Dev: 0.684 ms
    Min: 0.049 ms, Max: 21.653 ms

  RSA-2048 Verification:
    Mean: 0.923 ms
    Median: 0.835 ms
    Std Dev: 0.451 ms
    Min: 0.534 ms, Max: 5.814 ms

Claim Validation:
  Paper claims ECDSA: 0.092ms → Actual: 0.088ms (✓ PASS)
  Paper claims RSA: 0.066ms → Actual: 0.923ms (⚠ VARIANCE)
  Verification: RSA is 10.43x faster than ECDSA (✗ UNEXPECTED)

================================================================================
TEST 4: Combined Operation Performance (Table 2)
================================================================================

Operation                 ECDSA (ms)      RSA-2048 (ms)   Performance Ratio
--------------------------------------------------------------------------------
Combined (1 sign + 1 verify) 0.169           3.806           22.54x better

Claim Validation:
  Paper claims ECDSA: 0.186ms → Actual: 0.169ms (✓ PASS)
  Paper claims RSA: 1.846ms → Actual: 3.806ms (⚠ VARIANCE)
  Paper claims 9.92x better → Actual: 22.54x (⚠ VARIANCE)

================================================================================
TEST 5: Bandwidth Impact Analysis
================================================================================

Bandwidth Impact Analysis for {tx_count:,} transactions:
------------------------------------------------------------
  ECDSA: 66.76 MB signature data
  RSA-2048: 244.14 MB signature data
  Savings: 177.38 MB (72.7% reduction)

Network-wide impact (across {node_count:,} nodes):
------------------------------------------------------------
  ECDSA: 651.93 GB total network traffic
  RSA-2048: 2384.19 GB total network traffic
  Network bandwidth savings: 1.69 TB

Claim Validation:
  Paper claims ECDSA: 64 MB → Actual: 66.76 MB (✓ PASS)
  Paper claims RSA: 256 MB → Actual: 244.14 MB (⚠ VARIANCE)
  Paper claims savings: 192 MB → Actual: 177.38 MB (⚠ VARIANCE)
  Paper claims network savings: 1.92 TB → Actual: 1.69 TB (⚠ VARIANCE)

================================================================================
SUMMARY OF RESULTS
================================================================================

1. Signature Size:
   ECDSA: 71 bytes
   RSA-2048: 256 bytes
   Reduction: 72.3%

2. Signing Performance:
   ECDSA: 0.053 ms
   RSA-2048: 3.134 ms
   ECDSA is 59.5x faster

3. Verification Performance:
   ECDSA: 0.088 ms
   RSA-2048: 0.923 ms
   RSA is 10.43x faster

4. Combined Performance (1 sign + 1 verify):
   ECDSA: 0.169 ms
   RSA-2048: 3.806 ms
   ECDSA is 22.54x better overall

5. Bandwidth Impact (1M transactions):
   ECDSA: 66.76 MB
   RSA-2048: 244.14 MB
   Savings: 177.38 MB
   Network savings (10K nodes): 1.69 TB

================================================================================
TEST SUITE COMPLETED SUCCESSFULLY
================================================================================

