New `aliro-bench-profile` entry point drives the applet's INS_DIAG_* commands over PC/SC at two iteration counts (N=4 / N=16 by default) and computes per-op cost as the slope, factoring out APDU round-trip + any one-time Signature.init setup. Reports HMAC, ECDH, ECDSA sign, and AES-GCM 137B costs side by side, then reconstructs an AUTH1 budget using the per-primitive counts from the applet's processAuth1 flow so we can compare the reconstructed estimate against bench-test wall-clock and see how much of AUTH1 is crypto vs TLV parsing / I/O. Also extends `aliro-bench-test` to time SELECT / AUTH0 / AUTH1 / total via time.perf_counter() bracketing each transmit() call. The TransactionResult now carries a latencies_ms dict, threaded through all return sites so both success and failure paths print the new "APDU latencies (ms):" block. Made the 1.78x AUTH1 wall-clock speedup from the 4-bit GHASH commit quantifiable on real hardware (5,795 -> 3,244 ms). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
44 lines
965 B
TOML
44 lines
965 B
TOML
[project]
|
|
name = "aliro-harness"
|
|
version = "0.1.0"
|
|
description = "PC-side test harness for the Aliro Java Card applet: test CA, personalizer, reader log capture"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"cryptography>=42.0",
|
|
"cbor2>=5.6",
|
|
"pyscard>=2.0",
|
|
"pyserial>=3.5",
|
|
"click>=8.1",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"pytest-cov>=5.0",
|
|
"ruff>=0.4",
|
|
]
|
|
|
|
[project.scripts]
|
|
aliro-trustgen = "aliro_harness.trustgen.cli:main"
|
|
aliro-personalize = "aliro_harness.personalizer.cli:main"
|
|
aliro-bench-test = "aliro_harness.reader.cli:main"
|
|
aliro-bench-profile = "aliro_harness.profile.cli:main"
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-ra --strict-markers"
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "B", "UP", "SIM"]
|