on master help sign in
Cleaned up repo
commit828fc7d17d05422086a487bcca0d515ff852f5a8 authoriko <mail@iko.soy> dateFri 25 Oct 2024, 21:38 (2 years ago) parentfd668c6
11 files changed+46−655
NOTES.md−3 flake.lock+25−151 flake.nix+21−205 libaes_siv/include/config.h−7 nock/flake.lock−112 nock/flake.nix−28 script.js−1 sha256.c−87 softfloat.nix−14 softfloat/patch.diff−13 vere.patch−34
NOTES.mddeleted−3
@@ -1,3 +0,0 @@
1−# Notes
2−
3−
flake.lock+25−151
@@ -2,17 +2,15 @@
22 "nodes": {
33 "fenix": {
44 "inputs": {
5− "nixpkgs": [
6− "nixpkgs"
7− ],
5+ "nixpkgs": "nixpkgs",
86 "rust-analyzer-src": "rust-analyzer-src"
97 },
108 "locked": {
11− "lastModified": 1725863722,
12− "narHash": "sha256-YBcCMVp9RrN2rgqhsMhpu/iw7L8z17N4fp4A129IZ3w=",
9+ "lastModified": 1724221791,
10+ "narHash": "sha256-mKX67QPnUybOopVph/LhOV1G/H4EvPxDIfSmbufrVdA=",
1311 "owner": "nix-community",
1412 "repo": "fenix",
15− "rev": "c30b094741641eef4a7200a5d52a8a16f0f345c6",
13+ "rev": "e88b38a5a3834e039d413a88f8150a75ef6453ef",
1614 "type": "github"
1715 },
1816 "original": {
@@ -34,114 +32,56 @@
3432 "type": "github"
3533 },
3634 "original": {
37− "owner": "numtide",
38− "repo": "flake-utils",
39− "type": "github"
40− }
41− },
42− "libaes_siv": {
43− "flake": false,
44− "locked": {
45− "lastModified": 1602781365,
46− "narHash": "sha256-8X9Nd2H1wM5wIoG3nPp0Kc5f4LyX0mjNPx1fXirwnLw=",
47− "owner": "dfoxfranke",
48− "repo": "libaes_siv",
49− "rev": "9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b",
50− "type": "github"
51− },
52− "original": {
53− "owner": "dfoxfranke",
54− "repo": "libaes_siv",
55− "type": "github"
56− }
57− },
58− "murmur3": {
59− "flake": false,
60− "locked": {
61− "lastModified": 1430543652,
62− "narHash": "sha256-I7a5beN+4lle0CGz911PN56y+bKsJfQ7Kpim+L7PVZg=",
63− "owner": "PeterScott",
64− "repo": "murmur3",
65− "rev": "dae94be0c0f54a399d23ea6cbe54bca5a4e93ce4",
66− "type": "github"
67− },
68− "original": {
69− "owner": "PeterScott",
70− "repo": "murmur3",
71− "type": "github"
35+ "id": "flake-utils",
36+ "type": "indirect"
7237 }
7338 },
7439 "nixpkgs": {
7540 "locked": {
76− "lastModified": 1721835398,
77− "narHash": "sha256-6PQGKQnckb41S16/6rHbW9XibAZpA/7VYaRDI/RjDDo=",
78− "owner": "NixOS",
41+ "lastModified": 1723991338,
42+ "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
43+ "owner": "nixos",
7944 "repo": "nixpkgs",
80− "rev": "4c0bb97b29ea716c4ced5da385e021caaa55c481",
45+ "rev": "8a3354191c0d7144db9756a74755672387b702ba",
8146 "type": "github"
8247 },
8348 "original": {
84− "owner": "NixOS",
85− "ref": "4c0bb97b29ea716c4ced5da385e021caaa55c481",
49+ "owner": "nixos",
50+ "ref": "nixos-unstable",
8651 "repo": "nixpkgs",
8752 "type": "github"
8853 }
8954 },
90− "nockapp": {
91− "flake": false,
55+ "nixpkgs_2": {
9256 "locked": {
93− "lastModified": 1725567177,
94− "narHash": "sha256-2HvzgctPBXBXZEZi9fF3RKST4i6WtKaTx/v1/3t5sVo=",
95− "owner": "zorp-corp",
96− "repo": "nockapp",
97− "rev": "cbe14c452106dd929a0dee013389049888e838df",
98− "type": "github"
99− },
100− "original": {
101− "owner": "zorp-corp",
102− "repo": "nockapp",
103− "type": "github"
104− }
105− },
106− "pdjson": {
107− "flake": false,
108− "locked": {
109− "lastModified": 1708600372,
110− "narHash": "sha256-EjxpYkdepKtc5UAwtsp7BVZKtSlnGveL+DTshhCTUhM=",
111− "owner": "skeeto",
112− "repo": "pdjson",
113− "rev": "78fe04b820dc8817f540bdd87fb22887e0ef3981",
57+ "lastModified": 1723637854,
58+ "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
59+ "owner": "NixOS",
60+ "repo": "nixpkgs",
61+ "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
11462 "type": "github"
11563 },
11664 "original": {
117− "owner": "skeeto",
118− "repo": "pdjson",
119− "type": "github"
65+ "id": "nixpkgs",
66+ "ref": "nixos-unstable",
67+ "type": "indirect"
12068 }
12169 },
12270 "root": {
12371 "inputs": {
12472 "fenix": "fenix",
12573 "flake-utils": "flake-utils",
126− "libaes_siv": "libaes_siv",
127− "murmur3": "murmur3",
128− "nixpkgs": "nixpkgs",
129− "nockapp": "nockapp",
130− "pdjson": "pdjson",
131− "sha256": "sha256",
132− "softfloat": "softfloat",
133− "urcrypt": "urcrypt",
134− "vere": "vere"
74+ "nixpkgs": "nixpkgs_2"
13575 }
13676 },
13777 "rust-analyzer-src": {
13878 "flake": false,
13979 "locked": {
140− "lastModified": 1725630423,
141− "narHash": "sha256-gNCLk3Zg7JlAwmWbVHTH6f3+iqdeQ4fheOotCZy8x5M=",
80+ "lastModified": 1724153119,
81+ "narHash": "sha256-WxpvDJDttkINkXmUA/W5o11lwLPYhATAgu0QUAacZ2g=",
14282 "owner": "rust-lang",
14383 "repo": "rust-analyzer",
144− "rev": "08c7bbc2dbe4dcc8968484f1a0e1e6fe7a1d4f6d",
84+ "rev": "3723e5910c14f0ffbd13de474b8a8fcc74db04ce",
14585 "type": "github"
14686 },
14787 "original": {
@@ -151,38 +91,6 @@
15191 "type": "github"
15292 }
15393 },
154− "sha256": {
155− "flake": false,
156− "locked": {
157− "lastModified": 1670543087,
158− "narHash": "sha256-TI6a7Zj3nuLlVbMyG2y+vJIY1RUUktm7tj1qrgxClOs=",
159− "owner": "LekKit",
160− "repo": "sha256",
161− "rev": "c6cf8e509a713ef28c0b1b2f12578735b6402323",
162− "type": "github"
163− },
164− "original": {
165− "owner": "LekKit",
166− "repo": "sha256",
167− "type": "github"
168− }
169− },
170− "softfloat": {
171− "flake": false,
172− "locked": {
173− "lastModified": 1722814202,
174− "narHash": "sha256-uBXfFgKuGixDIupetB/p421YmZM/AlBmJi4VgFOjbC0=",
175− "owner": "ucb-bar",
176− "repo": "berkeley-softfloat-3",
177− "rev": "3b70b5d8147675932c38b36cd09af6df4eedd919",
178− "type": "github"
179− },
180− "original": {
181− "owner": "ucb-bar",
182− "repo": "berkeley-softfloat-3",
183− "type": "github"
184− }
185− },
18694 "systems": {
18795 "locked": {
18896 "lastModified": 1681028828,
@@ -197,40 +105,6 @@
197105 "repo": "default",
198106 "type": "github"
199107 }
200− },
201− "urcrypt": {
202− "flake": false,
203− "locked": {
204− "lastModified": 1706202942,
205− "narHash": "sha256-xAhxBgh1bTg4x3gsyQdCW8ILHdAMGpAReW4nxqRuQmQ=",
206− "owner": "urbit",
207− "repo": "urcrypt",
208− "rev": "9ae5d604528bc54ae48430f55ebbb17b1ad7956c",
209− "type": "github"
210− },
211− "original": {
212− "owner": "urbit",
213− "repo": "urcrypt",
214− "rev": "9ae5d604528bc54ae48430f55ebbb17b1ad7956c",
215− "type": "github"
216− }
217− },
218− "vere": {
219− "flake": false,
220− "locked": {
221− "lastModified": 1723473625,
222− "narHash": "sha256-ygb6uIEHKX8EN2Zp75h5aP8TVWZUiItcOSsjdIf4Ous=",
223− "owner": "urbit",
224− "repo": "vere",
225− "rev": "be3b0424f7e07c09e8dea0a63874f5e8abeae443",
226− "type": "github"
227− },
228− "original": {
229− "owner": "urbit",
230− "ref": "master",
231− "repo": "vere",
232− "type": "github"
233− }
234108 }
235109 },
236110 "root": "root",
flake.nix+21−205
@@ -1,212 +1,28 @@
11{
22 inputs = {
3− nixpkgs.url =
4− "github:NixOS/nixpkgs?ref=4c0bb97b29ea716c4ced5da385e021caaa55c481";
5− flake-utils.url = "github:numtide/flake-utils";
6− vere = {
7− url = "github:urbit/vere?ref=master";
8− flake = false;
9− };
10− murmur3 = {
11− url = "github:PeterScott/murmur3";
12− flake = false;
13− };
14− urcrypt = {
15− url = "github:urbit/urcrypt?rev=9ae5d604528bc54ae48430f55ebbb17b1ad7956c";
16− flake = false;
17− };
18− pdjson = {
19− url = "github:skeeto/pdjson";
20− flake = false;
21− };
22− softfloat = {
23− url = "github:ucb-bar/berkeley-softfloat-3";
24− flake = false;
25− };
26− sha256 = {
27− url = "github:LekKit/sha256";
28− flake = false;
29− };
30− libaes_siv = {
31− url = "github:dfoxfranke/libaes_siv";
32− flake = false;
33− };
34− nockapp = {
35− url = "github:zorp-corp/nockapp";
36− flake = false;
37− };
38− fenix = {
39− url = "github:nix-community/fenix";
40− inputs.nixpkgs.follows = "nixpkgs";
41− };
3+ nixpkgs.url = "nixpkgs/nixos-unstable";
4+ flake-utils.url = "flake-utils";
5+ fenix.url = "github:nix-community/fenix";
426 };
43− outputs = inputs@{ self, nixpkgs, flake-utils, vere, murmur3, pdjson, sha256
44− , fenix, ... }:
45− flake-utils.lib.eachDefaultSystem (system:
46− let
47− pkgs = import nixpkgs {
48− inherit system;
49− config = { permittedInsecurePackages = [ "openssl-1.1.1w" ]; };
50− };
51− in {
52− packages = rec {
53− nockapp = (let toolchain = fenix.packages.${system}.minimal.toolchain;
54− in pkgs.makeRustPlatform {
55− rustc = toolchain;
56− cargo = toolchain;
57− }).buildRustPackage {
58− doCheck = false;
59− name = "nockapp";
60− src = inputs.nockapp;
61−
62− cargoLock = {
63− lockFile = "${inputs.nockapp}/Cargo.lock";
64− allowBuiltinFetchGit = true;
65− };
66− LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
67− BINDGEN_EXTRA_CLANG_ARGS = [
68− "-I${pkgs.glibc.dev}/include"
69− "-I${pkgs.libclang.lib}/lib/clang/17/include"
70− ];
71− };
72− urbit-nock = pkgs.runCommand "urbit.nock" { } ''
73− mkdir -p source
74− cp ${./urbit.hoon} source/urbit.hoon
75− ${nockapp}/bin/choo source/urbit.hoon source
76− cp out.jam $out
77− '';
78− gmp = pkgs.runCommand "gmp" {
79− buildInputs = with pkgs; [ gnutar emscripten gcc ];
80− } ''
81− tar xvf ${pkgs.gmp.src}
82− cd "gmp-${pkgs.gmp.version}"
83− mkdir -p $out
84− HOME=$TMPDIR
85− emconfigure ./configure --disable-assembly --host none HOST_CC=gcc --prefix=$out
86− make
87− make install
88− '';
89− libsigsegv = pkgs.libsigsegv.overrideDerivation (old: {
90− configurePhase = ''
91− runHook preConfigure
92−
93− HOME=$TMPDIR
94− ${pkgs.emscripten}/bin/emconfigure ./configure --prefix=$out ${
95− builtins.concatStringsSep " " old.configureFlags
96− }
97−
98− runHook postConfigure
99− '';
100− doCheck = false;
101− });
102− secp256k1 = pkgs.secp256k1.overrideDerivation (old: {
103− configurePhase = ''
104− runHook preConfigure
105−
106− HOME=$TMPDIR
107− ${pkgs.emscripten}/bin/emconfigure ./configure --prefix=$out ${
108− builtins.concatStringsSep " " old.configureFlags
109− }
110−
111− runHook postConfigure
112− '';
113− doCheck = false;
114− });
115− openssl = pkgs.openssl_1_1.overrideDerivation (old: {
116− configurePhase = ''
117− runHook preConfigure
118−
119− HOME=$TMPDIR
120− export CC=${pkgs.emscripten}/bin/emcc
121− ./Configure linux-generic64 no-shared -no-asm no-engine no-tests --prefix=$out
1227
123− runHook postConfigure
124− '';
125−
126− postInstall = ''
127− mkdir -p $bin
128− mv $out/bin $bin/bin
129−
130− mkdir $dev
131− mv $out/include $dev/
132− '';
133− });
134− libaes_siv = pkgs.runCommand "libaes_siv" {
135− buildInputs = with pkgs; [ emscripten ];
136− } ''
137− mkdir -p $out/lib
138− HOME=$TMPDIR
139− emcc -c ${inputs.libaes_siv}/aes_siv.c -I${
140− ./libaes_siv/include
141− } -I${openssl.dev}/include -o $out/lib/aes_siv.o
142− mkdir -p $out/include
143− cp ${inputs.libaes_siv}/aes_siv.h $out/include/aes_siv.h
144− '';
145− urcrypt = pkgs.runCommand "urcrypt" {
146− nativeBuildInputs = with pkgs; [ emscripten ];
147− } ''
148− cp -r ${inputs.urcrypt} src
149− chmod +w -R src
150−
151− rm src/argon2/src/bench.c src/argon2/src/opt.c
152−
153− mkdir -p $out/lib
154− mkdir -p $out/include
155− HOME=$TMPDIR
156− emcc -c src/urcrypt/*.c src/argon2/src/*.c src/argon2/src/blake2/*.c \
157− src/blake3/blake3_portable.c \
158− src/blake3/blake3_dispatch.c \
159− src/ed25519/src/*.c \
160− src/scrypt/*.c src/ge-additions/ge-additions.c \
161− src/keccak-tiny/keccak-tiny.c \
162− -I${openssl.dev}/include -I${libaes_siv}/include \
163− -I${secp256k1}/include -I${pkgs.libb2}/include -Isrc/argon2/include \
164− -Isrc/ed25519/src/ -Isrc/ge-additions -Isrc/keccak-tiny -Isrc/scrypt \
165− -Isrc/blake3 -Wno-int-conversion
166−
167− emcc -c -o blake3_2.o src/blake3/blake3.c \
168− -I${openssl.dev}/include -I${libaes_siv}/include \
169− -I${secp256k1}/include -I${pkgs.libb2}/include -Isrc/argon2/include \
170− -Isrc/ed25519/src/ -Isrc/ge-additions -Isrc/keccak-tiny -Isrc/scrypt \
171− -Isrc/blake3 -Wno-int-conversion
172−
173− emar rcs $out/lib/urcrypt.a *.o
174−
175− cp src/urcrypt/urcrypt.h $out/include
176− '';
177− softfloat =
178− pkgs.callPackage ./softfloat.nix { inherit (inputs) softfloat; };
179− nock = pkgs.runCommand "nock" { } ''
180− cp -r ${vere}/pkg .
181− chmod -R a+w pkg
182− cp pkg/noun/platform/linux/rsignal.h pkg/noun/platform/rsignal.h
183− patch -p1 <${./vere.patch}
184− rm pkg/noun/*_tests.c
185− mkdir -p $out
186− HOME=$TMPDIR
187− ${pkgs.emscripten}/bin/emcc \
188− pkg/noun/*.c pkg/noun/jets/*/*.c pkg/noun/jets/*.c pkg/c3/*.c pkg/ur/*.c \
189− pkg/noun/v3/*.c pkg/noun/v2/*.c pkg/noun/v1/*.c pkg/ent/ent.c \
190− ${murmur3}/murmur3.c ${pdjson}/pdjson.c ${gmp}/lib/libgmp.a ${sha256}/sha256.c \
191− ${softfloat}/lib/softfloat.a ${libsigsegv}/lib/libsigsegv.a ${urcrypt}/lib/urcrypt.a \
192− ${openssl.out}/lib/libcrypto.a ${libaes_siv}/lib/aes_siv.o ${secp256k1}/lib/libsecp256k1.a \
193− -o $out/nock.js \
194− -DU3_OS_linux \
195− -DU3_OS_ENDIAN_little \
196− -DU3_GUARD_PAGE \
197− -DENT_GETENTROPY_SYSRANDOM \
198− -sWASM=1 \
199− -sEXPORTED_RUNTIME_METHODS=cwrap \
200− -sALLOW_MEMORY_GROWTH \
201− -sINITIAL_MEMORY=536870912 \
202− -Ipkg -Ipkg/noun -Ipkg/c3 -Ipkg/ur -Ipkg/ent -I. \
203− -I${pdjson} -I${gmp}/include -I${murmur3} -I${libsigsegv}/include \
204− -I${softfloat}/include -I${sha256} -I${urcrypt}/include -I${openssl.dev}/include \
205− -sEXPORTED_FUNCTIONS=_u3n_nock_on,_u3m_boot_lite,_u3s_cue_bytes \
206− -sEXPORTED_RUNTIME_METHODS=cwrap \
207− # -Os
208− '';
8+ outputs = { self, flake-utils, nixpkgs, fenix }:
9+ let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
10+ in flake-utils.lib.eachSystem supportedSystems (system:
11+ let pkgs = import nixpkgs { inherit system; };
12+ in {
13+ inherit fenix;
14+ devShells.default = pkgs.mkShell {
15+ buildInputs = with pkgs; [
16+ (fenix.packages.${system}.combine
17+ (with fenix.packages.${system}.latest; [
18+ fenix.packages.${system}.targets.wasm32-unknown-unknown.latest.rust-std
19+ cargo
20+ rustc
21+ ]))
22+ wasm-pack
23+ wasm-tools
24+ cargo-flamegraph
25+ ];
20926 };
210− apps = { };
21127 });
21228}
libaes_siv/include/config.hdeleted−7
@@ -1,7 +0,0 @@
1−#ifndef AES_SIV_CONFIG_H_
2−#define AES_SIV_CONFIG_H_
3−
4−#define ENABLE_DEBUG_WEIRD_ENDIAN 0
5−#define ENABLE_DEBUG_TINY_CHUNK_SIZE 0
6−
7−#endif
nock/flake.lockdeleted−112
@@ -1,112 +0,0 @@
1−{
2− "nodes": {
3− "fenix": {
4− "inputs": {
5− "nixpkgs": "nixpkgs",
6− "rust-analyzer-src": "rust-analyzer-src"
7− },
8− "locked": {
9− "lastModified": 1724221791,
10− "narHash": "sha256-mKX67QPnUybOopVph/LhOV1G/H4EvPxDIfSmbufrVdA=",
11− "owner": "nix-community",
12− "repo": "fenix",
13− "rev": "e88b38a5a3834e039d413a88f8150a75ef6453ef",
14− "type": "github"
15− },
16− "original": {
17− "owner": "nix-community",
18− "repo": "fenix",
19− "type": "github"
20− }
21− },
22− "flake-utils": {
23− "inputs": {
24− "systems": "systems"
25− },
26− "locked": {
27− "lastModified": 1710146030,
28− "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
29− "owner": "numtide",
30− "repo": "flake-utils",
31− "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
32− "type": "github"
33− },
34− "original": {
35− "id": "flake-utils",
36− "type": "indirect"
37− }
38− },
39− "nixpkgs": {
40− "locked": {
41− "lastModified": 1723991338,
42− "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=",
43− "owner": "nixos",
44− "repo": "nixpkgs",
45− "rev": "8a3354191c0d7144db9756a74755672387b702ba",
46− "type": "github"
47− },
48− "original": {
49− "owner": "nixos",
50− "ref": "nixos-unstable",
51− "repo": "nixpkgs",
52− "type": "github"
53− }
54− },
55− "nixpkgs_2": {
56− "locked": {
57− "lastModified": 1723637854,
58− "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
59− "owner": "NixOS",
60− "repo": "nixpkgs",
61− "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
62− "type": "github"
63− },
64− "original": {
65− "id": "nixpkgs",
66− "ref": "nixos-unstable",
67− "type": "indirect"
68− }
69− },
70− "root": {
71− "inputs": {
72− "fenix": "fenix",
73− "flake-utils": "flake-utils",
74− "nixpkgs": "nixpkgs_2"
75− }
76− },
77− "rust-analyzer-src": {
78− "flake": false,
79− "locked": {
80− "lastModified": 1724153119,
81− "narHash": "sha256-WxpvDJDttkINkXmUA/W5o11lwLPYhATAgu0QUAacZ2g=",
82− "owner": "rust-lang",
83− "repo": "rust-analyzer",
84− "rev": "3723e5910c14f0ffbd13de474b8a8fcc74db04ce",
85− "type": "github"
86− },
87− "original": {
88− "owner": "rust-lang",
89− "ref": "nightly",
90− "repo": "rust-analyzer",
91− "type": "github"
92− }
93− },
94− "systems": {
95− "locked": {
96− "lastModified": 1681028828,
97− "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
98− "owner": "nix-systems",
99− "repo": "default",
100− "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
101− "type": "github"
102− },
103− "original": {
104− "owner": "nix-systems",
105− "repo": "default",
106− "type": "github"
107− }
108− }
109− },
110− "root": "root",
111− "version": 7
112−}
nock/flake.nixdeleted−28
@@ -1,28 +0,0 @@
1−{
2− inputs = {
3− nixpkgs.url = "nixpkgs/nixos-unstable";
4− flake-utils.url = "flake-utils";
5− fenix.url = "github:nix-community/fenix";
6− };
7−
8− outputs = { self, flake-utils, nixpkgs, fenix }:
9− let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
10− in flake-utils.lib.eachSystem supportedSystems (system:
11− let pkgs = import nixpkgs { inherit system; };
12− in {
13− inherit fenix;
14− devShells.default = pkgs.mkShell {
15− buildInputs = with pkgs; [
16− (fenix.packages.${system}.combine
17− (with fenix.packages.${system}.latest; [
18− fenix.packages.${system}.targets.wasm32-unknown-unknown.latest.rust-std
19− cargo
20− rustc
21− ]))
22− wasm-pack
23− wasm-tools
24− cargo-flamegraph
25− ];
26− };
27− });
28−}
script.jsdeleted−1
@@ -1 +0,0 @@
1−u3m_boot_lite = Module.cwrap("u3m_boot_lite", null, ["number"])
sha256.cdeleted−87
@@ -1,87 +0,0 @@
1−#define NULL 0
2−#define SHA256_DIGEST_LENGTH 32
3−typedef __SIZE_TYPE__ size_t;
4−typedef unsigned char __uint8_t;
5−typedef __uint8_t uint8_t;
6−
7−void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id,
8− const char *name, const char *properties,
9− void *(*new_method)(int name_id,
10− const OSSL_ALGORITHM *algodef,
11− OSSL_PROVIDER *prov),
12− int (*up_ref_method)(void *),
13− void (*free_method)(void *))
14−{
15− struct evp_method_data_st methdata;
16− void *method;
17−
18− methdata.libctx = libctx;
19− methdata.tmp_store = NULL;
20− method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
21− name, properties,
22− new_method, up_ref_method, free_method);
23− dealloc_tmp_evp_method_store(methdata.tmp_store);
24− return method;
25−}
26−
27−int EVP_Digest(const void *data, size_t count,
28− unsigned char *md, unsigned int *size, const void *type,
29− void *impl)
30−{
31− void *ctx = EVP_MD_CTX_new();
32− int ret;
33−
34− if (ctx == NULL)
35− return 0;
36− EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
37− ret = EVP_DigestInit_ex(ctx, type, impl)
38− && EVP_DigestUpdate(ctx, data, count)
39− && EVP_DigestFinal_ex(ctx, md, size);
40− EVP_MD_CTX_free(ctx);
41−
42− return ret;
43−}
44−
45−void *EVP_MD_fetch(void *ctx, const char *algorithm,
46− const char *properties)
47−{
48− void *md =
49− evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
50− evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
51−
52− return md;
53−}
54−
55−
56−int EVP_Q_digest(void *libctx, const char *name, const char *propq,
57− const void *data, size_t datalen,
58− unsigned char *md, size_t *mdlen)
59−{
60− void *digest = EVP_MD_fetch(libctx, name, propq);
61− unsigned int temp = 0;
62− int ret = 0;
63−
64− if (digest != NULL) {
65− ret = EVP_Digest(data, datalen, md, &temp, digest, NULL);
66− EVP_MD_free(digest);
67− }
68− if (mdlen != NULL)
69− *mdlen = temp;
70− return ret;
71−}
72−
73−unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)
74−{
75− static unsigned char m[SHA256_DIGEST_LENGTH];
76−
77− if (md == NULL)
78− md = m;
79− return EVP_Q_digest(NULL, "SHA256", NULL, d, n, md, NULL) ? md : NULL;
80−}
81−
82−void
83−urcrypt_shay(const uint8_t *message, size_t length, uint8_t out[32])
84−{
85− SHA256(message, length, out);
86−}
87−
softfloat.nixdeleted−14
@@ -1,14 +0,0 @@
1−{ pkgs, softfloat, ... }:
2−pkgs.runCommand "nock" { buildInputs = [ pkgs.emscripten pkgs.binutils ]; } ''
3− mkdir -p $out/lib
4− mkdir -p $out/include
5− cp -r ${softfloat} src
6− chmod +w -R src
7− cd src
8− patch -p1 <${./softfloat/patch.diff}
9− cd build/Linux-x86_64-GCC
10− HOME=$TMPDIR
11− make
12− cp softfloat.a $out/lib
13− cp ${softfloat}/source/include/* $out/include
14−''
softfloat/patch.diffdeleted−13
@@ -1,13 +0,0 @@
1−diff --git a/build/Linux-x86_64-GCC/Makefile b/build/Linux-x86_64-GCC/Makefile
2−index 72f251a..c3efaa2 100644
3−--- a/build/Linux-x86_64-GCC/Makefile
4−+++ b/build/Linux-x86_64-GCC/Makefile
5−@@ -44,7 +44,7 @@ SOFTFLOAT_OPTS ?= \
6− DELETE = rm -f
7− C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
8− COMPILE_C = \
9−- gcc -c -Werror-implicit-function-declaration -DSOFTFLOAT_FAST_INT64 \
10−+ emcc -c -Werror-implicit-function-declaration -DSOFTFLOAT_FAST_INT64 \
11− $(SOFTFLOAT_OPTS) $(C_INCLUDES) -O2 -o $@
12− MAKELIB = ar crs $@
13−
vere.patchdeleted−34
@@ -1,34 +0,0 @@
1−diff --git a/pkg/c3/portable.h b/pkg/c3/portable.h
2−index 002276834b..0995b21fcc 100644
3−--- a/pkg/c3/portable.h
4−+++ b/pkg/c3/portable.h
5−@@ -36,7 +36,6 @@
6− # include <sys/time.h>
7− # include <sys/resource.h>
8− # include <sys/mman.h>
9−-# include <sys/sendfile.h>
10−
11− # elif defined(U3_OS_osx)
12− # include <ctype.h>
13−@@ -145,6 +144,8 @@
14− # error "port: LoomBase"
15− # endif
16−
17−+#define U3_OS_LoomBits 30
18−+#define U3_OS_LoomBase 0
19−
20− /** Private C "extensions."
21− ***
22−diff --git a/pkg/noun/manage.c b/pkg/noun/manage.c
23−index d880a42032..e585d3403e 100644
24−--- a/pkg/noun/manage.c
25−+++ b/pkg/noun/manage.c
26−@@ -2029,8 +2029,6 @@ _cm_free2(void* tox_v, size_t siz_i)
27− void
28− u3m_init(size_t len_i)
29− {
30−- _cm_limits();
31−- _cm_signals();
32− _cm_crypto();
33−
34− // make sure GMP uses our malloc.