Skip to content

Commit

Permalink
add ecdsa to mobile proving (attempt)
Browse files Browse the repository at this point in the history
  • Loading branch information
remicolin committed Sep 24, 2024
1 parent 35a697b commit dbc4dee
Show file tree
Hide file tree
Showing 36 changed files with 5,444,332 additions and 154 deletions.
2 changes: 2 additions & 0 deletions app/ios/OpenPassport-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "witnesscalc_prove_rsa_65537_sha256.h"
#include "witnesscalc_prove_rsa_65537_sha1.h"
#include "witnesscalc_prove_rsapss_65537_sha256.h"
#include "witnesscalc_prove_ecdsa_secp256r1_sha1.h"
#include "witnesscalc_prove_ecdsa_secp256r1_sha256.h"
#include "witnesscalc_register_rsa_65537_sha256.h"
#include "witnesscalc_register_rsa_65537_sha1.h"
#include "witnesscalc_register_rsapss_65537_sha256.h"
Expand Down
8 changes: 8 additions & 0 deletions app/ios/OpenPassport.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
1686F0DC2C500F3800841CDE /* QRScannerBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1686F0DB2C500F3800841CDE /* QRScannerBridge.swift */; };
1686F0DE2C500F4F00841CDE /* QRScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1686F0DD2C500F4F00841CDE /* QRScannerViewController.swift */; };
1686F0E02C500FBD00841CDE /* QRScannerBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 1686F0DF2C500FBD00841CDE /* QRScannerBridge.m */; };
16AB2E942CA2BA30006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16AB2E922CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha1.a */; };
16AB2E952CA2BA30006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha256.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16AB2E932CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha256.a */; };
16E6646E2B8D292500FDD6A0 /* QKMRZScannerViewRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E6646D2B8D292500FDD6A0 /* QKMRZScannerViewRepresentable.swift */; };
16E884A52C5BD764003B7125 /* passport.json in Resources */ = {isa = PBXBuildFile; fileRef = 16E884A42C5BD764003B7125 /* passport.json */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -106,6 +108,8 @@
1686F0DB2C500F3800841CDE /* QRScannerBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRScannerBridge.swift; sourceTree = "<group>"; };
1686F0DD2C500F4F00841CDE /* QRScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRScannerViewController.swift; sourceTree = "<group>"; };
1686F0DF2C500FBD00841CDE /* QRScannerBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QRScannerBridge.m; sourceTree = "<group>"; };
16AB2E922CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwitnesscalc_prove_ecdsa_secp256r1_sha1.a; sourceTree = "<group>"; };
16AB2E932CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha256.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwitnesscalc_prove_ecdsa_secp256r1_sha256.a; sourceTree = "<group>"; };
16E6646D2B8D292500FDD6A0 /* QKMRZScannerViewRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QKMRZScannerViewRepresentable.swift; sourceTree = "<group>"; };
16E884A42C5BD764003B7125 /* passport.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = passport.json; sourceTree = "<group>"; };
453D60E43CC0F08D884424E7 /* Pods-OpenPassport.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenPassport.debug.xcconfig"; path = "Target Support Files/Pods-OpenPassport/Pods-OpenPassport.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -133,7 +137,9 @@
0569F35B2BBC9015006670BD /* librapidsnark.a in Frameworks */,
0573C4F62C754600006C7386 /* libwitnesscalc_prove_rsapss_65537_sha256.a in Frameworks */,
05D985F62BB331AB00F58EEA /* libfr.a in Frameworks */,
16AB2E952CA2BA30006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha256.a in Frameworks */,
167D934A2C91D2EA00530E6B /* libwitnesscalc_prove_rsa_65537_sha256.a in Frameworks */,
16AB2E942CA2BA30006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha1.a in Frameworks */,
CA9CD86025E82C8AE5193959 /* Pods_OpenPassport.framework in Frameworks */,
167D93462C91B1E100530E6B /* libwitnesscalc_register_rsa_65537_sha1.a in Frameworks */,
);
Expand Down Expand Up @@ -208,6 +214,8 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
16AB2E922CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha1.a */,
16AB2E932CA2BA01006DA979 /* libwitnesscalc_prove_ecdsa_secp256r1_sha256.a */,
167D93482C91D28500530E6B /* libwitnesscalc_register_rsa_65537_sha256.a */,
167D93422C91AE0F00530E6B /* libwitnesscalc_register_rsa_65537_sha1.a */,
167D93432C91AE0F00530E6B /* libwitnesscalc_register_rsapss_65537_sha256.a */,
Expand Down
10 changes: 5 additions & 5 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ SPEC CHECKSUMS:
React-Core: 8293312ad137ea82fd2c29deb163dbc24aa4e00e
React-CoreModules: 32fab1d62416849a3b6dac6feff9d54e5ddc2d1e
React-cxxreact: 55d0f7cb6b4cc09ba9190797f1da87182d1a2fb6
React-debug: 7e61555c8158126c6cd98c3154381ad3821aaaca
React-debug: bfbf1b006f1062fe240db1ca249676e55bd4a5f9
React-jsc: 0db8e8cc2074d979c37ffa7b8d7c914833960497
React-jsi: 58677ff4848ceb6aeb9118fe03448a843ea5e16a
React-jsiexecutor: 2c15ba1bace70177492368d5180b564f165870fd
Expand All @@ -631,7 +631,7 @@ SPEC CHECKSUMS:
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
react-native-netinfo: bdb108d340cdb41875c9ced535977cac6d2ff321
react-native-nfc-manager: 3134770f9afcb586c0ae859e747fda3106ec1f76
React-NativeModulesApple: 0438665fc7473be6edc496e823e6ea0b0537b46c
React-NativeModulesApple: 9b2cee1e35955c63bf6dc0ca4d526f21ee801f9f
React-perflogger: 6bd153e776e6beed54c56b0847e1220a3ff92ba5
React-RCTActionSheet: c0b62af44e610e69d9a2049a682f5dba4e9dff17
React-RCTAnimation: fe7005136b58f58871cab2f70732343b6e330d30
Expand All @@ -645,9 +645,9 @@ SPEC CHECKSUMS:
React-RCTVibration: ea3a68a49873a54ced927c90923fc6932baf344a
React-rncore: 9672a017af4a7da7495d911f0b690cbcae9dd18d
React-runtimeexecutor: 369ae9bb3f83b65201c0c8f7d50b72280b5a1dbc
React-runtimescheduler: ec1066a4f2d1152eb1bc3fb61d69376b3bc0dde0
React-utils: d55ba834beb39f01b0b470ae43478c0a3a024abe
ReactCommon: 68e3a815fbb69af3bb4196e04c6ae7abb306e7a8
React-runtimescheduler: 775cd57a52b756b040468530a084c114707fa9e9
React-utils: 42bad3d3adbeeddd11015d3d4ecabc10548bf8e2
ReactCommon: fa131b3a9e8273f0cfec5f13fcab7201b164e0ba
RNCAsyncStorage: ec53e44dc3e75b44aa2a9f37618a49c3bc080a7a
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678
Expand Down
29 changes: 25 additions & 4 deletions app/ios/Prover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ import witnesscalc_prove_rsa_65537_sha1
import witnesscalc_prove_rsapss_65537_sha256
#endif

#if canImport(witnesscalc_prove_ecdsa_secp256r1_sha256)
import witnesscalc_prove_ecdsa_secp256r1_sha256
#endif

#if canImport(witnesscalc_prove_ecdsa_secp256r1_sha1)
import witnesscalc_prove_ecdsa_secp256r1_sha1
#endif

#if canImport(witnesscalc_register_rsa_65537_sha256)
import witnesscalc_register_rsa_65537_sha256
#endif
Expand All @@ -41,10 +49,11 @@ import witnesscalc_register_rsa_65537_sha1
import witnesscalc_register_rsapss_65537_sha256
#endif



#if canImport(groth16_prover)
import groth16_prover
#endif

struct Proof: Codable {
let piA: [String]
let piB: [[String]]
Expand Down Expand Up @@ -183,9 +192,21 @@ private func _calcWtns(witness_calculator: String, dat: Data, jsonData: Data) th
wtnsBuffer, wtnsSize,
errorBuffer, errorSize
)
}

else {
} else if witness_calculator == "prove_ecdsa_secp256r1_sha256" {
result = witnesscalc_prove_ecdsa_secp256r1_sha256(
(dat as NSData).bytes, datSize,
(jsonData as NSData).bytes, jsonDataSize,
wtnsBuffer, wtnsSize,
errorBuffer, errorSize
)
} else if witness_calculator == "prove_ecdsa_secp256r1_sha1" {
result = witnesscalc_prove_ecdsa_secp256r1_sha1(
(dat as NSData).bytes, datSize,
(jsonData as NSData).bytes, jsonDataSize,
wtnsBuffer, wtnsSize,
errorBuffer, errorSize
)
} else {
fatalError("Invalid witness calculator name")
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified app/ios/libwitnesscalc_prove_rsa_65537_sha1.a
Binary file not shown.
Binary file modified app/ios/libwitnesscalc_prove_rsa_65537_sha256.a
Binary file not shown.
Binary file modified app/ios/libwitnesscalc_prove_rsapss_65537_sha256.a
Binary file not shown.
39 changes: 39 additions & 0 deletions app/ios/witnesscalc_prove_ecdsa_secp256r1_sha1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef WITNESSCALC_prove_ecdsa_secp256r1_sha1_H
#define WITNESSCALC_prove_ecdsa_secp256r1_sha1_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_prove_ecdsa_secp256r1_sha1(
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_prove_ecdsa_secp256r1_sha1_H
39 changes: 39 additions & 0 deletions app/ios/witnesscalc_prove_ecdsa_secp256r1_sha256.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef WITNESSCALC_prove_ecdsa_secp256r1_sha256_H
#define WITNESSCALC_prove_ecdsa_secp256r1_sha256_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_prove_ecdsa_secp256r1_sha256(
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_prove_ecdsa_secp256r1_sha256_H
3 changes: 2 additions & 1 deletion app/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ namespace CIRCUIT_NAME {" ${file}.cpp
}

# Array of circuit files
declare -a CIRCUITS=("prove_rsa_65537_sha256" "prove_rsa_65537_sha1" "prove_rsapss_65537_sha256")
declare -a CIRCUITS=("prove_ecdsa_secp256r1_sha256" "prove_ecdsa_secp256r1_sha1")
#declare -a CIRCUITS=("prove_rsa_65537_sha256" "prove_rsa_65537_sha1" "prove_rsapss_65537_sha256" "prove_ecdsa_secp256r1_sha256" "prove_ecdsa_secp256r1_sha1")

# Main execution
for circuit in "${CIRCUITS[@]}"; do
Expand Down
4 changes: 2 additions & 2 deletions app/src/screens/MockDataScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import getCountryISO2 from "country-iso-3-to-2";
import { flag } from 'country-emoji';
const MockDataScreen: React.FC = () => {
const [signatureAlgorithm, setSignatureAlgorithm] = useState("rsa_sha256");
const listOfSignatureAlgorithms = ["rsa_sha1", "rsa_sha256", "rsapss_sha256"];
const listOfSignatureAlgorithms = ["rsa_sha1", "rsa_sha256", "rsapss_sha256", "ecdsa_sha256", "ecdsa_sha1"];

const [dateOfBirthDatePicker, setDateOfBirthDatePicker] = useState<Date>(new Date(new Date().setFullYear(new Date().getFullYear() - 24)))
const [dateOfExpiryDatePicker, setDateOfExpiryDatePicker] = useState<Date>(new Date(new Date().setFullYear(new Date().getFullYear() + 5)))
Expand All @@ -30,7 +30,7 @@ const MockDataScreen: React.FC = () => {
setIsGenerating(true);

await new Promise(resolve => setTimeout(() => {
const mockPassportData = genMockPassportData(signatureAlgorithm as "rsa_sha256" | "rsa_sha1" | "rsapss_sha256", nationality as keyof typeof countryCodes, castDate(dateOfBirthDatePicker), castDate(dateOfExpiryDatePicker));
const mockPassportData = genMockPassportData(signatureAlgorithm as "rsa_sha256" | "rsa_sha1" | "rsapss_sha256" | "ecdsa_sha256" | "ecdsa_sha1", nationality as keyof typeof countryCodes, castDate(dateOfBirthDatePicker), castDate(dateOfExpiryDatePicker));
useUserStore.getState().registerPassportData(mockPassportData);
useUserStore.getState().setRegistered(true);
resolve(null);
Expand Down
16 changes: 10 additions & 6 deletions app/src/utils/zkeyDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const zkeyZipUrls = {
prove_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsa_65537_sha256.zkey.zip",
prove_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsa_65537_sha1.zkey.zip",
prove_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsapss_65537_sha256.zkey.zip",
register_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha256.zkey.zip",
register_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha1.zkey.zip",
register_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsapss_65537_sha256.zkey.zip",
prove_ecdsa_secp256r1_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_ecdsa_secp256r1_sha256.zkey.zip",
prove_ecdsa_secp256r1_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/prove_ecdsa_secp256r1_sha1.zkey.zip",
// register_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha256.zkey.zip",
// register_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha1.zkey.zip",
// register_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsapss_65537_sha256.zkey.zip",
// register_sha256WithRSAEncryption_65537: "https://d8o9bercqupgk.cloudfront.net/staging/register_sha256WithRSAEncryption_65537_csca2.zkey.zip",
// disclose: "https://d8o9bercqupgk.cloudfront.net/staging/disclose3.zkey.zip",
};
Expand All @@ -20,9 +22,11 @@ const datZipUrls = {
prove_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsa_65537_sha256.dat.zip",
prove_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsa_65537_sha1.dat.zip",
prove_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_rsapss_65537_sha256.dat.zip",
register_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha256.dat.zip",
register_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha1.dat.zip",
register_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsapss_65537_sha256.dat.zip",
prove_ecdsa_secp256r1_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/prove_ecdsa_secp256r1_sha256.dat.zip",
prove_ecdsa_secp256r1_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/prove_ecdsa_secp256r1_sha1.dat.zip",
// register_rsa_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha256.dat.zip",
// register_rsa_65537_sha1: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsa_65537_sha1.dat.zip",
// register_rsapss_65537_sha256: "https://d8o9bercqupgk.cloudfront.net/staging/register_rsapss_65537_sha256.dat.zip",
};

export type CircuitName = keyof typeof zkeyZipUrls;
Expand Down
23 changes: 16 additions & 7 deletions app/witnesscalc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ install(TARGETS
witnesscalc_prove_rsapss_65537_sha256
witnesscalc_prove_rsapss_65537_sha256Static

prove_ecdsa_secp256r1_sha256
witnesscalc_prove_ecdsa_secp256r1_sha256
witnesscalc_prove_ecdsa_secp256r1_sha256Static

prove_ecdsa_secp256r1_sha1
witnesscalc_prove_ecdsa_secp256r1_sha1
witnesscalc_prove_ecdsa_secp256r1_sha1Static

register_rsa_65537_sha256
witnesscalc_register_rsa_65537_sha256
witnesscalc_register_rsa_65537_sha256Static
Expand All @@ -57,13 +65,7 @@ install(TARGETS
witnesscalc_register_rsapss_65537_sha256
witnesscalc_register_rsapss_65537_sha256Static

# disclose
# witnesscalc_disclose
# witnesscalc_discloseStatic

# register_sha256WithRSAEncryption_65537
# witnesscalc_register_sha256WithRSAEncryption_65537
# witnesscalc_register_sha256WithRSAEncryption_65537Static


# authV2
# witnesscalc_authV2
Expand All @@ -82,10 +84,14 @@ install(FILES
src/prove_rsa_65537_sha256.dat
src/prove_rsa_65537_sha1.dat
src/prove_rsapss_65537_sha256.dat
src/prove_ecdsa_secp256r1_sha256.dat
src/prove_ecdsa_secp256r1_sha1.dat

src/register_rsa_65537_sha256.dat
src/register_rsa_65537_sha1.dat
src/register_rsapss_65537_sha256.dat
# src/authV2.dat

DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

install(FILES
Expand All @@ -95,8 +101,11 @@ install(FILES
src/witnesscalc_prove_rsa_65537_sha256.h
src/witnesscalc_prove_rsa_65537_sha1.h
src/witnesscalc_prove_rsapss_65537_sha256.h
src/witnesscalc_prove_ecdsa_secp256r1_sha256.h
src/witnesscalc_prove_ecdsa_secp256r1_sha1.h
src/witnesscalc_register_rsa_65537_sha256.h
src/witnesscalc_register_rsa_65537_sha1.h
src/witnesscalc_register_rsapss_65537_sha256.h
# src/witnesscalc_authV2.h

DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
39 changes: 38 additions & 1 deletion app/witnesscalc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,43 @@ target_compile_definitions(witnesscalc_prove_rsapss_65537_sha256 PUBLIC CIRCUIT_
target_compile_definitions(witnesscalc_prove_rsapss_65537_sha256Static PUBLIC CIRCUIT_NAME=prove_rsapss_65537_sha256)
target_compile_definitions(prove_rsapss_65537_sha256 PUBLIC CIRCUIT_NAME=prove_rsapss_65537_sha256)


# prove_ecdsa_secp256r1_sha256
set(prove_ecdsa_secp256r1_sha256_SOURCES ${LIB_SOURCES}
prove_ecdsa_secp256r1_sha256.cpp
witnesscalc_prove_ecdsa_secp256r1_sha256.h
witnesscalc_prove_ecdsa_secp256r1_sha256.cpp
)

add_library(witnesscalc_prove_ecdsa_secp256r1_sha256 SHARED ${prove_ecdsa_secp256r1_sha256_SOURCES})
add_library(witnesscalc_prove_ecdsa_secp256r1_sha256Static STATIC ${prove_ecdsa_secp256r1_sha256_SOURCES})
set_target_properties(witnesscalc_prove_ecdsa_secp256r1_sha256Static PROPERTIES OUTPUT_NAME witnesscalc_prove_ecdsa_secp256r1_sha256)

add_executable(prove_ecdsa_secp256r1_sha256 main.cpp)
target_link_libraries(prove_ecdsa_secp256r1_sha256 witnesscalc_prove_ecdsa_secp256r1_sha256Static)

target_compile_definitions(witnesscalc_prove_ecdsa_secp256r1_sha256 PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha256)
target_compile_definitions(witnesscalc_prove_ecdsa_secp256r1_sha256Static PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha256)
target_compile_definitions(prove_ecdsa_secp256r1_sha256 PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha256)

# prove_ecdsa_secp256r1_sha1
set(prove_ecdsa_secp256r1_sha1_SOURCES ${LIB_SOURCES}
prove_ecdsa_secp256r1_sha1.cpp
witnesscalc_prove_ecdsa_secp256r1_sha1.h
witnesscalc_prove_ecdsa_secp256r1_sha1.cpp
)

add_library(witnesscalc_prove_ecdsa_secp256r1_sha1 SHARED ${prove_ecdsa_secp256r1_sha1_SOURCES})
add_library(witnesscalc_prove_ecdsa_secp256r1_sha1Static STATIC ${prove_ecdsa_secp256r1_sha1_SOURCES})
set_target_properties(witnesscalc_prove_ecdsa_secp256r1_sha1Static PROPERTIES OUTPUT_NAME witnesscalc_prove_ecdsa_secp256r1_sha1)

add_executable(prove_ecdsa_secp256r1_sha1 main.cpp)
target_link_libraries(prove_ecdsa_secp256r1_sha1 witnesscalc_prove_ecdsa_secp256r1_sha1Static)

target_compile_definitions(witnesscalc_prove_ecdsa_secp256r1_sha1 PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha1)
target_compile_definitions(witnesscalc_prove_ecdsa_secp256r1_sha1Static PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha1)
target_compile_definitions(prove_ecdsa_secp256r1_sha1 PUBLIC CIRCUIT_NAME=prove_ecdsa_secp256r1_sha1)

# register_rsa_65537_sha256
set(register_rsa_65537_sha256_SOURCES ${LIB_SOURCES}
register_rsa_65537_sha256.cpp
Expand Down Expand Up @@ -231,4 +268,4 @@ target_link_libraries(register_rsapss_65537_sha256 witnesscalc_register_rsapss_6

target_compile_definitions(witnesscalc_register_rsapss_65537_sha256 PUBLIC CIRCUIT_NAME=register_rsapss_65537_sha256)
target_compile_definitions(witnesscalc_register_rsapss_65537_sha256Static PUBLIC CIRCUIT_NAME=register_rsapss_65537_sha256)
target_compile_definitions(register_rsapss_65537_sha256 PUBLIC CIRCUIT_NAME=register_rsapss_65537_sha256)
target_compile_definitions(register_rsapss_65537_sha256 PUBLIC CIRCUIT_NAME=register_rsapss_65537_sha256)
Loading

0 comments on commit dbc4dee

Please sign in to comment.