From d1587c42dfae52776d0882d2bd213615a21f7971 Mon Sep 17 00:00:00 2001 From: swrup Date: Tue, 7 Oct 2025 16:26:05 +0200 Subject: [PATCH] --- a.out | Bin 0 -> 15528 bytes test/signatures.c | 55 +++++++++++++++++++++++++++++++++++++++++ test/signatures.output | Bin 0 -> 76 bytes test/test.ml | 5 ++-- test/test.output | Bin 0 -> 76 bytes 5 files changed, 58 insertions(+), 2 deletions(-) create mode 100755 a.out create mode 100644 test/signatures.c create mode 100644 test/signatures.output create mode 100644 test/test.output diff --git a/a.out b/a.out new file mode 100755 index 0000000000000000000000000000000000000000..1e1fd59f4fe779734c51524b3b4fc63e96e1aacc GIT binary patch literal 15528 zcmb<-^>JfjWMqH=W(GS35HCOgBH{p{7&J_w3DvNgFfcHn(=t$XFdF10kPwIl=>xH`;RhfGF)%Q|Xa=Z1 zK>Aog8lZfbIE-G(1d?Q6fYC5$&6#-$ebK%p@}t{hSotoXot^3f&3| zGhH(iz2ba5BL55AJV90S1s5$p4zMJ+LeV;$mP)1_lNp3{eJ#90mq>Tp~+@ z?7^nK1BZGm9Oh5Qpne;h~0Xig!BIce)$HF!oyJ7qt`YQB-v}41fn$md31j8IQY)q7#=v@8u9=Ce;)=0hU2X<|NsA&VqswL*ulue%)-jX&f&3(lZ%^&mych-qq8;P z|Ns9Uol`SF)DA%*VG&U=aS4xIl2Xz#vU2hY9-XZPAgRu&6(DMdqLQ+Ts+zin$1Y7R zZ5>@beFKk9*9MQy&<>9shDOFFre@|A9=j~9tZi)V>>WHhT_<>ShR!(N8uI`De^8)$ zbc3Dd(doLtqZ?v*H^lNz*A*U}p&LB9Ar^K+EbMgM;n5j-z@yu>!J|90!=uynghyxS z1&?mm2_D^{Gdwz7Z+LWuKIjHp(CPZZqg!;3E(3!{uj>Mj&WpQ1iDVxr96UOYzc~E& z|Nk8jM}+=J@z53lhgb>gi&=mF|37&c6t3WO2~UY2wWD}61V%$(Gz3ONU^E0qLtr!n zMnhmU1V%$(Gz3ONfZPyZ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/signatures.c @@ -0,0 +1,55 @@ +#include +#include + +struct H64 { + uint8_t hash[64]; +}; +struct Hhh { + struct H64 hash; +}; +struct Purpose { + uint32_t size; + uint32_t purpose; +}; + +struct PS { + struct Purpose purpose; + struct Hhh h; + uint32_t noreveal_index; +}; + +int main(void) { + struct Purpose purpose; + struct PS ps; + + purpose.size = 3 * 4 + 64; + purpose.purpose = 1050; + + struct Hhh h = { + .hash = { + .hash = { + 1 , 2 , 3 , 4 , 5, 6, 7, 8, + 9 , 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64 + } + } + }; + + uint32_t noreveal_index = 0; + + ps.purpose = purpose; + ps.h = h; + ps.noreveal_index = noreveal_index; + + + fwrite(&ps, sizeof(ps), 1, stdout); + + // printf("\n"); + + return 0; +} diff --git a/test/signatures.output b/test/signatures.output new file mode 100644 index 0000000000000000000000000000000000000000..53eb1eba6bd76a2ede16edea6546a89a6798d61b GIT binary patch literal 76 zcmeZaU|^79VPIfnVrF4wW9Q)H;^yJy;};MV5*85^6PJ*bl9rK`lUGnwQdUt_Q`gYc f($>+{(>E|QGBz Char.unsafe_chr (i + 1)) in let dummy_t = { h_planchets= { v= { v= str64 } }; noreveal_index= 0_l } in let size' = Bin.size_of_value bin dummy_t |> Option.get in assert (size = size'); assert (size = 76); - () + let raw_str = Bin.to_string bin dummy_t in + Printf.printf "%s" raw_str; () diff --git a/test/test.output b/test/test.output new file mode 100644 index 0000000000000000000000000000000000000000..53eb1eba6bd76a2ede16edea6546a89a6798d61b GIT binary patch literal 76 zcmeZaU|^79VPIfnVrF4wW9Q)H;^yJy;};MV5*85^6PJ*bl9rK`lUGnwQdUt_Q`gYc f($>+{(>E|QGBz