Skip to content

Commit

Permalink
Updated prover.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
5eeman committed Jun 20, 2024
1 parent 517e85d commit 3e6852c
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 85 deletions.
10 changes: 5 additions & 5 deletions Libs/Rapidsnark.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_arm64e</string>
<string>ios-arm64-simulator</string>
<key>LibraryPath</key>
<string>librapidsnarkmerged.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64e</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>librapidsnarkmerged.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64-simulator</string>
<string>ios-arm64_arm64e</string>
<key>LibraryPath</key>
<string>librapidsnarkmerged.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64e</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
49 changes: 34 additions & 15 deletions Libs/Rapidsnark.xcframework/ios-arm64-simulator/Headers/prover.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,54 @@ extern "C" {

/**
* Calculates buffer size to output public signals as json string
* @returns buffer size in bytes or 0 in case of an error
* @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
*/
unsigned long CalcPublicBufferSize(const void *zkey_buffer, unsigned long zkey_size);
int
groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
size_t *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_public_size_for_zkey_file calculates minimum buffer size for
* JSON-formatted public signals. The calculated buffer size is written
* to the public_size variable.
*
* @return error code:
* PROVER_OK (0) - in case of success
* PROVER_ERROR - in case of an error, error_msg contains the error message
*/
int
groth16_public_size_for_zkey_file(const char *zkey_fname,
unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover_zkey_file
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

#ifdef __cplusplus
}
Expand Down
Binary file not shown.
49 changes: 34 additions & 15 deletions Libs/Rapidsnark.xcframework/ios-arm64_arm64e/Headers/prover.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,54 @@ extern "C" {

/**
* Calculates buffer size to output public signals as json string
* @returns buffer size in bytes or 0 in case of an error
* @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
*/
unsigned long CalcPublicBufferSize(const void *zkey_buffer, unsigned long zkey_size);
int
groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
size_t *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_public_size_for_zkey_file calculates minimum buffer size for
* JSON-formatted public signals. The calculated buffer size is written
* to the public_size variable.
*
* @return error code:
* PROVER_OK (0) - in case of success
* PROVER_ERROR - in case of an error, error_msg contains the error message
*/
int
groth16_public_size_for_zkey_file(const char *zkey_fname,
unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover_zkey_file
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

#ifdef __cplusplus
}
Expand Down
Binary file not shown.
10 changes: 5 additions & 5 deletions xcframework/Rapidsnark.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_arm64e</string>
<string>ios-arm64-simulator</string>
<key>LibraryPath</key>
<string>librapidsnarkmerged.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64e</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>librapidsnarkmerged.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64-simulator</string>
<string>ios-arm64_arm64e</string>
<key>LibraryPath</key>
<string>librapidsnarkmerged.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64e</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,54 @@ extern "C" {

/**
* Calculates buffer size to output public signals as json string
* @returns buffer size in bytes or 0 in case of an error
* @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
*/
unsigned long CalcPublicBufferSize(const void *zkey_buffer, unsigned long zkey_size);
int
groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
size_t *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_public_size_for_zkey_file calculates minimum buffer size for
* JSON-formatted public signals. The calculated buffer size is written
* to the public_size variable.
*
* @return error code:
* PROVER_OK (0) - in case of success
* PROVER_ERROR - in case of an error, error_msg contains the error message
*/
int
groth16_public_size_for_zkey_file(const char *zkey_fname,
unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover_zkey_file
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

#ifdef __cplusplus
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,54 @@ extern "C" {

/**
* Calculates buffer size to output public signals as json string
* @returns buffer size in bytes or 0 in case of an error
* @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
*/
unsigned long CalcPublicBufferSize(const void *zkey_buffer, unsigned long zkey_size);
int
groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
size_t *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_public_size_for_zkey_file calculates minimum buffer size for
* JSON-formatted public signals. The calculated buffer size is written
* to the public_size variable.
*
* @return error code:
* PROVER_OK (0) - in case of success
* PROVER_ERROR - in case of an error, error_msg contains the error message
*/
int
groth16_public_size_for_zkey_file(const char *zkey_fname,
unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover(const void *zkey_buffer, unsigned long zkey_size,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

/**
* groth16_prover_zkey_file
* groth16_prover
* @return error code:
* PROVER_OK - in case of success
* PROVER_ERROR - in case of an error
* PPOVER_ERROR - in case of an error
* PROVER_ERROR_SHORT_BUFFER - in case of a short buffer error, also updates proof_size and public_size with actual proof and public sizess
*/
int groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);
int
groth16_prover_zkey_file(const char *zkey_file_path,
const void *wtns_buffer, unsigned long wtns_size,
char *proof_buffer, unsigned long *proof_size,
char *public_buffer, unsigned long *public_size,
char *error_msg, unsigned long error_msg_maxsize);

#ifdef __cplusplus
}
Expand Down
Binary file not shown.
Loading

0 comments on commit 3e6852c

Please sign in to comment.