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/om/sha256/om2-evidence/s4/omega_api.h.generated # 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 / om / sha256 / om2-evidence / s4 / omega_api.h.generated` 62 lines ยท 1967 bytes Raw Blame History 1 /* Generated by omega-bridge src/native.om: the C API of the ABI v2 units in libomega_native 2 * (docs/NATIVE-ABI.md, ABI v2). Each function calls omega2_ and calls abort() on a nonzero status. 3 * Regenerate it; do not edit it. */ 4 #ifndef OMEGA_API_H 5 #define OMEGA_API_H 6 #include 7 #include 8 #include 9 #include "omega_native.h" 10 #ifdef __cplusplus 11 #define OMBR_ASSERT static_assert 12 extern "C" { 13 #else 14 #define OMBR_ASSERT _Static_assert 15 #endif 16 #define SHA256_DIGEST_SIZE 32 17 #define SHA256_BLOCK_SIZE 64 18 typedef struct { 19 uint32_t state[8]; 20 uint64_t count; 21 uint8_t buf[64]; 22 } sha256_ctx; 23 OMBR_ASSERT(sizeof(sha256_ctx) == 104, "layout shactx size"); 24 OMBR_ASSERT(offsetof(sha256_ctx, state) == 0, "layout shactx field state"); 25 OMBR_ASSERT(offsetof(sha256_ctx, count) == 32, "layout shactx field count"); 26 OMBR_ASSERT(offsetof(sha256_ctx, buf) == 40, "layout shactx field buf"); 27 /* export fn sha256_init c edit shactx to void */ 28 static inline void sha256_init(sha256_ctx *o_c) 29 { 30 uint64_t r = 0; 31 if (omega2_sha256_init(&r, (uint8_t *)o_c) != OMEGA_OK) 32 abort(); 33 (void)r; 34 } 35 /* export fn sha256_update c edit shactx d view uchar * to void */ 36 static inline void sha256_update(sha256_ctx *o_c, const uint8_t *o_d, size_t o_d_len) 37 { 38 uint64_t r = 0; 39 if (omega2_sha256_update(&r, (uint8_t *)o_c, o_d, o_d_len) != OMEGA_OK) 40 abort(); 41 (void)r; 42 } 43 /* export fn sha256_final c edit shactx o out uchar 32 to void */ 44 static inline void sha256_final(sha256_ctx *o_c, uint8_t o_o[32]) 45 { 46 uint64_t r = 0; 47 if (omega2_sha256_final(&r, (uint8_t *)o_c, o_o) != OMEGA_OK) 48 abort(); 49 (void)r; 50 } 51 /* export fn sha256_hash d view uchar * o out uchar 32 to void */ 52 static inline void sha256_hash(const uint8_t *o_d, size_t o_d_len, uint8_t o_o[32]) 53 { 54 uint64_t r = 0; 55 if (omega2_sha256_hash(&r, o_d, o_d_len, o_o) != OMEGA_OK) 56 abort(); 57 (void)r; 58 } 59 #ifdef __cplusplus 60 } 61 #endif 62 #endif