diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/.swiftpm/xcode/package.xcworkspace/xcuserdata/moria.xcuserdatad/UserInterfaceState.xcuserstate b/.swiftpm/xcode/package.xcworkspace/xcuserdata/moria.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..5efb5a2
Binary files /dev/null and b/.swiftpm/xcode/package.xcworkspace/xcuserdata/moria.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/.swiftpm/xcode/xcuserdata/moria.xcuserdatad/xcschemes/xcschememanagement.plist b/.swiftpm/xcode/xcuserdata/moria.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..bffb75d
--- /dev/null
+++ b/.swiftpm/xcode/xcuserdata/moria.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ SchemeUserState
+
+ LibIden3.xcscheme_^#shared#^_
+
+ orderHint
+ 0
+
+
+ SuppressBuildableAutocreation
+
+ LibIden3
+
+ primary
+
+
+
+
+
diff --git a/Iden3CLibrary.xcframework/Info.plist b/Iden3CLibrary.xcframework/Info.plist
index d66f495..79c15b4 100644
--- a/Iden3CLibrary.xcframework/Info.plist
+++ b/Iden3CLibrary.xcframework/Info.plist
@@ -6,54 +6,54 @@
BinaryPath
- libpolygonid-ios-sim.a
+ libpolygonid-ios.a
HeadersPath
Headers
LibraryIdentifier
- ios-arm64_x86_64-simulator
+ ios-arm64
LibraryPath
- libpolygonid-ios-sim.a
+ libpolygonid-ios.a
SupportedArchitectures
arm64
- x86_64
SupportedPlatform
ios
- SupportedPlatformVariant
- simulator
BinaryPath
- libpolygonid-ios.a
+ libpolygonid-macos.a
HeadersPath
Headers
LibraryIdentifier
- ios-arm64
+ macos-arm64
LibraryPath
- libpolygonid-ios.a
+ libpolygonid-macos.a
SupportedArchitectures
arm64
SupportedPlatform
- ios
+ macos
BinaryPath
- libpolygonid-macos.a
+ libpolygonid-ios-sim.a
HeadersPath
Headers
LibraryIdentifier
- macos-arm64
+ ios-arm64_x86_64-simulator
LibraryPath
- libpolygonid-macos.a
+ libpolygonid-ios-sim.a
SupportedArchitectures
arm64
+ x86_64
SupportedPlatform
- macos
+ ios
+ SupportedPlatformVariant
+ simulator
CFBundlePackageType
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid-prover.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid-prover.h
deleted file mode 100644
index f65e7be..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid-prover.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROVER_HPP
-#define PROVER_HPP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//Error codes returned by the functions.
-#define PROVER_OK 0x0
-#define PROVER_ERROR 0x1
-#define PROVER_ERROR_SHORT_BUFFER 0x2
-#define PROVER_INVALID_WITNESS_LENGTH 0x3
-
-/**
- * Calculates buffer size to output public signals as json string
- * @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
- */
-int
-groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
- unsigned long *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
- * 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);
-
-/**
- * groth16_prover
- * @return error code:
- * PROVER_OK - in case of success
- * 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);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // PROVER_HPP
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid.h
index 66eeaf8..59f1ad4 100644
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid.h
+++ b/Iden3CLibrary.xcframework/ios-arm64/Headers/libpolygonid.h
@@ -28,6 +28,22 @@ typedef enum
{
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
+ // error extracting credential status from verifiable credential
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ // error resolving credential status (e.g. getting the status from chain of DHS)
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ // error getting merkletree proof from credential status
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ // merkletree proof is invalid
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ // credential is revoked
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_REVOKED_ERROR,
+ // the same as above but for issuer credential (for signature proofs)
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_REVOKED_ERROR,
} PLGNStatusCode;
typedef struct _PLGNStatus
@@ -189,7 +205,13 @@ extern GoUint8 PLGNAtomicQueryV3OnChainInputs(char** jsonResponse, char* in, cha
//
extern GoUint8 PLGNALinkedMultiQueryInputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
extern void PLGNFreeStatus(PLGNStatus* status);
+
+// Deprecated: Use PLGNCleanCache2 instead. We need to support consistent path
+// to the cache directory. This function supposed the cache directory is empty
+// and should be calculated based on user's $HOME directory.
+//
extern GoUint8 PLGNCleanCache(PLGNStatus** status);
+extern GoUint8 PLGNCleanCache2(char* cfg, PLGNStatus** status);
extern GoUint8 PLGNCacheCredentials(char* in, char* cfg, PLGNStatus** status);
// PLGNW3CCredentialFromOnchainHex returns a verifiable credential from an onchain data hex string.
@@ -227,6 +249,11 @@ extern GoUint8 PLGNW3CCredentialFromOnchainHex(char** jsonResponse, char* in, ch
// }
//
extern GoUint8 PLGNDescribeID(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubSignPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubVerifyPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPrivate2Public(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicUncompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicCompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
#ifdef __cplusplus
}
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/module.modulemap b/Iden3CLibrary.xcframework/ios-arm64/Headers/module.modulemap
deleted file mode 100644
index 788620c..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/module.modulemap
+++ /dev/null
@@ -1,15 +0,0 @@
-module CPolygonID {
- header "libpolygonid.h"
- export *
-}
-module WitnessCalc {
- header "witnesscalc_authV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2OnChain.h"
- header "witnesscalc_credentialAtomicQuerySigV2.h"
- header "witnesscalc_credentialAtomicQuerySigV2OnChain.h"
- header "witnesscalc_credentialAtomicQueryV3.h"
- header "witnesscalc_credentialAtomicQueryV3OnChain.h"
- header "witnesscalc_linkedMultiQuery10.h"
- export *
-}
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc.h
deleted file mode 100644
index d663cc9..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef WITNESSCALC_H
-#define WITNESSCALC_H
-
-namespace CIRCUIT_NAME {
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-/**
- * A wrapper function for `witnesscalc` that takes the circuit as a .dat file
- * name instead of a buffer.
- */
-int
-witnesscalc_from_dat_file(
- const char *dat_fname,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-} // namespace
-
-#endif // WITNESSCALC_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_authV2.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_authV2.h
deleted file mode 100644
index 72b1f72..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_authV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_AUTHV2_H
-#define WITNESSCALC_AUTHV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_authV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_AUTHV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
deleted file mode 100644
index d2b80cf..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
deleted file mode 100644
index 013885c..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h
deleted file mode 100644
index f03309b..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
deleted file mode 100644
index e55016d..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h
deleted file mode 100644
index 50dfbfe..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
deleted file mode 100644
index c958b7b..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_linkedMultiQuery10.h b/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_linkedMultiQuery10.h
deleted file mode 100644
index 5702486..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64/Headers/witnesscalc_linkedMultiQuery10.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_LINKEDMULTIQUERY10_H
-#define WITNESSCALC_LINKEDMULTIQUERY10_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_linkedMultiQuery10(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_LINKEDMULTIQUERY10_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64/libpolygonid-ios.a b/Iden3CLibrary.xcframework/ios-arm64/libpolygonid-ios.a
index 87c25a9..a1af5d0 100644
Binary files a/Iden3CLibrary.xcframework/ios-arm64/libpolygonid-ios.a and b/Iden3CLibrary.xcframework/ios-arm64/libpolygonid-ios.a differ
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid-prover.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid-prover.h
deleted file mode 100644
index f65e7be..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid-prover.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROVER_HPP
-#define PROVER_HPP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//Error codes returned by the functions.
-#define PROVER_OK 0x0
-#define PROVER_ERROR 0x1
-#define PROVER_ERROR_SHORT_BUFFER 0x2
-#define PROVER_INVALID_WITNESS_LENGTH 0x3
-
-/**
- * Calculates buffer size to output public signals as json string
- * @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
- */
-int
-groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
- unsigned long *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
- * 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);
-
-/**
- * groth16_prover
- * @return error code:
- * PROVER_OK - in case of success
- * 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);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // PROVER_HPP
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid.h
index 66eeaf8..59f1ad4 100644
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid.h
+++ b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/libpolygonid.h
@@ -28,6 +28,22 @@ typedef enum
{
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
+ // error extracting credential status from verifiable credential
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ // error resolving credential status (e.g. getting the status from chain of DHS)
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ // error getting merkletree proof from credential status
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ // merkletree proof is invalid
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ // credential is revoked
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_REVOKED_ERROR,
+ // the same as above but for issuer credential (for signature proofs)
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_REVOKED_ERROR,
} PLGNStatusCode;
typedef struct _PLGNStatus
@@ -189,7 +205,13 @@ extern GoUint8 PLGNAtomicQueryV3OnChainInputs(char** jsonResponse, char* in, cha
//
extern GoUint8 PLGNALinkedMultiQueryInputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
extern void PLGNFreeStatus(PLGNStatus* status);
+
+// Deprecated: Use PLGNCleanCache2 instead. We need to support consistent path
+// to the cache directory. This function supposed the cache directory is empty
+// and should be calculated based on user's $HOME directory.
+//
extern GoUint8 PLGNCleanCache(PLGNStatus** status);
+extern GoUint8 PLGNCleanCache2(char* cfg, PLGNStatus** status);
extern GoUint8 PLGNCacheCredentials(char* in, char* cfg, PLGNStatus** status);
// PLGNW3CCredentialFromOnchainHex returns a verifiable credential from an onchain data hex string.
@@ -227,6 +249,11 @@ extern GoUint8 PLGNW3CCredentialFromOnchainHex(char** jsonResponse, char* in, ch
// }
//
extern GoUint8 PLGNDescribeID(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubSignPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubVerifyPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPrivate2Public(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicUncompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicCompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
#ifdef __cplusplus
}
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
deleted file mode 100644
index 788620c..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
+++ /dev/null
@@ -1,15 +0,0 @@
-module CPolygonID {
- header "libpolygonid.h"
- export *
-}
-module WitnessCalc {
- header "witnesscalc_authV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2OnChain.h"
- header "witnesscalc_credentialAtomicQuerySigV2.h"
- header "witnesscalc_credentialAtomicQuerySigV2OnChain.h"
- header "witnesscalc_credentialAtomicQueryV3.h"
- header "witnesscalc_credentialAtomicQueryV3OnChain.h"
- header "witnesscalc_linkedMultiQuery10.h"
- export *
-}
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc.h
deleted file mode 100644
index d663cc9..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef WITNESSCALC_H
-#define WITNESSCALC_H
-
-namespace CIRCUIT_NAME {
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-/**
- * A wrapper function for `witnesscalc` that takes the circuit as a .dat file
- * name instead of a buffer.
- */
-int
-witnesscalc_from_dat_file(
- const char *dat_fname,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-} // namespace
-
-#endif // WITNESSCALC_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_authV2.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_authV2.h
deleted file mode 100644
index 72b1f72..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_authV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_AUTHV2_H
-#define WITNESSCALC_AUTHV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_authV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_AUTHV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
deleted file mode 100644
index d2b80cf..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
deleted file mode 100644
index 013885c..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2.h
deleted file mode 100644
index f03309b..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
deleted file mode 100644
index e55016d..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3.h
deleted file mode 100644
index 50dfbfe..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
deleted file mode 100644
index c958b7b..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_linkedMultiQuery10.h b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_linkedMultiQuery10.h
deleted file mode 100644
index 5702486..0000000
--- a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/Headers/witnesscalc_linkedMultiQuery10.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_LINKEDMULTIQUERY10_H
-#define WITNESSCALC_LINKEDMULTIQUERY10_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_linkedMultiQuery10(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_LINKEDMULTIQUERY10_H
diff --git a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/libpolygonid-ios-sim.a b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/libpolygonid-ios-sim.a
index f912e14..9afd2cd 100644
Binary files a/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/libpolygonid-ios-sim.a and b/Iden3CLibrary.xcframework/ios-arm64_x86_64-simulator/libpolygonid-ios-sim.a differ
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid-prover.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid-prover.h
deleted file mode 100644
index f65e7be..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid-prover.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROVER_HPP
-#define PROVER_HPP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//Error codes returned by the functions.
-#define PROVER_OK 0x0
-#define PROVER_ERROR 0x1
-#define PROVER_ERROR_SHORT_BUFFER 0x2
-#define PROVER_INVALID_WITNESS_LENGTH 0x3
-
-/**
- * Calculates buffer size to output public signals as json string
- * @returns PROVER_OK in case of success, and the size of public buffer is written to public_size
- */
-int
-groth16_public_size_for_zkey_buf(const void *zkey_buffer, unsigned long zkey_size,
- unsigned long *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
- * 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);
-
-/**
- * groth16_prover
- * @return error code:
- * PROVER_OK - in case of success
- * 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);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // PROVER_HPP
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid.h
index 66eeaf8..59f1ad4 100644
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid.h
+++ b/Iden3CLibrary.xcframework/macos-arm64/Headers/libpolygonid.h
@@ -28,6 +28,22 @@ typedef enum
{
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
+ // error extracting credential status from verifiable credential
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ // error resolving credential status (e.g. getting the status from chain of DHS)
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ // error getting merkletree proof from credential status
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ // merkletree proof is invalid
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ // credential is revoked
+ PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_REVOKED_ERROR,
+ // the same as above but for issuer credential (for signature proofs)
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_RESOLVE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_STATE_ERROR,
+ PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_REVOKED_ERROR,
} PLGNStatusCode;
typedef struct _PLGNStatus
@@ -189,7 +205,13 @@ extern GoUint8 PLGNAtomicQueryV3OnChainInputs(char** jsonResponse, char* in, cha
//
extern GoUint8 PLGNALinkedMultiQueryInputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
extern void PLGNFreeStatus(PLGNStatus* status);
+
+// Deprecated: Use PLGNCleanCache2 instead. We need to support consistent path
+// to the cache directory. This function supposed the cache directory is empty
+// and should be calculated based on user's $HOME directory.
+//
extern GoUint8 PLGNCleanCache(PLGNStatus** status);
+extern GoUint8 PLGNCleanCache2(char* cfg, PLGNStatus** status);
extern GoUint8 PLGNCacheCredentials(char* in, char* cfg, PLGNStatus** status);
// PLGNW3CCredentialFromOnchainHex returns a verifiable credential from an onchain data hex string.
@@ -227,6 +249,11 @@ extern GoUint8 PLGNW3CCredentialFromOnchainHex(char** jsonResponse, char* in, ch
// }
//
extern GoUint8 PLGNDescribeID(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubSignPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubVerifyPoseidon(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPrivate2Public(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicUncompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
+extern GoUint8 PLGNBabyJubJubPublicCompress(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
#ifdef __cplusplus
}
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/module.modulemap b/Iden3CLibrary.xcframework/macos-arm64/Headers/module.modulemap
deleted file mode 100644
index 788620c..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/module.modulemap
+++ /dev/null
@@ -1,15 +0,0 @@
-module CPolygonID {
- header "libpolygonid.h"
- export *
-}
-module WitnessCalc {
- header "witnesscalc_authV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2.h"
- header "witnesscalc_credentialAtomicQueryMTPV2OnChain.h"
- header "witnesscalc_credentialAtomicQuerySigV2.h"
- header "witnesscalc_credentialAtomicQuerySigV2OnChain.h"
- header "witnesscalc_credentialAtomicQueryV3.h"
- header "witnesscalc_credentialAtomicQueryV3OnChain.h"
- header "witnesscalc_linkedMultiQuery10.h"
- export *
-}
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc.h
deleted file mode 100644
index d663cc9..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef WITNESSCALC_H
-#define WITNESSCALC_H
-
-namespace CIRCUIT_NAME {
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-/**
- * A wrapper function for `witnesscalc` that takes the circuit as a .dat file
- * name instead of a buffer.
- */
-int
-witnesscalc_from_dat_file(
- const char *dat_fname,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-} // namespace
-
-#endif // WITNESSCALC_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_authV2.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_authV2.h
deleted file mode 100644
index 72b1f72..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_authV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_AUTHV2_H
-#define WITNESSCALC_AUTHV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_authV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_AUTHV2_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
deleted file mode 100644
index d2b80cf..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
deleted file mode 100644
index 013885c..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryMTPV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYMTPV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h
deleted file mode 100644
index f03309b..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
deleted file mode 100644
index e55016d..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQuerySigV2OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQuerySigV2OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYSIGV2ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h
deleted file mode 100644
index 50dfbfe..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
deleted file mode 100644
index c958b7b..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_credentialAtomicQueryV3OnChain.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-#define WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_credentialAtomicQueryV3OnChain(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_CREDENTIALATOMICQUERYV3ONCHAIN_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_linkedMultiQuery10.h b/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_linkedMultiQuery10.h
deleted file mode 100644
index 5702486..0000000
--- a/Iden3CLibrary.xcframework/macos-arm64/Headers/witnesscalc_linkedMultiQuery10.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef WITNESSCALC_LINKEDMULTIQUERY10_H
-#define WITNESSCALC_LINKEDMULTIQUERY10_H
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WITNESSCALC_OK 0x0
-#define WITNESSCALC_ERROR 0x1
-#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2
-
-/**
- *
- * @return error code:
- * WITNESSCALC_OK - in case of success.
- * WITNESSCALC_ERROR - in case of an error.
- *
- * On success wtns_buffer is filled with witness data and
- * wtns_size contains the number bytes copied to wtns_buffer.
- *
- * If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
- * and the minimum size for wtns_buffer in wtns_size.
- *
- */
-
-int
-witnesscalc_linkedMultiQuery10(
- const char *circuit_buffer, unsigned long circuit_size,
- const char *json_buffer, unsigned long json_size,
- char *wtns_buffer, unsigned long *wtns_size,
- char *error_msg, unsigned long error_msg_maxsize);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // WITNESSCALC_LINKEDMULTIQUERY10_H
diff --git a/Iden3CLibrary.xcframework/macos-arm64/libpolygonid-macos.a b/Iden3CLibrary.xcframework/macos-arm64/libpolygonid-macos.a
index 0851611..9820533 100644
Binary files a/Iden3CLibrary.xcframework/macos-arm64/libpolygonid-macos.a and b/Iden3CLibrary.xcframework/macos-arm64/libpolygonid-macos.a differ
diff --git a/Package.swift b/Package.swift
index 36771bb..970b7b3 100644
--- a/Package.swift
+++ b/Package.swift
@@ -23,11 +23,7 @@ let package = Package(
name: "LibIden3",
dependencies: [
"Iden3CLibrary",
- "WitnessCalc",
]),
- .binaryTarget(name: "WitnessCalc",
- url: "https://github.com/iden3/swift-iden3lib/releases/download/v0.0.2/witnesscalc.zip",
- checksum: "35b8f9423daedaec21f96c86bdc62faf6bf13f9acb9df8d3b4e35b2027d66de0"),
.binaryTarget(name: "Iden3CLibrary", path: "Iden3CLibrary.xcframework"),
]
)
diff --git a/build.sh b/build.sh
index 805351a..185b5bb 100755
--- a/build.sh
+++ b/build.sh
@@ -3,125 +3,9 @@
XCF_DIR=`pwd`
XCF_INCLUDE="$XCF_DIR/include"
-set -e
-
-buildWitness() {
- echo "Building witnesscalc..."
-
- WITNESS_FILES=(
- witnesscalc_authV2
- witnesscalc_credentialAtomicQueryMTPV2
- witnesscalc_credentialAtomicQueryMTPV2OnChain
- witnesscalc_credentialAtomicQuerySigV2
- witnesscalc_credentialAtomicQuerySigV2OnChain
- witnesscalc_credentialAtomicQueryV3
- witnesscalc_credentialAtomicQueryV3OnChain
- witnesscalc_linkedMultiQuery10
- )
-
- WITNESS_DIR="$XCF_DIR/../witnesscalc"
- WITNESS_PACKAGE_DIR="$WITNESS_DIR/package"
-
- WITNESS_IOS_DIR="$WITNESS_DIR/build_witnesscalc_ios"
- WITNESS_IOS_OUTPUT_DIR="$WITNESS_IOS_DIR/src/Release-iphoneos"
-
- WITNESS_IOS_SIM_DIR="$WITNESS_DIR/build_witnesscalc_ios_simulator"
- WITNESS_IOS_SIM_OUTPUT_DIR="$WITNESS_IOS_SIM_DIR/src/Release-iphonesimulator"
-
- WITNESS_LIBS="$XCF_DIR/witnesscalc/libs"
- WITNESS_TARGET="WitnessCalc.xcframework"
-
- cd $XCF_DIR
- rm -f $WITNESS_LIBS/*.a
- rm -Rf $WITNESS_TARGET
-
- cd $WITNESS_DIR
-
- git pull
- git submodule init
- git submodule update
-
- # MacOS - ARM
- set +e
- ./build_gmp.sh host
- set -e
- make arm64_host
-
- cp $WITNESS_PACKAGE_DIR/include/*.h $XCF_INCLUDE/
-
- mkdir -p $WITNESS_LIBS
- for file in "${WITNESS_FILES[@]}"; do
- cp "$WITNESS_PACKAGE_DIR/lib/lib$file.a" "$WITNESS_LIBS/lib$file-macos.a"
- done
-
- cp "$WITNESS_PACKAGE_DIR/lib/libfr.a" "$WITNESS_LIBS/libfr-macos.a"
- cp "$WITNESS_PACKAGE_DIR/lib/libgmp.a" "$WITNESS_LIBS/libgmp-macos.a"
-
- # iOS Simulator
- set +e
- ./build_gmp.sh ios_simulator
- set -e
- make ios-simulator
- mkdir -p $WITNESS_IOS_SIM_DIR
- cd $WITNESS_IOS_SIM_DIR
- for file in "${WITNESS_FILES[@]}"; do
- xcodebuild -project witnesscalc.xcodeproj \
- -destination 'generic/platform=iOS Simulator' \
- -configuration Release \
- -scheme ${file}Static
- cp $WITNESS_IOS_SIM_OUTPUT_DIR/lib$file.a $WITNESS_LIBS/lib$file-ios-sim.a
- done
-
- cd $WITNESS_DIR
-
- cp "$WITNESS_IOS_SIM_OUTPUT_DIR/libfr.a" "$WITNESS_LIBS/libfr-ios-sim.a"
- cp "$WITNESS_DIR/depends/gmp/package_iphone_simulator/lib/libgmp.a" "$WITNESS_LIBS/libgmp-ios-sim.a"
-
- # iOS
- set +e
- ./build_gmp.sh ios
- set -e
- make ios
-
- mkdir -p $WITNESS_IOS_DIR
- cd $WITNESS_IOS_DIR
- for file in "${WITNESS_FILES[@]}"; do
- xcodebuild -project witnesscalc.xcodeproj \
- -destination 'generic/platform=iOS' \
- -configuration Release \
- -scheme ${file}Static
- cp $WITNESS_IOS_OUTPUT_DIR/lib$file.a $WITNESS_LIBS/lib$file-ios.a
- done
-
- cd $WITNESS_DIR
-
- cp "$WITNESS_IOS_OUTPUT_DIR/libfr.a" "$WITNESS_LIBS/libfr-ios.a"
- cp "$WITNESS_DIR/depends/gmp/package_ios_arm64/lib/libgmp.a" "$WITNESS_LIBS/libgmp-ios.a"
-
- echo "Merging witnesscalc libraries..."
+mkdir -p $XCF_INCLUDE
- rm -f $WITNESS_LIBS/witnesscalc-*
- libtool -static -no_warning_for_no_symbols \
- -o $WITNESS_LIBS/witnesscalc-macos.a \
- $WITNESS_LIBS/*-macos.a
-
- libtool -static -no_warning_for_no_symbols \
- -o $WITNESS_LIBS/witnesscalc-ios-sim.a \
- $WITNESS_LIBS/*-ios-sim.a
-
- libtool -static -no_warning_for_no_symbols \
- -o $WITNESS_LIBS/witnesscalc-ios.a \
- $WITNESS_LIBS/*-ios.a
-
- echo "Building witnesscalc framework..."
-
- cd $XCF_DIR
- xcodebuild -verbose -create-xcframework \
- -output $WITNESS_TARGET \
- -library $WITNESS_LIBS/witnesscalc-macos.a \
- -library $WITNESS_LIBS/witnesscalc-ios-sim.a \
- -library $WITNESS_LIBS/witnesscalc-ios.a
-}
+set -e
buildIden3Lib() {
echo "Building iden3 C library..."
@@ -161,5 +45,4 @@ buildIden3Lib() {
-headers ./include/
}
-buildWitness
buildIden3Lib