1use core::ffi::{c_char, c_int};
4
5unsafe extern "C" {
6 pub fn tidecoin_node_verify_tx_input(
8 tx_hex: *const c_char,
9 input_index: usize,
10 prev_script: *const u8,
11 prev_script_len: usize,
12 amount: i64,
13 flags: u32,
14 script_error_out: *mut c_int,
15 ) -> c_int;
16
17 pub fn tidecoin_node_check_transaction(tx_hex: *const c_char) -> c_int;
19
20 pub fn tidecoin_node_scrypt_pow_hash(
22 header: *const u8,
23 header_len: usize,
24 out: *mut u8,
25 out_len: usize,
26 ) -> c_int;
27
28 pub fn tidecoin_node_yespower_pow_hash(
30 header: *const u8,
31 header_len: usize,
32 out: *mut u8,
33 out_len: usize,
34 ) -> c_int;
35
36 pub fn tidecoin_node_has_valid_header_pow(
38 header_hex: *const c_char,
39 network: c_int,
40 has_height: c_int,
41 height: c_int,
42 ) -> c_int;
43
44 pub fn tidecoin_node_check_block(
46 block_hex: *const c_char,
47 network: c_int,
48 check_pow: c_int,
49 check_merkle_root: c_int,
50 ) -> c_int;
51
52 pub fn tidecoin_node_check_contextual_block(
54 block_hex: *const c_char,
55 network: c_int,
56 height: c_int,
57 lock_time_cutoff: i64,
58 enforce_bip34_height: c_int,
59 expect_witness_commitment: c_int,
60 ) -> c_int;
61
62 pub fn tidecoin_node_permitted_difficulty_transition(
64 network: c_int,
65 height: i64,
66 old_nbits: u32,
67 new_nbits: u32,
68 ) -> c_int;
69
70 pub fn tidecoin_node_block_subsidy(network: c_int, height: c_int) -> i64;
72
73 pub fn tidecoin_node_pq_p2wpkh_input_vsize(sig_len: usize, pubkey_len: usize) -> i64;
75
76 pub fn tidecoin_node_pq_p2sh_p2wpkh_input_vsize(sig_len: usize, pubkey_len: usize) -> i64;
78
79 pub fn tidecoin_node_pq_keygen_from_seed(
81 scheme_prefix: u8,
82 seed: *const u8,
83 seed_len: usize,
84 pk_out: *mut u8,
85 pk_len: usize,
86 sk_out: *mut u8,
87 sk_len: usize,
88 ) -> c_int;
89
90 pub fn tidecoin_node_pqhd_keygen_from_stream_key(
92 scheme_prefix: u8,
93 stream_key: *const u8,
94 stream_key_len: usize,
95 pk_out: *mut u8,
96 pk_len: usize,
97 sk_out: *mut u8,
98 sk_len: usize,
99 ) -> c_int;
100
101 pub fn tidecoin_node_pq_compute_public_key(
103 scheme_prefix: u8,
104 sk: *const u8,
105 sk_len: usize,
106 pk_out: *mut u8,
107 pk_len: usize,
108 ) -> c_int;
109
110 pub fn tidecoin_node_pq_sign_message(
112 scheme_prefix: u8,
113 msg: *const u8,
114 msg_len: usize,
115 sk: *const u8,
116 sk_len: usize,
117 legacy_mode: c_int,
118 sig_out: *mut u8,
119 sig_len: *mut usize,
120 ) -> c_int;
121
122 pub fn tidecoin_node_pq_verify_message(
124 scheme_prefix: u8,
125 msg: *const u8,
126 msg_len: usize,
127 sig: *const u8,
128 sig_len: usize,
129 pk: *const u8,
130 pk_len: usize,
131 legacy_mode: c_int,
132 ) -> c_int;
133
134 pub fn tidecoin_node_mlkem512_keypair_from_coins(
136 coins: *const u8,
137 coins_len: usize,
138 pk_out: *mut u8,
139 pk_len: usize,
140 sk_out: *mut u8,
141 sk_len: usize,
142 ) -> c_int;
143
144 pub fn tidecoin_node_mlkem512_encaps_deterministic(
146 pk: *const u8,
147 pk_len: usize,
148 coins: *const u8,
149 coins_len: usize,
150 ct_out: *mut u8,
151 ct_len: usize,
152 ss_out: *mut u8,
153 ss_len: usize,
154 ) -> c_int;
155
156 pub fn tidecoin_node_mlkem512_decaps(
158 ct: *const u8,
159 ct_len: usize,
160 sk: *const u8,
161 sk_len: usize,
162 ss_out: *mut u8,
163 ss_len: usize,
164 ) -> c_int;
165
166 pub fn tidecoin_node_parse_script_asm(
168 script_asm: *const c_char,
169 out: *mut u8,
170 out_len: *mut usize,
171 ) -> c_int;
172
173 pub fn tidecoin_node_verify_script_case(
175 script_sig: *const u8,
176 script_sig_len: usize,
177 script_pubkey: *const u8,
178 script_pubkey_len: usize,
179 witness_items: *const *const u8,
180 witness_lens: *const usize,
181 witness_count: usize,
182 amount: i64,
183 flags: u32,
184 script_error_out: *mut c_int,
185 ) -> c_int;
186}