Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.4.0 #63

Merged
merged 229 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
75aa1c7
Added possibility to verify/not verify validity of deserialized provi…
DanieleDiBenedetto Jun 8, 2020
a45a5c2
Small fixes
DanieleDiBenedetto Jun 15, 2020
73568b7
Updates to API
DanieleDiBenedetto Jun 17, 2020
f3b7b9a
Implemented AutoCloseable interface for automatic deallocation ad mod…
DanieleDiBenedetto Jun 18, 2020
c2b1d8e
Updatable Poseidon Hash
DanieleDiBenedetto Jun 25, 2020
4f6841f
Update to last version
DanieleDiBenedetto Jun 26, 2020
9506015
Update checks and deserializations
DanieleDiBenedetto Jul 3, 2020
7bd0531
Merge branch 'development' into deserialized_checked_unchecked
DanieleDiBenedetto Jul 3, 2020
6edbe09
Updated tests
DanieleDiBenedetto Jul 3, 2020
58c7cef
Updated constants and tests
DanieleDiBenedetto Jul 3, 2020
1ee4eeb
Update Cargo.toml
DanieleDiBenedetto Jul 3, 2020
92201bc
Update to last hash/mht part 1
DanieleDiBenedetto Aug 2, 2020
c247511
Sync with ginger lib smt branch
DanieleDiBenedetto Aug 3, 2020
43ccb70
Expose to Java BigMerkleTree implementations
DanieleDiBenedetto Aug 4, 2020
3c87aee
Added some comments
DanieleDiBenedetto Aug 4, 2020
522f4e5
MerkleTrees with tests. Java test not passing
DanieleDiBenedetto Aug 5, 2020
7199cd0
Sync last changes in GingerLib's smt branch, i.e. SMT persistency
DanieleDiBenedetto Aug 6, 2020
d442189
Minor fixes
DanieleDiBenedetto Aug 6, 2020
016a44e
Other modifications
DanieleDiBenedetto Aug 7, 2020
635f973
Commented free for MTs
DanieleDiBenedetto Aug 7, 2020
63a1620
Fixed problem in Merkle Tree free functions
DanieleDiBenedetto Aug 24, 2020
fb6fb61
Updated test
DanieleDiBenedetto Aug 24, 2020
e6a1781
Added persistency tests
DanieleDiBenedetto Aug 24, 2020
e7bf915
Update README.md
DanieleDiBenedetto Aug 24, 2020
fa8814b
Marked computePoseidonHash function as deprecated
DanieleDiBenedetto Aug 24, 2020
bfdab99
Minor fix
DanieleDiBenedetto Aug 24, 2020
28a9a9c
Updated tests
DanieleDiBenedetto Aug 25, 2020
93c6051
Update README.md
DanieleDiBenedetto Aug 25, 2020
fa6d6a1
Small fix
DanieleDiBenedetto Aug 25, 2020
3309b86
Merge branch 'updatable_poseidon' of https://github.com/HorizenOffici…
DanieleDiBenedetto Aug 25, 2020
4007a56
Fix typo in return type of fn compute_pks_threshold_hash
DanieleDiBenedetto Aug 28, 2020
aef83cc
Changelog:
DanieleDiBenedetto Sep 11, 2020
0f0d5d2
Minor fix + comment
DanieleDiBenedetto Sep 11, 2020
0958589
Changed IllegalArgumentException to IllegalStateException where it's …
DanieleDiBenedetto Sep 16, 2020
530fd62
Readme file updated: java jar compilation guide added.
i-Alex Sep 18, 2020
16f39fa
Update README.md
DanieleDiBenedetto Sep 18, 2020
9cdcb00
Update README.md
DanieleDiBenedetto Sep 18, 2020
164964e
New functions to MerklePath
DanieleDiBenedetto Oct 2, 2020
0302eaa
Refer to stable Ginger smt branch commit + getPosition static function
DanieleDiBenedetto Oct 8, 2020
99ca602
Removed fixed dependency
DanieleDiBenedetto Oct 8, 2020
dd2692d
Added temporary MerklePath.apply(leaf) function
DanieleDiBenedetto Oct 9, 2020
d354f6b
Added temporary MerklePath.apply(leaf) function
DanieleDiBenedetto Oct 12, 2020
c3cd073
Simplified and optimized SMTs initialization and loading according to…
DanieleDiBenedetto Oct 12, 2020
82b3114
Bump junit from 4.12 to 4.13.1 in /jni
dependabot[bot] Oct 13, 2020
3f4eb61
CommitmentTree JNI draft.
i-Alex Mar 18, 2021
f514953
Add tweedle support
phoinic Mar 18, 2021
1e63695
Vertidcts bugfix
phoinic Mar 19, 2021
ed74d28
Commenting all SMT / LSMT functions which are related to the rocksdb
phoinic Mar 19, 2021
bd343c5
SMT commneted
phoinic Mar 19, 2021
1c49586
Marlin introduced
phoinic Mar 19, 2021
6a801ec
Marlin integration finished
phoinic Mar 22, 2021
256a86c
Serializations refactoring
phoinic Mar 25, 2021
21f470b
FIELD size adjusted
phoinic Mar 25, 2021
9814528
Added implementation of existance proof and absence proof.
Mar 25, 2021
af478a6
Unit tests with hardcoded parameters commented
phoinic Mar 25, 2021
74b24f7
Fixed existence and absence build errors.
Mar 25, 2021
36829f7
FiedlElement changed
phoinic Mar 25, 2021
330529f
Merge updatable_poseidon_tweedle into commitment_jni_tweedle.
i-Alex Mar 26, 2021
4bd428e
Merge branch 'commitment_jni' into commitment_jni_tweedle
i-Alex Mar 26, 2021
f4ba7f5
CCTP lib dependency updated. CommitmentTree fixes. Local ginger lib d…
i-Alex Mar 26, 2021
dd6b5dc
CommitmentTree native jni fixes.
i-Alex Mar 29, 2021
7d8841f
CommitmentTree implementation updated.
i-Alex Mar 29, 2021
a04d171
CommitmentTree init method fix.
i-Alex Mar 29, 2021
9c62f0e
Added unit tests for rust commitment tree.
Mar 29, 2021
9d10902
Return back working Java tests
phoinic Mar 30, 2021
9f5f8b9
Unused stuff removed
phoinic Mar 30, 2021
3106c66
Minor renaming.
i-Alex Mar 30, 2021
0654dcc
Merge branch 'updatable_poseidon_tweedle' into commitment_jni_tweedle
i-Alex Mar 30, 2021
d28646f
CommitmentTree fixes.
i-Alex Mar 30, 2021
aa5c02b
CommitmentTree jni fixes.
i-Alex Mar 30, 2021
b6e6d22
Hash size changed to 32
phoinic Mar 30, 2021
156b08e
Buffer truncating bugfix
phoinic Mar 30, 2021
79f900d
CommitmentTree jni checks improvement. Unit tests update.
i-Alex Mar 31, 2021
8ddd9d4
Fix merging issues.
Mar 31, 2021
2a0ab54
Merge branch 'commitment_jni_tweedle' of https://github.com/HorizenOf…
Mar 31, 2021
20210c8
Byte array hash truncate moved to caller
phoinic Mar 31, 2021
d8d4d3e
Slit unit test in separate ones.
Mar 31, 2021
c9ac515
Fixed existance and absence proof implementation. Updated unit tests.
Mar 31, 2021
81ec068
Added wrappers for existance and absence proof serialization and dese…
Apr 1, 2021
1a5d5a9
Java empty comm tree regression test added.
i-Alex Apr 2, 2021
eb9af1e
universal_setup params optimization
phoinic Apr 5, 2021
6b1468f
Type mapping added. Part of UTs restored
phoinic Apr 6, 2021
daaeb38
mnt's and proof-system dependencies removed
phoinic Apr 6, 2021
1f3d894
On-flight params calculation for marlin setup
phoinic Apr 8, 2021
c7e896d
Not needed functions commented
phoinic Apr 8, 2021
3fbf99f
UT restored
phoinic Apr 8, 2021
a394f8b
Unecessary params removed from test function
phoinic Apr 8, 2021
2771064
testCreateRandomProof UT workaround
phoinic Apr 11, 2021
881f3d2
Demo circuit UTs updated
phoinic Apr 11, 2021
00921cb
Added existence/absence proofs serialization.
Apr 12, 2021
fe0e971
Fixed build script.
Apr 12, 2021
9804476
nativeSetup function params bugfix
phoinic Apr 12, 2021
874b6df
Merge updateble_poseidon_tweedle into commitment_jni_tweedle. Conflic…
i-Alex Apr 14, 2021
fff4143
cctp lib dependency updated.
i-Alex Apr 15, 2021
4fa7b66
Commented ouroboros package
DanieleDiBenedetto Apr 19, 2021
15eb51c
Merge branch 'development_tmp' into deserialized_checked_unchecked
albertog78 Apr 19, 2021
3337391
Merge pull request #32 from HorizenOfficial/autoclosable_resources
albertog78 Apr 19, 2021
b2e3e93
Merge branch 'development_tmp' into deserialized_checked_unchecked
DanieleDiBenedetto Apr 19, 2021
a8793d2
fixing the travis.yml
lander86 Apr 20, 2021
954c276
updating rust version in the docker container
lander86 Apr 20, 2021
05f346c
Fixed automerge errors in tests
DanieleDiBenedetto Apr 21, 2021
63f4221
Merge pull request #28 from HorizenOfficial/deserialized_checked_unch…
albertog78 Apr 22, 2021
5ce5935
Merge branch 'deserialized_checked_unchecked' into updatable_poseidon…
DanieleDiBenedetto Apr 22, 2021
2b5b0e2
Removed SMT code Java side too
DanieleDiBenedetto Apr 22, 2021
783bd74
Fixed JNI tests
DanieleDiBenedetto Apr 22, 2021
709a0ad
ASM optimizations added to build process
phoinic Apr 25, 2021
c1fdf2b
Updated Rust part
DanieleDiBenedetto Apr 26, 2021
1a2a108
Fixing issues from codereview.
Apr 27, 2021
880bcbb
Cargo dependencies updated
phoinic Apr 27, 2021
a36c96d
Added key generation functions + refactored and cleaned up code
DanieleDiBenedetto Apr 28, 2021
3aca007
Fixed getCertLeaves function. Updated test for getCertLeaves.
Apr 30, 2021
4f69fd6
Addressed comments in PR
DanieleDiBenedetto May 3, 2021
00cbba8
Updated Java part
DanieleDiBenedetto May 3, 2021
7f63323
Merge pull request #44 from HorizenOfficial/updatable_poseidon_tweedle
albertog78 May 3, 2021
a9d2535
Updated NaiveThresholdSignatureCircuit
DanieleDiBenedetto May 3, 2021
8be176b
Fixed bugs in VRF/Circuit functions
DanieleDiBenedetto May 4, 2021
78c6252
Changed constants handling
DanieleDiBenedetto May 4, 2021
d2ecb53
Fixed build script
DanieleDiBenedetto May 4, 2021
c4ef55c
Restored UT
DanieleDiBenedetto May 4, 2021
5c43fa3
Restored PoseidonHash and MerkleTree Java UTs
DanieleDiBenedetto May 4, 2021
e7bed3c
Merge branch 'updatable_poseidon_tweedle' into sync_with_cctp_lib
DanieleDiBenedetto May 4, 2021
344c11b
Update README.md
DanieleDiBenedetto May 4, 2021
5641202
Updated Cargo.toml
DanieleDiBenedetto May 4, 2021
43ebba7
Merge refactor_interfaces into commitment_jni_tweedle. Conflicts reso…
i-Alex May 4, 2021
390b2e4
Moved serialization functions to zendoo-cctp-lib
DanieleDiBenedetto May 4, 2021
7a1e7fa
Moved PoseidonHash, MHT and key generation functions to cctp-lib
DanieleDiBenedetto May 4, 2021
c750599
Sync with cctp_lib changes to ProvingSystem enum and MHT append function
DanieleDiBenedetto May 5, 2021
6569f2c
Merge with sync_with_cctp_lib
phoinic May 5, 2021
cdb99a5
Rust toolchain fixed
phoinic May 5, 2021
2746c0c
Merge branch 'optmizations_asm_merge' into optmizations_asm
phoinic May 5, 2021
267cedd
CONTAINER_RUST_VER updated
phoinic May 5, 2021
2c7956d
Rust version updated
phoinic May 5, 2021
58ee742
Commitment tree interface changes to support cctp refactor_interfaces…
i-Alex May 6, 2021
3fc00d3
CCTP interface updated.
i-Alex May 6, 2021
59785f0
CommitmentTree interface updated according to CCTP lib changes.
i-Alex May 7, 2021
0b21721
Sync with latest cctp lib update
DanieleDiBenedetto May 7, 2021
70d6501
Sync with latest cctp-lib: generic proof, pk and vk types
DanieleDiBenedetto May 11, 2021
7b0d596
Sync with cctp-lib: removed ProvingSystemUtils trait
DanieleDiBenedetto May 12, 2021
c7bb12f
Reintroduced ProvingSystem enum for doing checks at deserialization
DanieleDiBenedetto May 13, 2021
208f191
Updated Cargo.toml
DanieleDiBenedetto May 13, 2021
5e918e8
Merge sync_with_cctp_lib into cctp_integration
i-Alex May 14, 2021
69a77aa
Sync with cctp-lib: add function to get psType and remove psType from…
DanieleDiBenedetto May 14, 2021
73a172a
CCTP ComTree interface changes.
i-Alex May 14, 2021
ae5653d
Merge branch 'sync_with_cctp_lib' into cctp_integration
i-Alex May 14, 2021
9b9869f
Absense proof deallocation jni interface fix.
i-Alex May 17, 2021
7378f3f
Calculate sidechain id methods added.
i-Alex May 17, 2021
eec596c
jarraybyte parsing method fixed. CaclulateScId method tests updated.
i-Alex May 20, 2021
ccc99ee
Refined computeScId code + added UT
DanieleDiBenedetto May 21, 2021
fcf8915
CCTP dependency updated with interface changes.
i-Alex May 24, 2021
5b708dc
updating the ci
lander86 May 25, 2021
286710e
Fix ci/setup_env.sh
lander86 May 25, 2021
cfde2ab
Updated initDlogKeys()
DanieleDiBenedetto May 26, 2021
e7baf8f
CCTP/ginger libs dependencies fixes.
i-Alex May 26, 2021
0ee9577
JNI: BackwardTransfers parsing fixed.
i-Alex May 28, 2021
1ea0ff6
Bitvector merkle root computation added.
i-Alex May 31, 2021
0d3d101
Removed paths from initDlogKeys
DanieleDiBenedetto May 31, 2021
3083565
Merge pull request #49 from HorizenOfficial/cctp_integration
albertog78 Jun 3, 2021
edecae6
Merge pull request #46 from HorizenOfficial/sync_with_cctp_lib
albertog78 Jun 3, 2021
ee40655
Add extra ci jobs for asm and target-feature
cronicc Jun 7, 2021
0dc110d
Added sc_id to cert_data_hash
DanieleDiBenedetto Jun 7, 2021
7016d41
Bitvector merkle root with size check method added. Deserialization i…
i-Alex Jun 8, 2021
37397c0
VRFProof deserialization interface updated.
i-Alex Jun 8, 2021
6479eb6
More options when serializing/deserializing: updated Rust part, Rust …
DanieleDiBenedetto Jun 11, 2021
3d53cfa
Fixed Java part
DanieleDiBenedetto Jun 14, 2021
c1397cf
Restored ci script
DanieleDiBenedetto Jun 14, 2021
9b34141
Slight modifications of serialization/deserialization interfaces
DanieleDiBenedetto Jun 14, 2021
9a7f58d
Merge pull request #51 from HorizenOfficial/sc_id_cert
albertog78 Jun 17, 2021
9b50157
Merge pull request #52 from HorizenOfficial/bitvector_and_deserializa…
albertog78 Jun 17, 2021
4934855
Merge branch 'development_tmp' into ser_deser_more_opts
DanieleDiBenedetto Jun 17, 2021
238b01b
Updated dependencies
DanieleDiBenedetto Jun 17, 2021
d9a8d2d
Fix automerge error
DanieleDiBenedetto Jun 17, 2021
c46b004
Merge pull request #54 from HorizenOfficial/ser_deser_more_opts
DanieleDiBenedetto Jun 17, 2021
f1c0075
Check proof and vk size on setup
DanieleDiBenedetto Jun 21, 2021
566eece
Make check on proof and vk size mandatory
DanieleDiBenedetto Jun 21, 2021
e7912ce
Fixed Cargo.toml
DanieleDiBenedetto Jun 21, 2021
d764dea
temporarly simplyfing the ci
lander86 Jun 23, 2021
3d8b478
Updated outdated dependencies
DanieleDiBenedetto Jun 23, 2021
68719da
Merge branch 'optmizations_asm' into updating_ci
DanieleDiBenedetto Jun 24, 2021
86997fa
Merge pull request #50 from HorizenOfficial/updating_ci
DanieleDiBenedetto Jun 24, 2021
10fe596
Merge branch 'development_tmp' into optmizations_asm
DanieleDiBenedetto Jun 24, 2021
1d546d0
Merge pull request #48 from HorizenOfficial/optmizations_asm
DanieleDiBenedetto Jun 24, 2021
a21ccf1
Check path semantic validity before verifying it
DanieleDiBenedetto Jul 6, 2021
4793f82
Merge branch 'development_tmp' into audit_fixes
DanieleDiBenedetto Jul 6, 2021
1ea0c79
Restored commented Java tests
DanieleDiBenedetto Jul 7, 2021
89147ad
Removed unused import
DanieleDiBenedetto Jul 7, 2021
21c70d5
Merge pull request #59 from HorizenOfficial/restore_java_tests
DanieleDiBenedetto Jul 7, 2021
8a97a4a
implementing cargo audit
lander86 Jul 22, 2021
3ff3bda
Merge pull request #60 from HorizenOfficial/adding_cargo_audit
lander86 Jul 26, 2021
63f331d
Merge branch 'proof_vk_check' into audit_fixes
DanieleDiBenedetto Jul 27, 2021
3c69e51
Merge branch 'development_tmp' into proof_vk_check
DanieleDiBenedetto Jul 27, 2021
cf6fe8b
Merge branch 'proof_vk_check' into audit_fixes
DanieleDiBenedetto Jul 27, 2021
56bba93
Merge pull request #57 from HorizenOfficial/proof_vk_check
DanieleDiBenedetto Jul 27, 2021
a65b819
Merge pull request #58 from HorizenOfficial/audit_fixes
DanieleDiBenedetto Jul 27, 2021
34eff8b
Merge branch 'proof_vk_check' into development_tmp
DanieleDiBenedetto Jul 27, 2021
b3132f2
Accurate errors handling
phoinic Aug 10, 2021
dbe0ded
feat: adjusted to the merkle tree finalization updates
phoinic Aug 24, 2021
b6ca4ba
CommitmentTree: FT mc return address added.
i-Alex Aug 31, 2021
f368c9d
Merge branch 'development_tmp' into audit_fixes_005
DanieleDiBenedetto Sep 1, 2021
b6e57b9
Bug fix
DanieleDiBenedetto Sep 1, 2021
410076c
Wrapping up some expects
phoinic Sep 2, 2021
db34087
Java tests updated and comments regarding return values added
phoinic Sep 2, 2021
1a18bd2
Expects returned and TODO added for serialization failure
phoinic Sep 3, 2021
1d71577
Addressed remaining comments
DanieleDiBenedetto Sep 3, 2021
b9997d7
Added macro to wrap each function in a catch_unwind closure and added…
DanieleDiBenedetto Sep 10, 2021
571136e
Added new throw! and throw_and_exit! macros, leading to more clean code
DanieleDiBenedetto Sep 16, 2021
6a89642
Made panickingFunction protected as it's used only for testing purposesù
DanieleDiBenedetto Oct 27, 2021
dfae960
Merge pull request #61 from HorizenOfficial/audit_fixes_005
DanieleDiBenedetto Oct 27, 2021
111606e
Merge branch 'development_tmp' into ft_return_address
DanieleDiBenedetto Oct 27, 2021
5b47f0e
Merge pull request #62 from HorizenOfficial/ft_return_address
DanieleDiBenedetto Oct 27, 2021
86d6f66
Merge pull request #47 from HorizenOfficial/development_tmp
lander86 Oct 27, 2021
b1c67d3
Merge branch 'development' into dependabot/maven/jni/junit-junit-4.13.1
DanieleDiBenedetto Oct 27, 2021
4644b18
Merge pull request #41 from HorizenOfficial/dependabot/maven/jni/juni…
DanieleDiBenedetto Oct 27, 2021
71213b0
Updated dependencies
DanieleDiBenedetto Oct 27, 2021
120c2af
cargo fmt
DanieleDiBenedetto Oct 27, 2021
f089147
Updated authors and version
DanieleDiBenedetto Oct 27, 2021
6cf28bd
Push allowed clippy lints
DanieleDiBenedetto Oct 27, 2021
4f77411
Run clippy autofix
DanieleDiBenedetto Oct 27, 2021
bc956d8
Update README.md
DanieleDiBenedetto Oct 27, 2021
89cb0b0
Bump guava version from 21.0 to 30.0-jre
DanieleDiBenedetto Oct 27, 2021
5ba6ea8
Updated jar version to 0.4.0
DanieleDiBenedetto Oct 28, 2021
9ba91a4
Added AUTHORS and LICENSE files and edited README accordingly
DanieleDiBenedetto Oct 28, 2021
d8fe7c8
Merge branch 'release_0_2_0' of https://github.com/HorizenOfficial/ze…
DanieleDiBenedetto Oct 28, 2021
f0f3c0d
Update README.md
DanieleDiBenedetto Nov 11, 2021
152cf4c
Added BUILD and CONTRIBUTING files
DanieleDiBenedetto Nov 11, 2021
4cb861d
Update BUILD.md
DanieleDiBenedetto Nov 11, 2021
d77803b
updated dependencies
lander86 Nov 11, 2021
97cc802
Merge branch 'master' into release_0_2_0
DanieleDiBenedetto Nov 11, 2021
4f597f7
bumped version to 0.4.0
lander86 Nov 11, 2021
45806b8
Merge branch 'master' into release_0_2_0
DanieleDiBenedetto Nov 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: linux
dist: bionic
dist: focal
language: generic
addons:
apt:
Expand All @@ -10,13 +10,21 @@ services:

env:
global:
- CONTAINER_JAVA_VER="openjdk-8-jdk=8u252-b09-1~16.04"
- CONTAINER_RUST_VER="1.41.0"
- CONTAINER_JAVA_VER="openjdk-8-jdk"
jobs:
#- name: rust_1.51
# env: CONTAINER_RUST_VER='1.51.0'
#- name: rust_1.51_asm
# env: CONTAINER_RUST_VER='1.51.0' RUSTFLAGS='--emit=asm'
- name: rust_1.51_asm_target-feature
env: CONTAINER_RUST_VER='1.51.0' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'
#- name: rust_nightly
# env: CONTAINER_RUST_VER='nightly-2021-04-25' RUSTFLAGS='-C target-feature=+bmi2,+adx --emit=asm'

script: >-
source ci/setup_env.sh &&
docker build --pull --no-cache -t zencash/zendoo-sc-cryptolib-builder ./ci &&
bash -c "docker run --rm -v $(pwd):/build -v ${HOME}/key.asc:/key.asc --tmpfs /tmp:uid=$(id -u),gid=$(id -g),exec,mode=1777 \
--tmpfs /run:uid=$(id -u),gid=$(id -g),exec,mode=1777 -e LOCAL_USER_ID=$(id -u) -e LOCAL_GRP_ID=$(id -g) \
--tmpfs /run:uid=$(id -u),gid=$(id -g),exec,mode=1777 -e RUSTFLAGS -e LOCAL_USER_ID=$(id -u) -e LOCAL_GRP_ID=$(id -g) -e CARGO_AUDIT_EXIT_ON_ERROR \
$(env | grep -E '^CONTAINER_' | sed -n '/^[^\t]/s/=.*//p' | sed '/^$/d' | sed 's/^/-e /g' | tr '\n' ' ') \
zencash/zendoo-sc-cryptolib-builder /build/ci/start_ci.sh"
6 changes: 6 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Daniele Di Benedetto <daniele@horizenlabs.io>
Oleksandr Iozhytsia <oleksandr@zensystem.io>
Volodymyr Babaiev <volodymyr.babaiev@infopulse.com>
Maksym Vereshchak <phoinic@gmail.com>
Luigi Varriale <luigi@horizenlabs.io>
cronicc <cronic@horizenlabs.io>
42 changes: 42 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Build guide

The library compiles on the `1.51.0 stable` toolchain of the Rust compiler. To install Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the appropriate Rust toolchain by invoking:
```bash
rustup install 1.51.0
```
After that, use `cargo`, the standard Rust build tool, to build the library:
```bash
git clone https://github.com/HorizenOfficial/ginger-lib.git
cd ginger-lib
cargo build --release
```
This library comes with unit tests for each of the provided crates. Run the tests with:
```bash
cargo test --all-features
```
Compiling with `adcxq`, `adoxq` and `mulxq` instructions can lead to a 30-70% speedup. These are available on most `x86_64` platforms (Broadwell onwards for Intel and Ryzen onwards for AMD). Run the following command:
```bash
RUSTFLAGS="-C target-feature=+bmi2,+adx" cargo test/build/bench --features asm
```
Tip: If optimising for performance, your mileage may vary with passing `--emit=asm` to `RUSTFLAGS`.

## Java Jar build guide

To be able to build a Java Jar package you can use the `build_jar.sh` script in `ci` folder.
Requirements:
1. Build on Linux (Ubuntu 18.04+, for example) with a cross compilation of a native Rust code for windows target as well.
2. Add windows target support for `cargo`:
```
rustup target add x86_64-pc-windows-gnu
rustup toolchain install stable-x86_64-pc-windows-gnu
```
3. Install maven, openjdk, clang, llvm, mingw:
```
sudo apt-get install clang llvm maven gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
```
4. Configure `mingw` to be able to cross compile the windows target of cryptolib dependencies:
```
update-alternatives --install /usr/bin/x86_64-w64-mingw32-gcc x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix 100
update-alternatives --install /usr/bin/x86_64-w64-mingw32-g++ x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix 100
```
5. Run `./ci/build_jar.sh`
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Contributing

Contributions are welcomed! Bug fixes and new features can be initiated through GitHub pull requests. To speed the code review process, please adhere to the following guidelines:

* Follow Horizen repositories' *code of conduct*
* Follow Horizen repositories' *styling guide*
* Please gpg sign your commits
* Please make sure you push your pull requests to the development branch
28 changes: 24 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[workspace]

members = ["demo-circuit", "ouroboros", "api"]
members = [
"demo-circuit",
#"ouroboros",
"api"
]

[profile.release]
opt-level = 3
Expand All @@ -16,6 +20,22 @@ panic = "unwind"
opt-level = 3
lto = "thin"
incremental = true
debug-assertions = true
debug = true
panic = "unwind"
panic = "unwind"

# Uncomment these lines for local development paths
#
#[patch.'https://github.com/HorizenOfficial/ginger-lib.git']
#algebra = { path = '../ginger-lib/algebra' }
#primitives = { path = '../ginger-lib/primitives' }
#r1cs-core = { path = '../ginger-lib/r1cs/core' }
#r1cs-crypto = { path = '../ginger-lib/r1cs/gadgets/crypto' }
#r1cs-std = { path = '../ginger-lib/r1cs/gadgets/std' }
#
#[patch.'https://github.com/HorizenOfficial/zendoo-cctp-lib.git']
#cctp_primitives = { path = '../zendoo-cctp-lib/cctp_primitives' }
#
#[patch.'https://github.com/HorizenLabs/marlin']
#marlin = { path = '../marlin' }
#
#[patch.'https://github.com/HorizenLabs/poly-commit']
#poly-commit = { path = '../poly-commit' }
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
73 changes: 34 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@

# zendoo-sc-cryptolib
<h1 align="center">zendoo-sc-cryptolib</h1>
<p align="center">
<a href= "https://github.com/HorizenOfficial/zendoo-sc-cryptolib/releases"><img src="https://img.shields.io/github/release/HorizenOfficial/zendoo-sc-cryptolib.svg"></a>
<a href="AUTHORS"><img src="https://img.shields.io/github/contributors/HorizenOfficial/zendoo-sc-cryptolib.svg?"></a>
<a href="https://travis-ci.com/github/HorizenOfficial/zendoo-sc-cryptolib"><img src="https://app.travis-ci.com/HorizenOfficial/zendoo-sc-cryptolib.svg?branch=master"></a>
<a href="LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square"></a>
</p>

`zendoo-sc-cryptolib` is a Rust crate that exposes to Java, through JNI, the [ginger-lib](https://github.com/HorizenOfficial/ginger-lib) components needed by the [Zendoo](https://eprint.iacr.org/2020/123.pdf "Zendoo") sidechain SDK.

In particular it exposes interfaces to:

* handle the finite fields that are the alphabets of the zk Proving Systems
* call the Poseidon function, a Snark friendly hashing algorithm
* use a Poseidon-based Merkle Tree (calculate root, verify merkle path, ...)
* compute and verify Schnorr signatures, handle associated keypairs
* compute and verify a VRF proof, fetch a VRF output, handle associated keypairs (to support Ouroborous-style PoS sidechain consensus)
* create and manage Zendoo Sidechain proofs
* call the *Poseidon* function, a Snark friendly hashing algorithm
* use a full in-memory *Poseidon-based Merkle Tree*, thus optimized for performance but limited in size (depending on the available RAM)
* manage the *SCTxsCommitmentTree*, as described in section 4.1.3 of the [Zendoo](https://eprint.iacr.org/2020/123.pdf "Zendoo") paper
* compute and verify *Schnorr* signatures, handle associated keypairs
* compute and verify a VRF proof, fetch a VRF output, handle associated keypairs (to support *Ouroborous*-style PoS sidechain consensus)
* create and manage *Zendoo* Sidechain proofs

The library includes also an example of a simple Zendoo [sidechain proving circuit](demo-circuit) that can be used to create proofs for backward transfer certificates. This demo circuit can prove that a given certificate was signed by a minimum number of signers, all belonging to a defined set of approved signers. For more info, pls see the specific [document](doc).
The circuit is offered as an example to developers, to help them build their own circuits, that will match their sidechain logic and needs.

**Please note: the code is in development. No guarantees are provided about its security and functionality**

## Release Notes

The current release does not yet serve proof composition.
The proving system has been switched from [Groth16](https://eprint.iacr.org/2016/260.pdf) to our Marlin variant [*Coboundary Marlin*](https://github.com/HorizenLabs/marlin).
Support has been introduced to create *Final Darlin* proofs, as per last step of our recursive PCD scheme (See [HGB](https://eprint.iacr.org/2021/930) for details), but not yet implemented.

## Build guide

The library can be built by using Cargo:

The library compiles on the `1.51.0 stable` toolchain of the Rust compiler.
To install Rust, first install `rustup` by following the instructions [here](https://rustup.rs/), or via your platform's package manager.
Once `rustup` is installed, install the appropriate Rust toolchain by invoking:
```bash
rustup install 1.51.0
```
cargo build
```

There are a few Rust tests that can be executed still with the usual Cargo command:

After that, use `cargo`, the standard Rust build tool, to build the library:
```bash
git clone https://github.com/HorizenOfficial/zendoo-sc-cryptolib.git
cd zendoo-sc-cryptolib
cargo build --release
```
cargo test
```


## Contributing

Contributions are welcomed! Bug fixes and new features can be initiated through GitHub pull requests. To speed the code review process, please adhere to the following guidelines:

* Follow Horizen repositories' *code of conduct*
* Follow Horizen repositories' *styling guide*
* Please gpg sign your commits
* Please make sure you push your pull requests to the development branch

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

## License

The code is licensed under the following license:

* MIT license ([LICENSE-MIT](http://opensource.org/licenses/MIT) or http://opensource.org/licenses/MIT)

Unless you explicitly state otherwise, any contribution submitted for inclusion in ginger-lib by you shall be licensed as above, without any additional terms or conditions.

[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)


This library comes with unit tests for each of the provided crates. Run the tests with:
```bash
cargo test
```
More detailed build guide, as well as instructions to build the .jar, can be found in in our [build guide](BUILD.md).
5 changes: 0 additions & 5 deletions api/.gitignore

This file was deleted.

35 changes: 24 additions & 11 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
[package]
name = "api"
version = "0.3.0"
authors = ["DanieleDiBenedetto <daniele@horizenlabs.io>"]
version = "0.4.0"
authors = [
"DanieleDiBenedetto <daniele@horizenlabs.io>",
"Oleksandr Iozhytsia <oleksandr@zensystem.io>",
"Volodymyr Babaiev <volodymyr.babaiev@infopulse.com>",
"Maksym Vereshchak <phoinic@gmail.com>",
"Luigi Varriale <luigi@horizenlabs.io>",
"cronicc <cronic@horizenlabs.io>",
]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
algebra = { git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.2.0"}
primitives = { features = ["merkle_tree", "signature", "vrf"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.2.0"}
proof-systems = { features = ["groth16"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.2.0"}
algebra = {features = ["tweedle"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.3.0"}
primitives = {features = ["tweedle", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.3.0"}

ouroboros = {path = "../ouroboros"}
cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", tag = "0.1.0" }

#ouroboros = {path = "../ouroboros"}
demo-circuit = {path = "../demo-circuit"}

jni = "0.6.1"
derivative = "1"
jni = "0.19.0"
derivative = "2.2.0"
lazy_static = "1"
radix_trie = "0.1"
rand = { version = "0.7" }
rand_xorshift = { version = "0.2" }
radix_trie = "0.2.1"
rand = { version = "0.8.4" }
rand_xorshift = { version = "0.3.0" }
blake2 = { version = "0.8.1", default-features = false }

[lib]
name = "zendoo_sc"
path = "src/lib.rs"
crate_type = ["cdylib"]

[features]
default = [ "asm" ]
asm = [ "algebra/llvm_asm", "cctp_primitives/asm", "demo-circuit/asm" ]
Loading