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 / seed / qualification / om2 / evidence / phaseB / sha-f5d14cb2 / binding.txt

123 lines · 5522 bytes Raw Blame History
1$ OMEGA_NATIVE_OMC=/home/drakestapleton/workspace/om2-qualification/seed/out/omc OMEGA_NATIVE_OMC2=/tmp/zl/omc-f6a6492f sh /tmp/zl/qbridge/tools/native bind /tmp/zl/qsha/om/sha256/sha256-om2.om
2tools/native: 1 unit(s) -> /home/drakestapleton/workspace/om2-qualification/build/om2-qual/sha/run/bind/libomega_native.so + omega_native.{c,h,py,rs,zig,go} + omega_api.h (+ work/)
3exit 0
4generator native-gen (src/native.om compiled by the pinned OM-1 omc) sha256 9f8c1dab997d898c60f3a2343a293b9b1c33f11e0540003af98f8e40d7b51019
5sha256 799c311728b3864559e8623c2cc142426cc1de3a739fa972a6ea98c710d09ae3 omega_native.c
6sha256 41dc08774f95aaa163457708a7f8dcdaefac00529ee8ec4b607c51186e4d192b omega_native.h
7sha256 79c7de9c925cd2c4e238028c1b9e46ed44dd6d6093c53ebaa246ab7c29ec4824 omega_api.h
8sha256 6ef2aecc4942992b389ce8bd6fb8ef58662e8aaaff41ad492b5040654e285096 omega_native.py
9sha256 c1ea32611dfc440e070ca83a54b1d532d20fca3961aed7e04fd4b20ff8e9c112 omega_native.rs
10sha256 7656e81ea772f33bc08b0ad16f1e507af712a0555c1ccdc9fe557b9ccb80ec6d omega_native.zig
11sha256 dbce920855698bfb3fe063becf23262e8150eb8accd5ba73674fcb7dc7425eb8 omega_native.go
12sha256 791db81522736682442c0198bd9a59da22b0671609d0c53913834d8534bb5bad libomega_native.so
13sha256 e4f6a8d80a5f3dc7e8c535b86a2d2d34227e634e3fcc4aac8bf1835336c4c1ae work/ident.txt
14sha256 27775fb2106dc0695d32417b1545af0027c136fe05bcdc4abd12cb473460570b work/sha256-om2.bin
15work/sha256-om2.bin == S4 artifact: yes
16embedded code (ombr2_code_sha256_om2, file offset 5672) == compiler bytes: yes
17--- defined dynamic symbols
18omega2_ident_sha256_om2
19omega2_sha256_final
20omega2_sha256_hash
21omega2_sha256_init
22omega2_sha256_update
23--- v1 symbols (omega_*): 0
24--- v1 caller link (must fail):
25/usr/bin/ld: /tmp/ccCc94Mi.o: in function `main':
26v1use.c:(.text+0x28): undefined reference to `omega_sha256_init'
27collect2: error: ld returned 1 exit status
28link exit 1
29--- omega_api.h
30/* Generated by omega-bridge src/native.om: the C API of the ABI v2 units in libomega_native
31 * (docs/NATIVE-ABI.md, ABI v2). Each function calls omega2_<name> and calls abort() on a nonzero status.
32 * Regenerate it; do not edit it. */
33#ifndef OMEGA_API_H
34#define OMEGA_API_H
35#include <stddef.h>
36#include <stdint.h>
37#include <stdlib.h>
38#include "omega_native.h"
39#ifdef __cplusplus
40#define OMBR_ASSERT static_assert
41extern "C" {
42#else
43#define OMBR_ASSERT _Static_assert
44#endif
45#define SHA256_DIGEST_SIZE 32
46#define SHA256_BLOCK_SIZE 64
47typedef struct {
48 uint32_t state[8];
49 uint64_t count;
50 uint8_t buf[64];
51} sha256_ctx;
52OMBR_ASSERT(sizeof(sha256_ctx) == 104, "layout shactx size");
53OMBR_ASSERT(offsetof(sha256_ctx, state) == 0, "layout shactx field state");
54OMBR_ASSERT(offsetof(sha256_ctx, count) == 32, "layout shactx field count");
55OMBR_ASSERT(offsetof(sha256_ctx, buf) == 40, "layout shactx field buf");
56/* export fn sha256_init c edit shactx to void */
57static inline void sha256_init(sha256_ctx *o_c)
58{
59 uint64_t r = 0;
60 if (omega2_sha256_init(&r, (uint8_t *)o_c) != OMEGA_OK)
61 abort();
62 (void)r;
63}
64/* export fn sha256_update c edit shactx d view uchar * to void */
65static inline void sha256_update(sha256_ctx *o_c, const uint8_t *o_d, size_t o_d_len)
66{
67 uint64_t r = 0;
68 if (omega2_sha256_update(&r, (uint8_t *)o_c, o_d, o_d_len) != OMEGA_OK)
69 abort();
70 (void)r;
71}
72/* export fn sha256_final c edit shactx o out uchar 32 to void */
73static inline void sha256_final(sha256_ctx *o_c, uint8_t o_o[32])
74{
75 uint64_t r = 0;
76 if (omega2_sha256_final(&r, (uint8_t *)o_c, o_o) != OMEGA_OK)
77 abort();
78 (void)r;
79}
80/* export fn sha256_hash d view uchar * o out uchar 32 to void */
81static inline void sha256_hash(const uint8_t *o_d, size_t o_d_len, uint8_t o_o[32])
82{
83 uint64_t r = 0;
84 if (omega2_sha256_hash(&r, o_d, o_d_len, o_o) != OMEGA_OK)
85 abort();
86 (void)r;
87}
88#ifdef __cplusplus
89}
90#endif
91#endif
92--- omega_native.h
93/* Generated by omega-bridge src/native.om: native call ABI v1 (docs/NATIVE-ABI.md).
94 * C and C++ declarations for libomega_native. Regenerate it; do not edit it.
95 * Status: 0 done; 1..14 the Omega trap code; 32 argument refused (null, wrong length, misaligned,
96 * overlap); 33 reentry; 34 bad runtime entry; 35 no stack. The result is written only on status 0.
97 * A long is its two's-complement bits; an array is its address then its element count.
98 * Parameter names carry o_ so no language's reserved words collide. */
99#ifndef OMEGA_NATIVE_H
100#define OMEGA_NATIVE_H
101#include <stdint.h>
102#ifdef __cplusplus
103extern "C" {
104#endif
105#define OMEGA_OK 0u
106#define OMEGA_BAD_ARG 32u
107#define OMEGA_REENTRY 33u
108#define OMEGA_BAD_RT 34u
109#define OMEGA_NO_STACK 35u
110#define OMEGA2_IDENT_sha256_om2 "omega-ident 1 unit=sha256_om2 abi=2 profile=OM-2 src=dbf002dd6aa36585632b9d01d98ac3f0bd2fa0f0475082940de53638847994bb omc=499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec"
111const char *omega2_ident_sha256_om2(void);
112/* export fn sha256_init c edit shactx to void */
113uint32_t omega2_sha256_init(uint64_t *result, uint8_t *o_c);
114/* export fn sha256_update c edit shactx d view uchar * to void */
115uint32_t omega2_sha256_update(uint64_t *result, uint8_t *o_c, const uint8_t *o_d, uint64_t o_d_len);
116/* export fn sha256_final c edit shactx o out uchar 32 to void */
117uint32_t omega2_sha256_final(uint64_t *result, uint8_t *o_c, uint8_t *o_o);
118/* export fn sha256_hash d view uchar * o out uchar 32 to void */
119uint32_t omega2_sha256_hash(uint64_t *result, const uint8_t *o_d, uint64_t o_d_len, uint8_t *o_o);
120#ifdef __cplusplus
121}
122#endif
123#endif