-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfilcrypto.h
709 lines (593 loc) · 23 KB
/
filcrypto.h
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
/* filcrypto Header */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef filcrypto_H
#define filcrypto_H
/* Generated with cbindgen:0.14.0 */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define DIGEST_BYTES 96
#define PRIVATE_KEY_BYTES 32
#define PUBLIC_KEY_BYTES 48
#define SIGNATURE_BYTES 96
typedef enum {
FCPResponseStatus_FCPNoError = 0,
FCPResponseStatus_FCPUnclassifiedError = 1,
FCPResponseStatus_FCPCallerError = 2,
FCPResponseStatus_FCPReceiverError = 3,
} FCPResponseStatus;
typedef enum {
fil_RegisteredPoStProof_StackedDrgWinning2KiBV1,
fil_RegisteredPoStProof_StackedDrgWinning8MiBV1,
fil_RegisteredPoStProof_StackedDrgWinning512MiBV1,
fil_RegisteredPoStProof_StackedDrgWinning32GiBV1,
fil_RegisteredPoStProof_StackedDrgWinning64GiBV1,
fil_RegisteredPoStProof_StackedDrgWindow2KiBV1,
fil_RegisteredPoStProof_StackedDrgWindow8MiBV1,
fil_RegisteredPoStProof_StackedDrgWindow512MiBV1,
fil_RegisteredPoStProof_StackedDrgWindow32GiBV1,
fil_RegisteredPoStProof_StackedDrgWindow64GiBV1,
} fil_RegisteredPoStProof;
typedef enum {
fil_RegisteredSealProof_StackedDrg2KiBV1,
fil_RegisteredSealProof_StackedDrg8MiBV1,
fil_RegisteredSealProof_StackedDrg512MiBV1,
fil_RegisteredSealProof_StackedDrg32GiBV1,
fil_RegisteredSealProof_StackedDrg64GiBV1,
} fil_RegisteredSealProof;
typedef struct {
uint8_t inner[SIGNATURE_BYTES];
} fil_BLSSignature;
/**
* AggregateResponse
*/
typedef struct {
fil_BLSSignature signature;
} fil_AggregateResponse;
typedef struct {
const char *error_msg;
FCPResponseStatus status_code;
} fil_ClearCacheResponse;
typedef struct {
const char *error_msg;
FCPResponseStatus status_code;
uint8_t commitment[32];
} fil_FauxRepResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
uint8_t ticket[32];
} fil_FinalizeTicketResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
uint8_t comm_d[32];
} fil_GenerateDataCommitmentResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
uint8_t comm_p[32];
/**
* The number of unpadded bytes in the original piece plus any (unpadded)
* alignment bytes added to create a whole merkle tree.
*/
uint64_t num_bytes_aligned;
} fil_GeneratePieceCommitmentResponse;
typedef struct {
fil_RegisteredPoStProof registered_proof;
size_t proof_len;
const uint8_t *proof_ptr;
} fil_PoStProof;
typedef struct {
const char *error_msg;
size_t proofs_len;
const fil_PoStProof *proofs_ptr;
size_t faulty_sectors_len;
const uint64_t *faulty_sectors_ptr;
FCPResponseStatus status_code;
} fil_GenerateWindowPoStResponse;
typedef struct {
const char *error_msg;
size_t proofs_len;
const fil_PoStProof *proofs_ptr;
FCPResponseStatus status_code;
} fil_GenerateWinningPoStResponse;
typedef struct {
const char *error_msg;
FCPResponseStatus status_code;
const uint64_t *ids_ptr;
size_t ids_len;
} fil_GenerateWinningPoStSectorChallenge;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
size_t devices_len;
const char *const *devices_ptr;
} fil_GpuDeviceResponse;
typedef struct {
uint8_t inner[DIGEST_BYTES];
} fil_BLSDigest;
/**
* HashResponse
*/
typedef struct {
fil_BLSDigest digest;
} fil_HashResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
} fil_InitLogFdResponse;
typedef struct {
uint8_t inner[PRIVATE_KEY_BYTES];
} fil_BLSPrivateKey;
/**
* PrivateKeyGenerateResponse
*/
typedef struct {
fil_BLSPrivateKey private_key;
} fil_PrivateKeyGenerateResponse;
typedef struct {
uint8_t inner[PUBLIC_KEY_BYTES];
} fil_BLSPublicKey;
/**
* PrivateKeyPublicKeyResponse
*/
typedef struct {
fil_BLSPublicKey public_key;
} fil_PrivateKeyPublicKeyResponse;
/**
* PrivateKeySignResponse
*/
typedef struct {
fil_BLSSignature signature;
} fil_PrivateKeySignResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
const uint8_t *seal_commit_phase1_output_ptr;
size_t seal_commit_phase1_output_len;
} fil_SealCommitPhase1Response;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
const uint8_t *proof_ptr;
size_t proof_len;
} fil_SealCommitPhase2Response;
typedef struct {
const char *error_msg;
FCPResponseStatus status_code;
const uint8_t *seal_pre_commit_phase1_output_ptr;
size_t seal_pre_commit_phase1_output_len;
} fil_SealPreCommitPhase1Response;
typedef struct {
const char *error_msg;
FCPResponseStatus status_code;
fil_RegisteredSealProof registered_proof;
uint8_t comm_d[32];
uint8_t comm_r[32];
} fil_SealPreCommitPhase2Response;
/**
*
*/
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
const char *string_val;
} fil_StringResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
} fil_UnsealRangeResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
bool is_valid;
} fil_VerifySealResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
bool is_valid;
} fil_VerifyWindowPoStResponse;
typedef struct {
FCPResponseStatus status_code;
const char *error_msg;
bool is_valid;
} fil_VerifyWinningPoStResponse;
typedef struct {
uint8_t comm_p[32];
const char *error_msg;
uint64_t left_alignment_unpadded;
FCPResponseStatus status_code;
uint64_t total_write_unpadded;
} fil_WriteWithAlignmentResponse;
typedef struct {
uint8_t comm_p[32];
const char *error_msg;
FCPResponseStatus status_code;
uint64_t total_write_unpadded;
} fil_WriteWithoutAlignmentResponse;
typedef struct {
uint64_t num_bytes;
uint8_t comm_p[32];
} fil_PublicPieceInfo;
typedef struct {
uint8_t inner[32];
} fil_32ByteArray;
typedef struct {
fil_RegisteredPoStProof registered_proof;
const char *cache_dir_path;
uint8_t comm_r[32];
const char *replica_path;
uint64_t sector_id;
} fil_PrivateReplicaInfo;
typedef struct {
fil_RegisteredPoStProof registered_proof;
uint8_t comm_r[32];
uint64_t sector_id;
} fil_PublicReplicaInfo;
/**
* Aggregate signatures together into a new signature
*
* # Arguments
*
* * `flattened_signatures_ptr` - pointer to a byte array containing signatures
* * `flattened_signatures_len` - length of the byte array (multiple of SIGNATURE_BYTES)
*
* Returns `NULL` on error. Result must be freed using `destroy_aggregate_response`.
*/
fil_AggregateResponse *fil_aggregate(const uint8_t *flattened_signatures_ptr,
size_t flattened_signatures_len);
fil_ClearCacheResponse *fil_clear_cache(uint64_t sector_size, const char *cache_dir_path);
void fil_destroy_aggregate_response(fil_AggregateResponse *ptr);
void fil_destroy_clear_cache_response(fil_ClearCacheResponse *ptr);
void fil_destroy_fauxrep_response(fil_FauxRepResponse *ptr);
void fil_destroy_finalize_ticket_response(fil_FinalizeTicketResponse *ptr);
void fil_destroy_generate_data_commitment_response(fil_GenerateDataCommitmentResponse *ptr);
void fil_destroy_generate_piece_commitment_response(fil_GeneratePieceCommitmentResponse *ptr);
void fil_destroy_generate_window_post_response(fil_GenerateWindowPoStResponse *ptr);
void fil_destroy_generate_winning_post_response(fil_GenerateWinningPoStResponse *ptr);
void fil_destroy_generate_winning_post_sector_challenge(fil_GenerateWinningPoStSectorChallenge *ptr);
void fil_destroy_gpu_device_response(fil_GpuDeviceResponse *ptr);
void fil_destroy_hash_response(fil_HashResponse *ptr);
void fil_destroy_init_log_fd_response(fil_InitLogFdResponse *ptr);
void fil_destroy_private_key_generate_response(fil_PrivateKeyGenerateResponse *ptr);
void fil_destroy_private_key_public_key_response(fil_PrivateKeyPublicKeyResponse *ptr);
void fil_destroy_private_key_sign_response(fil_PrivateKeySignResponse *ptr);
void fil_destroy_seal_commit_phase1_response(fil_SealCommitPhase1Response *ptr);
void fil_destroy_seal_commit_phase2_response(fil_SealCommitPhase2Response *ptr);
void fil_destroy_seal_pre_commit_phase1_response(fil_SealPreCommitPhase1Response *ptr);
void fil_destroy_seal_pre_commit_phase2_response(fil_SealPreCommitPhase2Response *ptr);
void fil_destroy_string_response(fil_StringResponse *ptr);
void fil_destroy_unseal_range_response(fil_UnsealRangeResponse *ptr);
/**
* Deallocates a VerifySealResponse.
*
*/
void fil_destroy_verify_seal_response(fil_VerifySealResponse *ptr);
void fil_destroy_verify_window_post_response(fil_VerifyWindowPoStResponse *ptr);
/**
* Deallocates a VerifyPoStResponse.
*
*/
void fil_destroy_verify_winning_post_response(fil_VerifyWinningPoStResponse *ptr);
void fil_destroy_write_with_alignment_response(fil_WriteWithAlignmentResponse *ptr);
void fil_destroy_write_without_alignment_response(fil_WriteWithoutAlignmentResponse *ptr);
fil_FauxRepResponse *fil_fauxrep(fil_RegisteredSealProof registered_proof,
const char *cache_dir_path,
const char *sealed_sector_path);
fil_FauxRepResponse *fil_fauxrep2(fil_RegisteredSealProof registered_proof,
const char *cache_dir_path,
const char *existing_p_aux_path);
/**
* Returns the merkle root for a sector containing the provided pieces.
*/
fil_GenerateDataCommitmentResponse *fil_generate_data_commitment(fil_RegisteredSealProof registered_proof,
const fil_PublicPieceInfo *pieces_ptr,
size_t pieces_len);
/**
* Returns the merkle root for a piece after piece padding and alignment.
* The caller is responsible for closing the passed in file descriptor.
*/
fil_GeneratePieceCommitmentResponse *fil_generate_piece_commitment(fil_RegisteredSealProof registered_proof,
int piece_fd_raw,
uint64_t unpadded_piece_size);
/**
* TODO: document
*
*/
fil_GenerateWindowPoStResponse *fil_generate_window_post(fil_32ByteArray randomness,
const fil_PrivateReplicaInfo *replicas_ptr,
size_t replicas_len,
fil_32ByteArray prover_id);
/**
* TODO: document
*
*/
fil_GenerateWinningPoStResponse *fil_generate_winning_post(fil_32ByteArray randomness,
const fil_PrivateReplicaInfo *replicas_ptr,
size_t replicas_len,
fil_32ByteArray prover_id);
/**
* TODO: document
*
*/
fil_GenerateWinningPoStSectorChallenge *fil_generate_winning_post_sector_challenge(fil_RegisteredPoStProof registered_proof,
fil_32ByteArray randomness,
uint64_t sector_set_len,
fil_32ByteArray prover_id);
/**
* Returns an array of strings containing the device names that can be used.
*/
fil_GpuDeviceResponse *fil_get_gpu_devices(void);
/**
* Returns the number of user bytes that will fit into a staged sector.
*
*/
uint64_t fil_get_max_user_bytes_per_staged_sector(fil_RegisteredSealProof registered_proof);
/**
* Returns the identity of the circuit for the provided PoSt proof type.
*
*/
fil_StringResponse *fil_get_post_circuit_identifier(fil_RegisteredPoStProof registered_proof);
/**
* Returns the CID of the Groth parameter file for generating a PoSt.
*
*/
fil_StringResponse *fil_get_post_params_cid(fil_RegisteredPoStProof registered_proof);
/**
* Returns the path from which the proofs library expects to find the Groth
* parameter file used when generating a PoSt.
*
*/
fil_StringResponse *fil_get_post_params_path(fil_RegisteredPoStProof registered_proof);
/**
* Returns the CID of the verifying key-file for verifying a PoSt proof.
*
*/
fil_StringResponse *fil_get_post_verifying_key_cid(fil_RegisteredPoStProof registered_proof);
/**
* Returns the path from which the proofs library expects to find the verifying
* key-file used when verifying a PoSt proof.
*
*/
fil_StringResponse *fil_get_post_verifying_key_path(fil_RegisteredPoStProof registered_proof);
/**
* Returns the version of the provided seal proof.
*
*/
fil_StringResponse *fil_get_post_version(fil_RegisteredPoStProof registered_proof);
/**
* Returns the identity of the circuit for the provided seal proof.
*
*/
fil_StringResponse *fil_get_seal_circuit_identifier(fil_RegisteredSealProof registered_proof);
/**
* Returns the CID of the Groth parameter file for sealing.
*
*/
fil_StringResponse *fil_get_seal_params_cid(fil_RegisteredSealProof registered_proof);
/**
* Returns the path from which the proofs library expects to find the Groth
* parameter file used when sealing.
*
*/
fil_StringResponse *fil_get_seal_params_path(fil_RegisteredSealProof registered_proof);
/**
* Returns the CID of the verifying key-file for verifying a seal proof.
*
*/
fil_StringResponse *fil_get_seal_verifying_key_cid(fil_RegisteredSealProof registered_proof);
/**
* Returns the path from which the proofs library expects to find the verifying
* key-file used when verifying a seal proof.
*
*/
fil_StringResponse *fil_get_seal_verifying_key_path(fil_RegisteredSealProof registered_proof);
/**
* Returns the version of the provided seal proof type.
*
*/
fil_StringResponse *fil_get_seal_version(fil_RegisteredSealProof registered_proof);
/**
* Compute the digest of a message
*
* # Arguments
*
* * `message_ptr` - pointer to a message byte array
* * `message_len` - length of the byte array
*/
fil_HashResponse *fil_hash(const uint8_t *message_ptr, size_t message_len);
/**
* Verify that a signature is the aggregated signature of the hhashed messages
*
* # Arguments
*
* * `signature_ptr` - pointer to a signature byte array (SIGNATURE_BYTES long)
* * `messages_ptr` - pointer to an array containing the pointers to the messages
* * `messages_sizes_ptr` - pointer to an array containing the lengths of the messages
* * `messages_len` - length of the two messages arrays
* * `flattened_public_keys_ptr` - pointer to a byte array containing public keys
* * `flattened_public_keys_len` - length of the array
*/
int fil_hash_verify(const uint8_t *signature_ptr,
const uint8_t *flattened_messages_ptr,
size_t flattened_messages_len,
const size_t *message_sizes_ptr,
size_t message_sizes_len,
const uint8_t *flattened_public_keys_ptr,
size_t flattened_public_keys_len);
/**
* Initializes the logger with a file descriptor where logs will be logged into.
*
* This is usually a pipe that was opened on the receiving side of the logs. The logger is
* initialized on the invocation, subsequent calls won't have any effect.
*
* This function must be called right at the start, before any other call. Else the logger will
* be initializes implicitely and log to stderr.
*/
fil_InitLogFdResponse *fil_init_log_fd(int log_fd);
/**
* Generate a new private key
*/
fil_PrivateKeyGenerateResponse *fil_private_key_generate(void);
/**
* Generate a new private key with seed
*
* **Warning**: Use this function only for testing or with very secure seeds
*
* # Arguments
*
* * `raw_seed` - a seed byte array with 32 bytes
*
* Returns `NULL` when passed a NULL pointer.
*/
fil_PrivateKeyGenerateResponse *fil_private_key_generate_with_seed(fil_32ByteArray raw_seed);
/**
* Generate the public key for a private key
*
* # Arguments
*
* * `raw_private_key_ptr` - pointer to a private key byte array
*
* Returns `NULL` when passed invalid arguments.
*/
fil_PrivateKeyPublicKeyResponse *fil_private_key_public_key(const uint8_t *raw_private_key_ptr);
/**
* Sign a message with a private key and return the signature
*
* # Arguments
*
* * `raw_private_key_ptr` - pointer to a private key byte array
* * `message_ptr` - pointer to a message byte array
* * `message_len` - length of the byte array
*
* Returns `NULL` when passed invalid arguments.
*/
fil_PrivateKeySignResponse *fil_private_key_sign(const uint8_t *raw_private_key_ptr,
const uint8_t *message_ptr,
size_t message_len);
/**
* TODO: document
*
*/
fil_SealCommitPhase1Response *fil_seal_commit_phase1(fil_RegisteredSealProof registered_proof,
fil_32ByteArray comm_r,
fil_32ByteArray comm_d,
const char *cache_dir_path,
const char *replica_path,
uint64_t sector_id,
fil_32ByteArray prover_id,
fil_32ByteArray ticket,
fil_32ByteArray seed,
const fil_PublicPieceInfo *pieces_ptr,
size_t pieces_len);
fil_SealCommitPhase2Response *fil_seal_commit_phase2(const uint8_t *seal_commit_phase1_output_ptr,
size_t seal_commit_phase1_output_len,
uint64_t sector_id,
fil_32ByteArray prover_id);
/**
* TODO: document
*
*/
fil_SealPreCommitPhase1Response *fil_seal_pre_commit_phase1(fil_RegisteredSealProof registered_proof,
const char *cache_dir_path,
const char *staged_sector_path,
const char *sealed_sector_path,
uint64_t sector_id,
fil_32ByteArray prover_id,
fil_32ByteArray ticket,
const fil_PublicPieceInfo *pieces_ptr,
size_t pieces_len);
/**
* TODO: document
*
*/
fil_SealPreCommitPhase2Response *fil_seal_pre_commit_phase2(const uint8_t *seal_pre_commit_phase1_output_ptr,
size_t seal_pre_commit_phase1_output_len,
const char *cache_dir_path,
const char *sealed_sector_path);
/**
* TODO: document
*/
fil_UnsealRangeResponse *fil_unseal_range(fil_RegisteredSealProof registered_proof,
const char *cache_dir_path,
int sealed_sector_fd_raw,
int unseal_output_fd_raw,
uint64_t sector_id,
fil_32ByteArray prover_id,
fil_32ByteArray ticket,
fil_32ByteArray comm_d,
uint64_t unpadded_byte_index,
uint64_t unpadded_bytes_amount);
/**
* Verify that a signature is the aggregated signature of hashes - pubkeys
*
* # Arguments
*
* * `signature_ptr` - pointer to a signature byte array (SIGNATURE_BYTES long)
* * `flattened_digests_ptr` - pointer to a byte array containing digests
* * `flattened_digests_len` - length of the byte array (multiple of DIGEST_BYTES)
* * `flattened_public_keys_ptr` - pointer to a byte array containing public keys
* * `flattened_public_keys_len` - length of the array
*/
int fil_verify(const uint8_t *signature_ptr,
const uint8_t *flattened_digests_ptr,
size_t flattened_digests_len,
const uint8_t *flattened_public_keys_ptr,
size_t flattened_public_keys_len);
/**
* Verifies the output of seal.
*
*/
fil_VerifySealResponse *fil_verify_seal(fil_RegisteredSealProof registered_proof,
fil_32ByteArray comm_r,
fil_32ByteArray comm_d,
fil_32ByteArray prover_id,
fil_32ByteArray ticket,
fil_32ByteArray seed,
uint64_t sector_id,
const uint8_t *proof_ptr,
size_t proof_len);
/**
* Verifies that a proof-of-spacetime is valid.
*/
fil_VerifyWindowPoStResponse *fil_verify_window_post(fil_32ByteArray randomness,
const fil_PublicReplicaInfo *replicas_ptr,
size_t replicas_len,
const fil_PoStProof *proofs_ptr,
size_t proofs_len,
fil_32ByteArray prover_id);
/**
* Verifies that a proof-of-spacetime is valid.
*/
fil_VerifyWinningPoStResponse *fil_verify_winning_post(fil_32ByteArray randomness,
const fil_PublicReplicaInfo *replicas_ptr,
size_t replicas_len,
const fil_PoStProof *proofs_ptr,
size_t proofs_len,
fil_32ByteArray prover_id);
/**
* TODO: document
*
*/
fil_WriteWithAlignmentResponse *fil_write_with_alignment(fil_RegisteredSealProof registered_proof,
int src_fd,
uint64_t src_size,
int dst_fd,
const uint64_t *existing_piece_sizes_ptr,
size_t existing_piece_sizes_len);
/**
* TODO: document
*
*/
fil_WriteWithoutAlignmentResponse *fil_write_without_alignment(fil_RegisteredSealProof registered_proof,
int src_fd,
uint64_t src_size,
int dst_fd);
#endif /* filcrypto_H */
#ifdef __cplusplus
} /* extern "C" */
#endif