1pub const SODOT_OK: i32 = 0;
4pub const SODOT_INVALID_UUID: i32 = -1;
5pub const SODOT_INVALID_HOST_URL: i32 = -2;
6pub const SODOT_INVALID_SECRET_SHARE_ERR: i32 = -3;
7pub const SODOT_INVALID_MESSAGE_ERR: i32 = -4;
8pub const SODOT_INVALID_NUMBER_OF_PARTIES_ERR: i32 = -6;
9pub const SODOT_EXECUTOR_ERROR: i32 = -8;
10pub const SODOT_INVALID_KEYGEN_INIT_KEYPAIR_ERR: i32 = -9;
11pub const SODOT_INVALID_KEYGEN_ID_ERR: i32 = -10;
12pub const SODOT_INVALID_DERIVATION_ELEM_ERR: i32 = -11;
13pub const SODOT_INVALID_XPRIV_ERR: i32 = -12;
14pub const SODOT_INVALID_SPRIV_ERR: i32 = -13;
15pub const SODOT_INVALID_API_KEY: i32 = -14;
16pub const SODOT_INVALID_PRIVATE_KEY: i32 = -15;
17pub const SODOT_INVALID_TWEAK: i32 = -16;
18pub const SODOT_INVALID_XPUB_ERR: i32 = -17;
19pub const SODOT_INVALID_SPUB_ERR: i32 = -18;
20pub const SODOT_INVALID_PUBLIC_KEY: i32 = -19;
21pub const SODOT_NULL_POINTER: i32 = -253;
22pub const SODOT_PANIC_ERR: i32 = -254;
23pub const SODOT_PLATFORM_ERR: i32 = -255;
24#[doc = " A heap allocated string\n The caller should call `sodot_dealloc_heap_string` on the struct after use."]
25#[repr(C)]
26#[derive(Debug)]
27pub struct HeapString {
28 pub ptr: *mut u8,
29 pub len: usize,
30}
31#[allow(clippy::unnecessary_operation, clippy::identity_op)]
32const _: () = {
33 ["Size of HeapString"][::std::mem::size_of::<HeapString>() - 16usize];
34 ["Alignment of HeapString"][::std::mem::align_of::<HeapString>() - 8usize];
35 ["Offset of field: HeapString::ptr"][::std::mem::offset_of!(HeapString, ptr) - 0usize];
36 ["Offset of field: HeapString::len"][::std::mem::offset_of!(HeapString, len) - 8usize];
37};
38#[repr(C)]
39#[derive(Debug)]
40#[must_use]
41pub struct ResultFFI {
42 pub err_str: HeapString,
43 pub error_code: i32,
44}
45#[allow(clippy::unnecessary_operation, clippy::identity_op)]
46const _: () = {
47 ["Size of ResultFFI"][::std::mem::size_of::<ResultFFI>() - 24usize];
48 ["Alignment of ResultFFI"][::std::mem::align_of::<ResultFFI>() - 8usize];
49 ["Offset of field: ResultFFI::err_str"][::std::mem::offset_of!(ResultFFI, err_str) - 0usize];
50 ["Offset of field: ResultFFI::error_code"][::std::mem::offset_of!(ResultFFI, error_code) - 16usize];
51};
52#[doc = " A const reference to a string represnted in a contiguous array of bytes"]
53#[repr(C)]
54#[derive(Debug, Copy, Clone)]
55pub struct ConstStr {
56 pub ptr: *const u8,
57 pub len: usize,
58}
59#[allow(clippy::unnecessary_operation, clippy::identity_op)]
60const _: () = {
61 ["Size of ConstStr"][::std::mem::size_of::<ConstStr>() - 16usize];
62 ["Alignment of ConstStr"][::std::mem::align_of::<ConstStr>() - 8usize];
63 ["Offset of field: ConstStr::ptr"][::std::mem::offset_of!(ConstStr, ptr) - 0usize];
64 ["Offset of field: ConstStr::len"][::std::mem::offset_of!(ConstStr, len) - 8usize];
65};
66#[doc = " Parameters for joining a room"]
67#[repr(C)]
68#[derive(Debug, Copy, Clone)]
69pub struct Room {
70 pub uuid: ConstStr,
71 pub host_url: ConstStr,
72}
73#[allow(clippy::unnecessary_operation, clippy::identity_op)]
74const _: () = {
75 ["Size of Room"][::std::mem::size_of::<Room>() - 32usize];
76 ["Alignment of Room"][::std::mem::align_of::<Room>() - 8usize];
77 ["Offset of field: Room::uuid"][::std::mem::offset_of!(Room, uuid) - 0usize];
78 ["Offset of field: Room::host_url"][::std::mem::offset_of!(Room, host_url) - 16usize];
79};
80#[doc = " A const reference to a string represnted in a contiguous array of bytes"]
81#[repr(C)]
82#[derive(Debug, Copy, Clone)]
83pub struct ConstSlice_ConstStr {
84 pub ptr: *const ConstStr,
85 pub len: usize,
86}
87#[allow(clippy::unnecessary_operation, clippy::identity_op)]
88const _: () = {
89 ["Size of ConstSlice_ConstStr"][::std::mem::size_of::<ConstSlice_ConstStr>() - 16usize];
90 ["Alignment of ConstSlice_ConstStr"][::std::mem::align_of::<ConstSlice_ConstStr>() - 8usize];
91 ["Offset of field: ConstSlice_ConstStr::ptr"][::std::mem::offset_of!(ConstSlice_ConstStr, ptr) - 0usize];
92 ["Offset of field: ConstSlice_ConstStr::len"][::std::mem::offset_of!(ConstSlice_ConstStr, len) - 8usize];
93};
94#[doc = " A const reference to a string represnted in a contiguous array of bytes"]
95#[repr(C)]
96#[derive(Debug, Copy, Clone)]
97pub struct ConstSlice_u32 {
98 pub ptr: *const u32,
99 pub len: usize,
100}
101#[allow(clippy::unnecessary_operation, clippy::identity_op)]
102const _: () = {
103 ["Size of ConstSlice_u32"][::std::mem::size_of::<ConstSlice_u32>() - 16usize];
104 ["Alignment of ConstSlice_u32"][::std::mem::align_of::<ConstSlice_u32>() - 8usize];
105 ["Offset of field: ConstSlice_u32::ptr"][::std::mem::offset_of!(ConstSlice_u32, ptr) - 0usize];
106 ["Offset of field: ConstSlice_u32::len"][::std::mem::offset_of!(ConstSlice_u32, len) - 8usize];
107};
108unsafe extern "C" {
109 #[must_use]
110 pub fn sodot_init_keygen(pubkey_out: *mut HeapString, keypair_out: *mut HeapString) -> ResultFFI;
111}
112unsafe extern "C" {
113 #[must_use]
114 pub fn sodot_create_room(
115 host_url: ConstStr,
116 num_parties: u16,
117 api_key: ConstStr,
118 callback: ::std::option::Option<
119 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, room_uuid: ConstStr),
120 >,
121 extra: *mut ::std::os::raw::c_void,
122 ) -> ResultFFI;
123}
124unsafe extern "C" {
125 #[doc = " Computes the SHA256 hash of the given data.\n The data is expected to be a pointer to a byte array of length `len`.\n The hash is written to the `hash32` pointer, which should point to a 32-byte array."]
126 pub fn sodot_sha256(ptr: *const u8, len: usize, hash32: *mut [u8; 32usize]);
127}
128unsafe extern "C" {
129 #[doc = " Computes the Keccak256 hash of the given data.\n The data is expected to be a pointer to a byte array of length `len`.\n The hash is written to the `hash32` pointer, which should point to a 32-byte array."]
130 pub fn sodot_keccak256(ptr: *const u8, len: usize, hash32: *mut [u8; 32usize]);
131}
132unsafe extern "C" {
133 #[doc = " Deallocates the heap array\n This should be called after the struct is no longer needed"]
134 pub fn sodot_dealloc_heap_string(self_: HeapString);
135}
136unsafe extern "C" {
137 #[must_use]
138 pub fn sodot_ecdsa_keygen(
139 room: Room,
140 num_parties: u16,
141 threshold: u16,
142 keygen_init_keypair: ConstStr,
143 keygen_ids: ConstSlice_ConstStr,
144 callback: ::std::option::Option<
145 unsafe extern "C" fn(
146 extra: *mut ::std::os::raw::c_void,
147 result: ResultFFI,
148 uncompressed_pubkey: ConstStr,
149 secret_share: ConstStr,
150 ),
151 >,
152 extra: *mut ::std::os::raw::c_void,
153 ) -> ResultFFI;
154}
155unsafe extern "C" {
156 #[must_use]
157 pub fn sodot_ecdsa_sign(
158 room: Room,
159 secret_share: ConstStr,
160 msg_hash: ConstStr,
161 derivation_path: ConstSlice_u32,
162 callback: ::std::option::Option<
163 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, expanded_signature: ConstStr),
164 >,
165 extra: *mut ::std::os::raw::c_void,
166 ) -> ResultFFI;
167}
168unsafe extern "C" {
169 #[must_use]
170 pub fn sodot_ecdsa_refresh(
171 room: Room,
172 secret_share: ConstStr,
173 callback: ::std::option::Option<
174 unsafe extern "C" fn(
175 extra: *mut ::std::os::raw::c_void,
176 result: ResultFFI,
177 uncompressed_pubkey: ConstStr,
178 secret_share: ConstStr,
179 ),
180 >,
181 extra: *mut ::std::os::raw::c_void,
182 ) -> ResultFFI;
183}
184unsafe extern "C" {
185 #[must_use]
186 pub fn sodot_ecdsa_reshare_new_party(
187 room: Room,
188 new_threshold: u16,
189 keygen_init_keypair: ConstStr,
190 keygen_ids: ConstSlice_ConstStr,
191 callback: ::std::option::Option<
192 unsafe extern "C" fn(
193 extra: *mut ::std::os::raw::c_void,
194 result: ResultFFI,
195 uncompressed_pubkey: ConstStr,
196 secret_share: ConstStr,
197 ),
198 >,
199 extra: *mut ::std::os::raw::c_void,
200 ) -> ResultFFI;
201}
202unsafe extern "C" {
203 #[must_use]
204 pub fn sodot_ecdsa_reshare_remaining_party(
205 room: Room,
206 new_threshold: u16,
207 secret_share: ConstStr,
208 keygen_ids: ConstSlice_ConstStr,
209 callback: ::std::option::Option<
210 unsafe extern "C" fn(
211 extra: *mut ::std::os::raw::c_void,
212 result: ResultFFI,
213 uncompressed_pubkey: ConstStr,
214 secret_share: ConstStr,
215 ),
216 >,
217 extra: *mut ::std::os::raw::c_void,
218 ) -> ResultFFI;
219}
220unsafe extern "C" {
221 #[must_use]
222 pub fn sodot_ecdsa_derive_pubkey(
223 secret_share: ConstStr,
224 derivation_path: ConstSlice_u32,
225 pubkey_out: *mut HeapString,
226 ) -> ResultFFI;
227}
228unsafe extern "C" {
229 #[must_use]
230 pub fn sodot_ecdsa_get_xpub(secret_share: ConstStr, xpub_out: *mut HeapString) -> ResultFFI;
231}
232unsafe extern "C" {
233 #[must_use]
234 pub fn sodot_ecdsa_derive_pubkey_from_xpub(
235 xpub: ConstStr,
236 derivation_path: ConstSlice_u32,
237 pubkey_out: *mut HeapString,
238 ) -> ResultFFI;
239}
240unsafe extern "C" {
241 #[must_use]
242 pub fn sodot_ecdsa_get_export_id(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
243}
244unsafe extern "C" {
245 #[must_use]
246 pub fn sodot_ecdsa_export_full_private_key(
247 room: Room,
248 secret_share: ConstStr,
249 export_to: ConstStr,
250 callback: ::std::option::Option<
251 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, privkey: ConstStr),
252 >,
253 extra: *mut ::std::os::raw::c_void,
254 ) -> ResultFFI;
255}
256unsafe extern "C" {
257 #[must_use]
258 pub fn sodot_ecdsa_offline_export_full_private_key(secret_shares: ConstSlice_ConstStr, privkey_out: *mut HeapString) -> ResultFFI;
259}
260unsafe extern "C" {
261 #[must_use]
262 pub fn sodot_ecdsa_derive_private_key_from_xpriv(
263 xpriv: ConstStr,
264 derivation_path: ConstSlice_u32,
265 privkey_out: *mut HeapString,
266 ) -> ResultFFI;
267}
268unsafe extern "C" {
269 #[must_use]
270 pub fn sodot_ecdsa_import_private_key_recipient(
271 room: Room,
272 threshold: u16,
273 keygen_init_keypair: ConstStr,
274 keygen_ids: ConstSlice_ConstStr,
275 callback: ::std::option::Option<
276 unsafe extern "C" fn(
277 extra: *mut ::std::os::raw::c_void,
278 result: ResultFFI,
279 uncompressed_pubkey: ConstStr,
280 secret_share: ConstStr,
281 ),
282 >,
283 extra: *mut ::std::os::raw::c_void,
284 ) -> ResultFFI;
285}
286unsafe extern "C" {
287 #[must_use]
288 pub fn sodot_ecdsa_import_private_key_importer(
289 room: Room,
290 threshold: u16,
291 private_key_hex: ConstStr,
292 keygen_init_keypair: ConstStr,
293 keygen_ids: ConstSlice_ConstStr,
294 callback: ::std::option::Option<
295 unsafe extern "C" fn(
296 extra: *mut ::std::os::raw::c_void,
297 result: ResultFFI,
298 uncompressed_pubkey: ConstStr,
299 secret_share: ConstStr,
300 ),
301 >,
302 extra: *mut ::std::os::raw::c_void,
303 ) -> ResultFFI;
304}
305unsafe extern "C" {
306 #[must_use]
307 pub fn sodot_ed25519_keygen(
308 room: Room,
309 num_parties: u16,
310 threshold: u16,
311 keygen_init_keypair: ConstStr,
312 keygen_ids: ConstSlice_ConstStr,
313 callback: ::std::option::Option<
314 unsafe extern "C" fn(
315 extra: *mut ::std::os::raw::c_void,
316 result: ResultFFI,
317 shared_pubkey: ConstStr,
318 secret_share: ConstStr,
319 ),
320 >,
321 extra: *mut ::std::os::raw::c_void,
322 ) -> ResultFFI;
323}
324unsafe extern "C" {
325 #[must_use]
326 pub fn sodot_ed25519_sign(
327 room: Room,
328 secret_share: ConstStr,
329 msg_hex: ConstStr,
330 derivation_path: ConstSlice_u32,
331 callback: ::std::option::Option<
332 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, signature: ConstStr),
333 >,
334 extra: *mut ::std::os::raw::c_void,
335 ) -> ResultFFI;
336}
337unsafe extern "C" {
338 #[must_use]
339 pub fn sodot_ed25519_refresh(
340 room: Room,
341 secret_share: ConstStr,
342 callback: ::std::option::Option<
343 unsafe extern "C" fn(
344 extra: *mut ::std::os::raw::c_void,
345 result: ResultFFI,
346 shared_pubkey: ConstStr,
347 secret_share: ConstStr,
348 ),
349 >,
350 extra: *mut ::std::os::raw::c_void,
351 ) -> ResultFFI;
352}
353unsafe extern "C" {
354 #[must_use]
355 pub fn sodot_ed25519_reshare_new_party(
356 room: Room,
357 new_threshold: u16,
358 keygen_init_keypair: ConstStr,
359 keygen_ids: ConstSlice_ConstStr,
360 callback: ::std::option::Option<
361 unsafe extern "C" fn(
362 extra: *mut ::std::os::raw::c_void,
363 result: ResultFFI,
364 shared_pubkey: ConstStr,
365 secret_share: ConstStr,
366 ),
367 >,
368 extra: *mut ::std::os::raw::c_void,
369 ) -> ResultFFI;
370}
371unsafe extern "C" {
372 #[must_use]
373 pub fn sodot_ed25519_reshare_remaining_party(
374 room: Room,
375 new_threshold: u16,
376 secret_share: ConstStr,
377 keygen_ids: ConstSlice_ConstStr,
378 callback: ::std::option::Option<
379 unsafe extern "C" fn(
380 extra: *mut ::std::os::raw::c_void,
381 result: ResultFFI,
382 shared_pubkey: ConstStr,
383 secret_share: ConstStr,
384 ),
385 >,
386 extra: *mut ::std::os::raw::c_void,
387 ) -> ResultFFI;
388}
389unsafe extern "C" {
390 #[must_use]
391 pub fn sodot_ed25519_derive_pubkey(
392 secret_share: ConstStr,
393 derivation_path: ConstSlice_u32,
394 pubkey_out: *mut HeapString,
395 ) -> ResultFFI;
396}
397unsafe extern "C" {
398 #[must_use]
399 pub fn sodot_ed25519_get_spub(secret_share: ConstStr, spub_out: *mut HeapString) -> ResultFFI;
400}
401unsafe extern "C" {
402 #[must_use]
403 pub fn sodot_ed25519_derive_pubkey_from_spub(
404 spub: ConstStr,
405 derivation_path: ConstSlice_u32,
406 pubkey_out: *mut HeapString,
407 ) -> ResultFFI;
408}
409unsafe extern "C" {
410 #[must_use]
411 pub fn sodot_ed25519_get_export_id(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
412}
413unsafe extern "C" {
414 #[must_use]
415 pub fn sodot_ed25519_export_full_private_key(
416 room: Room,
417 secret_share: ConstStr,
418 export_to: ConstStr,
419 callback: ::std::option::Option<unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, spriv: ConstStr)>,
420 extra: *mut ::std::os::raw::c_void,
421 ) -> ResultFFI;
422}
423unsafe extern "C" {
424 #[must_use]
425 pub fn sodot_ed25519_offline_export_full_private_key(
426 secret_shares: ConstSlice_ConstStr,
427 privkey_out: *mut HeapString,
428 ) -> ResultFFI;
429}
430unsafe extern "C" {
431 #[must_use]
432 pub fn sodot_ed25519_derive_private_key_from_spriv(
433 spriv: ConstStr,
434 derivation_path: ConstSlice_u32,
435 privkey_out: *mut HeapString,
436 ) -> ResultFFI;
437}
438unsafe extern "C" {
439 #[must_use]
440 pub fn sodot_ed25519_import_private_key_recipient(
441 room: Room,
442 threshold: u16,
443 keygen_init_keypair: ConstStr,
444 keygen_ids: ConstSlice_ConstStr,
445 callback: ::std::option::Option<
446 unsafe extern "C" fn(
447 extra: *mut ::std::os::raw::c_void,
448 result: ResultFFI,
449 shared_pubkey: ConstStr,
450 secret_share: ConstStr,
451 ),
452 >,
453 extra: *mut ::std::os::raw::c_void,
454 ) -> ResultFFI;
455}
456unsafe extern "C" {
457 #[must_use]
458 pub fn sodot_ed25519_import_private_key_importer(
459 room: Room,
460 threshold: u16,
461 private_key_hex: ConstStr,
462 keygen_init_keypair: ConstStr,
463 keygen_ids: ConstSlice_ConstStr,
464 is_private_key_raw: u8,
465 callback: ::std::option::Option<
466 unsafe extern "C" fn(
467 extra: *mut ::std::os::raw::c_void,
468 result: ResultFFI,
469 shared_pubkey: ConstStr,
470 secret_share: ConstStr,
471 ),
472 >,
473 extra: *mut ::std::os::raw::c_void,
474 ) -> ResultFFI;
475}
476unsafe extern "C" {
477 #[must_use]
478 pub fn sodot_bip340_keygen(
479 room: Room,
480 num_parties: u16,
481 threshold: u16,
482 keygen_init_keypair: ConstStr,
483 keygen_ids: ConstSlice_ConstStr,
484 callback: ::std::option::Option<
485 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
486 >,
487 extra: *mut ::std::os::raw::c_void,
488 ) -> ResultFFI;
489}
490unsafe extern "C" {
491 #[must_use]
492 pub fn sodot_bip340_sign(
493 room: Room,
494 secret_share: ConstStr,
495 msg_hex: ConstStr,
496 derivation_path: ConstSlice_u32,
497 opt_tweak: ConstStr,
498 callback: ::std::option::Option<
499 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, signature: ConstStr),
500 >,
501 extra: *mut ::std::os::raw::c_void,
502 ) -> ResultFFI;
503}
504unsafe extern "C" {
505 #[must_use]
506 pub fn sodot_bip340_refresh(
507 room: Room,
508 secret_share: ConstStr,
509 callback: ::std::option::Option<
510 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
511 >,
512 extra: *mut ::std::os::raw::c_void,
513 ) -> ResultFFI;
514}
515unsafe extern "C" {
516 #[must_use]
517 pub fn sodot_bip340_reshare_new_party(
518 room: Room,
519 new_threshold: u16,
520 keygen_init_keypair: ConstStr,
521 keygen_ids: ConstSlice_ConstStr,
522 callback: ::std::option::Option<
523 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
524 >,
525 extra: *mut ::std::os::raw::c_void,
526 ) -> ResultFFI;
527}
528unsafe extern "C" {
529 #[must_use]
530 pub fn sodot_bip340_reshare_remaining_party(
531 room: Room,
532 new_threshold: u16,
533 secret_share: ConstStr,
534 keygen_ids: ConstSlice_ConstStr,
535 callback: ::std::option::Option<
536 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
537 >,
538 extra: *mut ::std::os::raw::c_void,
539 ) -> ResultFFI;
540}
541unsafe extern "C" {
542 #[must_use]
543 pub fn sodot_bip340_derive_tweak_pubkey(
544 secret_share: ConstStr,
545 derivation_path: ConstSlice_u32,
546 opt_tweak: ConstStr,
547 pubkey_out: *mut HeapString,
548 ) -> ResultFFI;
549}
550unsafe extern "C" {
551 #[must_use]
552 pub fn sodot_bip340_get_xpub(secret_share: ConstStr, xpub_out: *mut HeapString) -> ResultFFI;
553}
554unsafe extern "C" {
555 #[must_use]
556 pub fn sodot_bip340_derive_pubkey_from_xpub(
557 xpub: ConstStr,
558 derivation_path: ConstSlice_u32,
559 opt_tweak: ConstStr,
560 pubkey_out: *mut HeapString,
561 ) -> ResultFFI;
562}
563unsafe extern "C" {
564 #[must_use]
565 pub fn sodot_bip340_get_export_id(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
566}
567unsafe extern "C" {
568 #[must_use]
569 pub fn sodot_bip340_export_full_private_key(
570 room: Room,
571 secret_share: ConstStr,
572 export_to: ConstStr,
573 callback: ::std::option::Option<unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, xpriv: ConstStr)>,
574 extra: *mut ::std::os::raw::c_void,
575 ) -> ResultFFI;
576}
577unsafe extern "C" {
578 #[must_use]
579 pub fn sodot_bip340_offline_export_full_private_key(secret_shares: ConstSlice_ConstStr, privkey_out: *mut HeapString)
580 -> ResultFFI;
581}
582unsafe extern "C" {
583 #[must_use]
584 pub fn sodot_bip340_derive_private_key_from_xpriv(
585 xpriv: ConstStr,
586 derivation_path: ConstSlice_u32,
587 privkey_out: *mut HeapString,
588 ) -> ResultFFI;
589}
590unsafe extern "C" {
591 #[must_use]
592 pub fn sodot_bip340_import_private_key_recipient(
593 room: Room,
594 threshold: u16,
595 keygen_init_keypair: ConstStr,
596 keygen_ids: ConstSlice_ConstStr,
597 callback: ::std::option::Option<
598 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
599 >,
600 extra: *mut ::std::os::raw::c_void,
601 ) -> ResultFFI;
602}
603unsafe extern "C" {
604 #[must_use]
605 pub fn sodot_bip340_import_private_key_importer(
606 room: Room,
607 threshold: u16,
608 private_key_hex: ConstStr,
609 keygen_init_keypair: ConstStr,
610 keygen_ids: ConstSlice_ConstStr,
611 callback: ::std::option::Option<
612 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, pubkey: ConstStr, secret_share: ConstStr),
613 >,
614 extra: *mut ::std::os::raw::c_void,
615 ) -> ResultFFI;
616}
617unsafe extern "C" {
618 #[must_use]
619 pub fn sodot_sr25519_keygen(
620 room: Room,
621 num_parties: u16,
622 threshold: u16,
623 keygen_init_keypair: ConstStr,
624 keygen_ids: ConstSlice_ConstStr,
625 callback: ::std::option::Option<
626 unsafe extern "C" fn(
627 extra: *mut ::std::os::raw::c_void,
628 result: ResultFFI,
629 shared_pubkey: ConstStr,
630 secret_share: ConstStr,
631 ),
632 >,
633 extra: *mut ::std::os::raw::c_void,
634 ) -> ResultFFI;
635}
636unsafe extern "C" {
637 #[must_use]
638 pub fn sodot_sr25519_sign(
639 room: Room,
640 secret_share: ConstStr,
641 msg_hex: ConstStr,
642 derivation_path: ConstSlice_ConstStr,
643 callback: ::std::option::Option<
644 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, signature: ConstStr),
645 >,
646 extra: *mut ::std::os::raw::c_void,
647 ) -> ResultFFI;
648}
649unsafe extern "C" {
650 #[must_use]
651 pub fn sodot_sr25519_refresh(
652 room: Room,
653 secret_share: ConstStr,
654 callback: ::std::option::Option<
655 unsafe extern "C" fn(
656 extra: *mut ::std::os::raw::c_void,
657 result: ResultFFI,
658 shared_pubkey: ConstStr,
659 secret_share: ConstStr,
660 ),
661 >,
662 extra: *mut ::std::os::raw::c_void,
663 ) -> ResultFFI;
664}
665unsafe extern "C" {
666 #[must_use]
667 pub fn sodot_sr25519_reshare_new_party(
668 room: Room,
669 new_threshold: u16,
670 keygen_init_keypair: ConstStr,
671 keygen_ids: ConstSlice_ConstStr,
672 callback: ::std::option::Option<
673 unsafe extern "C" fn(
674 extra: *mut ::std::os::raw::c_void,
675 result: ResultFFI,
676 shared_pubkey: ConstStr,
677 secret_share: ConstStr,
678 ),
679 >,
680 extra: *mut ::std::os::raw::c_void,
681 ) -> ResultFFI;
682}
683unsafe extern "C" {
684 #[must_use]
685 pub fn sodot_sr25519_reshare_remaining_party(
686 room: Room,
687 new_threshold: u16,
688 secret_share: ConstStr,
689 keygen_ids: ConstSlice_ConstStr,
690 callback: ::std::option::Option<
691 unsafe extern "C" fn(
692 extra: *mut ::std::os::raw::c_void,
693 result: ResultFFI,
694 shared_pubkey: ConstStr,
695 secret_share: ConstStr,
696 ),
697 >,
698 extra: *mut ::std::os::raw::c_void,
699 ) -> ResultFFI;
700}
701unsafe extern "C" {
702 #[must_use]
703 pub fn sodot_sr25519_derive_pubkey(
704 secret_share: ConstStr,
705 derivation_path: ConstSlice_ConstStr,
706 pubkey_out: *mut HeapString,
707 ) -> ResultFFI;
708}
709unsafe extern "C" {
710 #[must_use]
711 pub fn sodot_sr25519_get_pubkey(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
712}
713unsafe extern "C" {
714 #[must_use]
715 pub fn sodot_sr25519_derive_pubkey_from_pubkey(
716 pubkey: ConstStr,
717 derivation_path: ConstSlice_ConstStr,
718 pubkey_out: *mut HeapString,
719 ) -> ResultFFI;
720}
721unsafe extern "C" {
722 #[must_use]
723 pub fn sodot_sr25519_derive_private_key_from_private_key(
724 private_key: ConstStr,
725 is_private_key_raw: u8,
726 derivation_path: ConstSlice_ConstStr,
727 privkey_out: *mut HeapString,
728 ) -> ResultFFI;
729}
730unsafe extern "C" {
731 #[must_use]
732 pub fn sodot_sr25519_get_export_id(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
733}
734unsafe extern "C" {
735 #[must_use]
736 pub fn sodot_sr25519_export_full_private_key(
737 room: Room,
738 secret_share: ConstStr,
739 export_to: ConstStr,
740 callback: ::std::option::Option<
741 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, privkey: ConstStr),
742 >,
743 extra: *mut ::std::os::raw::c_void,
744 ) -> ResultFFI;
745}
746unsafe extern "C" {
747 #[must_use]
748 pub fn sodot_sr25519_offline_export_full_private_key(
749 secret_shares: ConstSlice_ConstStr,
750 privkey_out: *mut HeapString,
751 ) -> ResultFFI;
752}
753unsafe extern "C" {
754 #[must_use]
755 pub fn sodot_sr25519_import_private_key_recipient(
756 room: Room,
757 threshold: u16,
758 keygen_init_keypair: ConstStr,
759 keygen_ids: ConstSlice_ConstStr,
760 callback: ::std::option::Option<
761 unsafe extern "C" fn(
762 extra: *mut ::std::os::raw::c_void,
763 result: ResultFFI,
764 shared_pubkey: ConstStr,
765 secret_share: ConstStr,
766 ),
767 >,
768 extra: *mut ::std::os::raw::c_void,
769 ) -> ResultFFI;
770}
771unsafe extern "C" {
772 #[must_use]
773 pub fn sodot_sr25519_import_private_key_importer(
774 room: Room,
775 threshold: u16,
776 private_key_hex: ConstStr,
777 keygen_init_keypair: ConstStr,
778 keygen_ids: ConstSlice_ConstStr,
779 is_private_key_raw: u8,
780 callback: ::std::option::Option<
781 unsafe extern "C" fn(
782 extra: *mut ::std::os::raw::c_void,
783 result: ResultFFI,
784 shared_pubkey: ConstStr,
785 secret_share: ConstStr,
786 ),
787 >,
788 extra: *mut ::std::os::raw::c_void,
789 ) -> ResultFFI;
790}
791unsafe extern "C" {
792 #[must_use]
793 pub fn sodot_exportable_ed25519_sample_key(
794 room: Room,
795 num_parties: u16,
796 threshold: u16,
797 keygen_init_keypair: ConstStr,
798 keygen_ids: ConstSlice_ConstStr,
799 callback: ::std::option::Option<
800 unsafe extern "C" fn(
801 extra: *mut ::std::os::raw::c_void,
802 result: ResultFFI,
803 shared_pubkey: ConstStr,
804 secret_share: ConstStr,
805 ),
806 >,
807 extra: *mut ::std::os::raw::c_void,
808 ) -> ResultFFI;
809}
810unsafe extern "C" {
811 #[must_use]
812 pub fn sodot_exportable_ed25519_receive_key(
813 room: Room,
814 num_parties: u16,
815 threshold: u16,
816 keygen_init_keypair: ConstStr,
817 keygen_ids: ConstSlice_ConstStr,
818 callback: ::std::option::Option<
819 unsafe extern "C" fn(
820 extra: *mut ::std::os::raw::c_void,
821 result: ResultFFI,
822 shared_pubkey: ConstStr,
823 secret_share: ConstStr,
824 ),
825 >,
826 extra: *mut ::std::os::raw::c_void,
827 ) -> ResultFFI;
828}
829unsafe extern "C" {
830 #[must_use]
831 pub fn sodot_exportable_ed25519_sign(
832 room: Room,
833 secret_share: ConstStr,
834 msg_hex: ConstStr,
835 callback: ::std::option::Option<
836 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, signature: ConstStr),
837 >,
838 extra: *mut ::std::os::raw::c_void,
839 ) -> ResultFFI;
840}
841unsafe extern "C" {
842 #[must_use]
843 pub fn sodot_exportable_ed25519_get_pubkey(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
844}
845unsafe extern "C" {
846 #[must_use]
847 pub fn sodot_exportable_ed25519_refresh(
848 room: Room,
849 secret_share: ConstStr,
850 callback: ::std::option::Option<
851 unsafe extern "C" fn(
852 extra: *mut ::std::os::raw::c_void,
853 result: ResultFFI,
854 shared_pubkey: ConstStr,
855 secret_share: ConstStr,
856 ),
857 >,
858 extra: *mut ::std::os::raw::c_void,
859 ) -> ResultFFI;
860}
861unsafe extern "C" {
862 #[must_use]
863 pub fn sodot_exportable_ed25519_reshare_new_party(
864 room: Room,
865 new_threshold: u16,
866 keygen_init_keypair: ConstStr,
867 keygen_ids: ConstSlice_ConstStr,
868 callback: ::std::option::Option<
869 unsafe extern "C" fn(
870 extra: *mut ::std::os::raw::c_void,
871 result: ResultFFI,
872 shared_pubkey: ConstStr,
873 secret_share: ConstStr,
874 ),
875 >,
876 extra: *mut ::std::os::raw::c_void,
877 ) -> ResultFFI;
878}
879unsafe extern "C" {
880 #[must_use]
881 pub fn sodot_exportable_ed25519_reshare_remaining_party(
882 room: Room,
883 new_threshold: u16,
884 secret_share: ConstStr,
885 keygen_ids: ConstSlice_ConstStr,
886 callback: ::std::option::Option<
887 unsafe extern "C" fn(
888 extra: *mut ::std::os::raw::c_void,
889 result: ResultFFI,
890 shared_pubkey: ConstStr,
891 secret_share: ConstStr,
892 ),
893 >,
894 extra: *mut ::std::os::raw::c_void,
895 ) -> ResultFFI;
896}
897unsafe extern "C" {
898 #[must_use]
899 pub fn sodot_exportable_ed25519_get_export_id(secret_share: ConstStr, pubkey_out: *mut HeapString) -> ResultFFI;
900}
901unsafe extern "C" {
902 #[must_use]
903 pub fn sodot_exportable_ed25519_export_full_private_key(
904 room: Room,
905 secret_share: ConstStr,
906 export_to: ConstStr,
907 callback: ::std::option::Option<
908 unsafe extern "C" fn(extra: *mut ::std::os::raw::c_void, result: ResultFFI, private_key: ConstStr),
909 >,
910 extra: *mut ::std::os::raw::c_void,
911 ) -> ResultFFI;
912}
913unsafe extern "C" {
914 #[must_use]
915 pub fn sodot_exportable_ed25519_offline_export_full_private_key(
916 secret_shares: ConstSlice_ConstStr,
917 privkey_out: *mut HeapString,
918 ) -> ResultFFI;
919}
920unsafe extern "C" {
921 #[must_use]
922 pub fn sodot_exportable_ed25519_import_private_key_recipient(
923 room: Room,
924 threshold: u16,
925 keygen_init_keypair: ConstStr,
926 keygen_ids: ConstSlice_ConstStr,
927 callback: ::std::option::Option<
928 unsafe extern "C" fn(
929 extra: *mut ::std::os::raw::c_void,
930 result: ResultFFI,
931 shared_pubkey: ConstStr,
932 secret_share: ConstStr,
933 ),
934 >,
935 extra: *mut ::std::os::raw::c_void,
936 ) -> ResultFFI;
937}
938unsafe extern "C" {
939 #[must_use]
940 pub fn sodot_exportable_ed25519_import_private_key_importer(
941 room: Room,
942 threshold: u16,
943 private_key_bytes: ConstStr,
944 keygen_init_keypair: ConstStr,
945 keygen_ids: ConstSlice_ConstStr,
946 callback: ::std::option::Option<
947 unsafe extern "C" fn(
948 extra: *mut ::std::os::raw::c_void,
949 result: ResultFFI,
950 shared_pubkey: ConstStr,
951 secret_share: ConstStr,
952 ),
953 >,
954 extra: *mut ::std::os::raw::c_void,
955 ) -> ResultFFI;
956}