-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bartosz Nowak
committed
Oct 25, 2023
1 parent
a93748a
commit e7d1e26
Showing
5 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef BridgingHeader_h | ||
#define BridgingHeader_h | ||
|
||
#include "../generated/noir_swift/noir_swift.h" | ||
#include "../generated/SwiftBridgeCore.h" | ||
#include "../generated/noir_swift/noir_swift.h" | ||
|
||
#endif /* BridgingHeader_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
let BYTECODE = "H4sIAAAAAAAA/7WTMRLEIAhFMYkp9ywgGrHbq6yz5v5H2JkdCyaxC9LgWDw+H9gBwMM91p7fPeOzIKdYjEeMLYdGTB8MpUrCmOohJJQkfYMwN4mSSy0ZC0VudKbCZ4cthqzVrsc/yw28dMZeWmrWerfBexnsxD6hJ7jUufr4GvyZFp8xpG0C14Pd8s/q29vPCBXypvmpDx7sD8opnfqIfsM1RNtxBQAA" | ||
|
||
func testProveVerify() -> Bool { | ||
let vec = RustVec<Int32>(); | ||
let vec = RustVec<Int32>() | ||
vec.push(value: 1) | ||
vec.push(value: 2) | ||
let proof = prove_swift(BYTECODE, vec) | ||
return verify_swift(BYTECODE, proof) | ||
|
||
guard let proof = prove_swift(BYTECODE, vec) else { | ||
return false | ||
} | ||
|
||
return verify_swift(BYTECODE, proof) ?? false | ||
} | ||
|
||
// Call the function | ||
print(testProveVerify()) |