mailhand
mailhand: agents look after a person's email in seeded Omega. Maildir + MIME parsing, JSONL CLI and MCP, rule triage, policy-gated sending, hash-chained audit. Free (Apache-2.0).
Brought by drakestapleton
| 1 | note ======== src/sha.om: SHA-256 of store ranges (vendored FIPS 180-4 unit from omega-mv) ======== |
| 2 | note sha_s: SHA-256 of store s, range [off, off+n), into o |
| 3 | fn sha_s s ulong off ulong n ulong o edit uchar 32 to void |
| 4 | c = new uchar 104 0 |
| 5 | b = new uchar 65536 0 |
| 6 | d = new uchar 32 0 |
| 7 | sha256_init c |
| 8 | p = off |
| 9 | e = add off n |
| 10 | while lt p e bound 9223372036854775807 |
| 11 | m = sub e p |
| 12 | if gt m 65536 |
| 13 | m = 65536 |
| 14 | end |
| 15 | k = s_read s p part b 0 m |
| 16 | if eq k 0 |
| 17 | break |
| 18 | end |
| 19 | sha256_update c part b 0 k |
| 20 | p = add p k |
| 21 | end |
| 22 | sha256_final c d |
| 23 | for i ulong 32 |
| 24 | put o i get d i |
| 25 | end |
| 26 | end |
| 27 | |
| 28 | note sha_v: SHA-256 of a view into o |
| 29 | fn sha_v t view uchar * o edit uchar 32 to void |
| 30 | d = new uchar 32 0 |
| 31 | sha256_hash t d |
| 32 | for i ulong 32 |
| 33 | put o i get d i |
| 34 | end |
| 35 | end |