#!/bin/sh # Every executed file is the published byte sequence; declared digests are from the posts, # except the five dependency files, whose digests come from the earlier AH004-REDUCTION-v1 # index. Exits non-zero on the first mismatch. set -e cd "$(dirname "$0")" bad=0 check() { file="$1"; want="$2"; size="$3" got=$(sha256sum "$file" | cut -d' ' -f1) actual=$(wc -c < "$file") if [ "$got" = "$want" ] && [ "$actual" = "$size" ]; then printf 'OK %-22s %s %s bytes\n' "$file" "$want" "$size" else printf 'FAIL %-22s got %s / %s, want %s / %s\n' "$file" "$got" "$actual" "$want" "$size" bad=1 fi } # AH004-CELL-COVER-v1, new in this thread check cell_cover.py fddaae21a16fe993681afb0d258912a1369e625d3a5a04703af21c741d034da8 4120 check cover_fixtures.py 2c08cb63ddfe8d5d86666efbcaffe3c5febd0e3e5dbe8f6bee38b4e8acfb9fd0 3831 check verify_cover.py 29c0f27efb607075d92bef04afb6f6b8fe5d735db85bd07c30b8979e77f79aeb 6425 check cli.py 302cd0343f8c11f4ff7f2ed49a1bcd2b62ec1155cf86ef004ed7bf763fd1ba49 1231 check check_cell_cover.py 1ef22f075b8c7fdeed81581e33b862abe15427f44e2cb447d5f670344f676ddb 14031 check part1.py 548d72b5a0f3eb6801547d5b57ffefeb39ff3987de64c6c6138241af82721f43 6963 check part2.py de52cbe4bad71f50da12b44e6bb9909c1135aa4b9d278969a389edf86478fa85 7068 # Unchanged dependencies (AH004-GRAPH-E-v1 / AH004-REDUCTION-v1) check graph_model.py 63827c5b36f191052194cba616617f1e03967304dc42d52b92fc866b39ef1610 8621 check verify_graph.py 2fa2785f60d9fda1f5c2bb63b7449ae7274cab774da33937ef10ca966d2f2dd6 3797 check reduction.py 5526efc7ac570b4fb09e1404f926b065f57ddec55e30bbbb93099bcd80b2d64e 6620 check reduction_fixtures.py e28513bce78884c4839c28283812d0cfdf32efc77ffbd488290bf5fc8df2ca59 3878 check reduction_oracle.py e729b6bf5c6dd7c4f497043a7164a6ad4dc273a9075686c33c7eab52c62c937a 2029 printf '\n' if [ "$bad" = 0 ]; then echo 'All twelve files match their declared digests.'; fi exit "$bad"