Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/isa.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ also rejects stale committed output without modifying it.
It additionally authenticates the complete authority bytes against the
immutable LinxISA v0.58.6 authority at `ed3f7a9d9715e6209d7b551aa51865decf59e9e6`:
compiled catalog
`47d7d23e210e8205fa385473136c44613bb52e8de135e77602163147f91eaf91`, PTO
`47d7d23e210e8205fa385473136c44613bb52e8de135e77602163147f91eaf91`
or the DIM-default transition hash
`e960bf0bc8addc6574a18918c9d16c1e39a60171e865b403e19e869e0e11b2fa`, PTO
lock `77e792fb0add49a2cf4a0dcc6853a715d6b1c98490f48649b85f923579ba36be`,
and release manifest
`86ad5d2dee02131bf9865ba029d8043112174f94798a5dcdb7e8f8d081415a11`.
Expand Down
14 changes: 12 additions & 2 deletions tools/isa/gen_minst_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
"pieces": 3399,
"constraints": 1067,
}
EXPECTED_CATALOG_CONTENT_SHA256 = "47d7d23e210e8205fa385473136c44613bb52e8de135e77602163147f91eaf91"
EXPECTED_CATALOG_CONTENT_SHA256 = frozenset(
{
"47d7d23e210e8205fa385473136c44613bb52e8de135e77602163147f91eaf91",
"e960bf0bc8addc6574a18918c9d16c1e39a60171e865b403e19e869e0e11b2fa",
}
)
EXPECTED_LOCK_CONTENT_SHA256 = "77e792fb0add49a2cf4a0dcc6853a715d6b1c98490f48649b85f923579ba36be"
EXPECTED_RELEASE_MANIFEST_CONTENT_SHA256 = (
"86ad5d2dee02131bf9865ba029d8043112174f94798a5dcdb7e8f8d081415a11"
Expand Down Expand Up @@ -334,7 +339,12 @@ def load_and_validate_authority(
}
for label, expected in expected_hashes.items():
actual = _sha256_bytes(raw[label])
if actual != expected:
valid_hash = (
actual in expected
if isinstance(expected, frozenset)
else actual == expected
)
if not valid_hash:
message = "catalog content hash mismatch" if label == "catalog" else f"{label} content hash mismatch"
raise ValueError(f"{message}: expected {expected}, got {actual}")
spec = json.loads(raw["catalog"])
Expand Down
Loading