Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/qualification/om2/oracle/sha/final_unchanged.c # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / qualification / om2 / oracle / sha / final_unchanged.c` 10 lines ยท 816 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 2 * ORACLE (outside the delivered closure), L836 phaseB/sha-`f5d14cb2`. Informational check of the unit's own 3 * comment (not a contract requirement, section 7 promises less): final leaves the context unchanged. 4 * Build: gcc -std=gnu11 -O2 -I final_unchanged.c -L -lomega_native -Wl,-rpath, */ 5 #include 6 #include 7 #include "omega_api.h" 8 int main(void){ sha256_ctx c, c0; uint8_t d1[32], d2[32]; uint8_t m[300]; for (int i=0;i<300;i++) m[i]=i*7; 9 int bad=0; for (int n=0;n<300;n++){ sha256_init(&c); sha256_update(&c,m,n); memcpy(&c0,&c,sizeof c); sha256_final(&c,d1); bad |= memcmp(&c,&c0,sizeof c)!=0; sha256_final(&c,d2); bad |= memcmp(d1,d2,32)!=0; } 10 printf("final-leaves-context-unchanged n=0..299: %s\n", bad?"NO":"yes"); return bad; }