interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / evidence / SEED-0 / rung5-worksheet.sh

23 lines · 1696 bytes Raw Blame History
1#!/bin/sh
2# rung5-worksheet.sh -- the arithmetic behind the data lines of seed/atlas/atlas.s2. A calculator only.
3# 1. each message as .b lines (one byte per line, NUL at the end), from the .asciz text in atlas.s;
4# 2. the 64 SHA-256 round constants K from sha256_clean.s (written there as signed decimal .word)
5# as 32-bit hex .w lines;
6# 3. the 64-bit literals of atlas.s's "ldr Xn, =value" as two .w halves (low first).
7str() { printf '; "%s\\n"\n' "$1"; printf '%s\n' "$1" | od -An -tx1 -v | tr ' ' '\n' | grep . | sed 's/^/ .b 0x/'; echo ' .b 0'; }
8str 'ATLAS: AWAKEN'; str 'ATLAS: VERIFY'; str 'ATLAS: HANDOFF'; str 'ATLAS: REFUSE'
9echo '; K'
10for v in 1116352408 1899447441 -1245643825 -373957723 961987163 1508970993 -1841331548 -1424204075 \
11 -670586216 310598401 607225278 1426881987 1925078388 -2132889090 -1680079193 -1046744716 \
12 -459576895 -272742522 264347078 604807628 770255983 1249150122 1555081692 1996064986 \
13 -1740746414 -1473132947 -1341970488 -1084653625 -958395405 -710438585 113926993 338241895 \
14 666307205 773529912 1294757372 1396182291 1695183700 1986661051 -2117940946 -1838011259 \
15 -1564481375 -1474664885 -1035236496 -949202525 -778901479 -694614492 -200395387 275423344 \
16 430227734 506948616 659060556 883997877 958139571 1322822218 1537002063 1747873779 \
17 1955562222 2024104815 -2067236844 -1933114872 -1866530822 -1538233109 -1090935817 -965641998; do
18 printf ' .w 0x%08x\n' $(( v & 0xffffffff ))
19done
20echo '; literals'
21for v in 0x401FC000 0x09000000 0x401FE000 0x40000000 0x08000000 0x40200000 0x401FE100 0x401FE080 0x5048595349435330; do
22 printf ' .w 0x%08x\n .w 0x%08x ; %s\n' $(( v & 0xffffffff )) $(( (v >> 32) & 0xffffffff )) $v
23done