mirror of
https://github.com/saymrwulf/proof-aware-crypto-tooling-agent.git
synced 2026-09-03 19:53:43 +00:00
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
|
|
from pacta.risk import score_claim_card
|
||
|
|
|
||
|
|
|
||
|
|
def test_ed25519_field_and_edwards_clean_scores_r3():
|
||
|
|
card = {
|
||
|
|
"kind": "ed25519",
|
||
|
|
"certificates": [
|
||
|
|
{"name": "CurveFieldProofs.fieldImplementation", "status": "proven", "axiom_status": "clean"},
|
||
|
|
{"name": "CurveFieldProofs.edwardsImplementation", "status": "proven", "axiom_status": "clean"},
|
||
|
|
],
|
||
|
|
"exclusions": ["full EdDSA verification"],
|
||
|
|
"risk": {"deployment_constraints": ["Use verified serial/u64 backend only."]},
|
||
|
|
}
|
||
|
|
result = score_claim_card(card)
|
||
|
|
assert result.level == "R3"
|
||
|
|
assert "lower-layer" in result.rationale
|
||
|
|
|
||
|
|
|
||
|
|
def test_no_certificates_is_r0_for_unknown():
|
||
|
|
result = score_claim_card({"kind": "unknown", "certificates": []})
|
||
|
|
assert result.level == "R0"
|
||
|
|
assert result.blockers
|
||
|
|
|
||
|
|
|
||
|
|
def test_dirty_axioms_do_not_score_r3():
|
||
|
|
card = {
|
||
|
|
"kind": "ed25519",
|
||
|
|
"certificates": [
|
||
|
|
{"name": "CurveFieldProofs.fieldImplementation", "status": "proven", "axiom_status": "dirty"},
|
||
|
|
],
|
||
|
|
}
|
||
|
|
result = score_claim_card(card)
|
||
|
|
assert result.level == "R2"
|
||
|
|
assert any("Unexpected axioms" in blocker for blocker in result.blockers)
|
||
|
|
|
||
|
|
|
||
|
|
def test_pasta_without_aggregate_is_foundation_r2():
|
||
|
|
result = score_claim_card({"kind": "pasta_pallas", "certificates": []})
|
||
|
|
assert result.level == "R2"
|