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

Algebra OCL integration #81

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c0aa61f
Integration with ginger-algebra-ocl: MSM
phoinic Dec 20, 2020
ac3368e
FFT GPU integration
phoinic Dec 20, 2020
338827d
GPU FFT bugfix
phoinic Dec 20, 2020
83ae8f7
Change FFT test to BLS
phoinic Dec 20, 2020
3f6facc
GPU unit-tests adjusted
phoinic Dec 20, 2020
ab4e5fe
Bellperson renamed to algenra-cl-gen
phoinic Dec 20, 2020
4899a3f
Bellperson renamed to algenra-cl-gen
phoinic Dec 20, 2020
9073e3f
Polycommit module implemented
phoinic Dec 20, 2020
e6bb468
Panic messaging fixed
phoinic Dec 20, 2020
4b86eff
Templating approach changed for polycommit reduce
phoinic Dec 20, 2020
e98e2ff
Set min limit to invoke GPU
phoinic Dec 20, 2020
9973807
Linking packages to GIT
phoinic Dec 20, 2020
612aa96
Dependency import bugfix
phoinic Dec 20, 2020
82a54c1
Tweedle curve added
phoinic Dec 27, 2020
e7f7e91
Tweedle implementation bugfixes
phoinic Dec 27, 2020
2edeafc
Benches migrated from Zexe
phoinic Dec 27, 2020
6e5b3e2
ASM feature added to algebra-utils
phoinic Dec 27, 2020
59c804e
Benches bugfix
phoinic Dec 27, 2020
d64045e
Add tweedle to r1cs-std
phoinic Dec 28, 2020
0a1937c
log2 function added
phoinic Dec 28, 2020
5069ae1
Merge with 'all'
phoinic Dec 28, 2020
30bc437
log2_floor call bugfix
phoinic Dec 28, 2020
8c58de7
Dependency usage bugfix
phoinic Dec 28, 2020
d04c424
Polycommit removed from ginger-lib
phoinic Dec 28, 2020
dc5dd2a
Reduce groth16 bench to 2^22 max
phoinic Dec 28, 2020
44826d5
MSM switched to affine
phoinic Dec 28, 2020
8d33e68
Call parameter bugfix
Dec 28, 2020
2b31a1f
Curves features updated
phoinic Dec 28, 2020
606a9c0
Merge branch 'algebra_ocl' of github.com:HorizenOfficial/ginger-lib i…
phoinic Dec 28, 2020
f87de26
algebra utils path bugfix
phoinic Dec 28, 2020
04e59f0
algebra utils path bugfix
phoinic Dec 28, 2020
df06696
Implementation of Poseidon Hash for Tweedle
mkaihara Dec 30, 2020
08b63b3
ginger-algebra-ocl branch switched
phoinic Jan 3, 2021
2344d88
Updated dependencies
DanieleDiBenedetto Jan 5, 2021
3afbdf2
Merge branch 'all' into algebra_ocl
DanieleDiBenedetto Jan 5, 2021
e9b317d
Merge branch 'all' into algebra_ocl
DanieleDiBenedetto Jan 5, 2021
9849e49
Reverted algebra dependencies to be specified in git form
DanieleDiBenedetto Jan 5, 2021
fa67f2a
AlgebraicSponge primitive and gadgets for Poseidon + tests refactoring
DanieleDiBenedetto Jan 11, 2021
35d8113
Merge branch 'all' into algebra_ocl
DanieleDiBenedetto Jan 11, 2021
5df4e63
Changed squeeze logic
DanieleDiBenedetto Jan 11, 2021
a0b423f
Merge branch 'all' into algebra_ocl
DanieleDiBenedetto Jan 11, 2021
fb60c47
Unit-tests and small bugfixes
phoinic Jan 12, 2021
de55c1c
Merge branch 'algebra_ocl' of github.com:HorizenOfficial/ginger-lib i…
phoinic Jan 12, 2021
7b6376c
Local development cargo settings
phoinic Jan 12, 2021
7a491d1
msm for cpu with optimized window sizes
mkaihara Jan 12, 2021
52ee7bc
Affine feature typo fixed and same curve for GPU and CPU tests is used
phoinic Jan 14, 2021
f756ac4
Removing crossbeam dependency
phoinic Jan 14, 2021
4865d36
Separate tests for CPU and GPU
phoinic Jan 14, 2021
c71c48f
Tweedle fields unit-tests: base
phoinic Jan 18, 2021
93e29df
Tweedle unit-tests
phoinic Jan 18, 2021
4bacbe9
Revert "Merge branch 'all' into algebra_ocl"
DanieleDiBenedetto Jan 19, 2021
d5d44f2
Revert "Merge branch 'all' into algebra_ocl"
DanieleDiBenedetto Jan 19, 2021
e2cfa15
Revert "Merge branch 'all' into algebra_ocl"
DanieleDiBenedetto Jan 19, 2021
649337c
Revert "Merge branch 'all' into algebra_ocl"
DanieleDiBenedetto Jan 19, 2021
464969d
Resolved conflicts after merging with msm_cpu
mkaihara Jan 28, 2021
171f101
Resolved conflicts from merging poseidon_tweedle
mkaihara Jan 28, 2021
683462b
Minor correction on variable_base
mkaihara Jan 28, 2021
a18ce2f
Changed benches for msm
mkaihara Jan 28, 2021
a2f7488
Changed benches MSM
mkaihara Jan 28, 2021
77bd942
MSM issues bugfix
phoinic Feb 9, 2021
4052bf4
Refactored MSM tests
DanieleDiBenedetto Feb 12, 2021
03bcf6b
Disabled multi_scalar_mul_affine_sd_c function
DanieleDiBenedetto Feb 12, 2021
691ad91
Added MHT parameters for TweedleFr.
Mar 9, 2021
942f678
Added MHT parameters for TweedleFq.
Mar 9, 2021
5c59592
Remove custom definition for MSM
phoinic Mar 10, 2021
5666b47
Add tweedle to r1cs
phoinic Mar 18, 2021
c0764d4
ToConstraintFieldGadget trait implementation for SWAffineGadget
phoinic Mar 19, 2021
ba0e2d7
ToBytes / FromBytes implementation for polynomials
phoinic Mar 22, 2021
a1d2f0e
Parameters converted to hex representation
phoinic Mar 22, 2021
47a86da
Added get_leaves() function to InMemoryOptimizedMHT
DanieleDiBenedetto Mar 24, 2021
35d5bf6
Change visibility of get_leaves() function
DanieleDiBenedetto Mar 24, 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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/.vscode

target
Cargo.lock
*.idea
*.iml
*.orig
primitives/src/merkle_tree/field_based_mht/smt/rocksdb_storage/*

coeffs_*
msm_bases_*
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

members = [
"algebra",
"algebra-utils",
"bench-utils",
"primitives",
"proof-systems",
Expand Down Expand Up @@ -32,3 +33,12 @@ lto = "thin"
incremental = true
debug-assertions = true
debug = true

# Uncomment these lines for local development paths
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we put the URLs in each Cargo.toml of the project, so we can as well delete this.
Weren't you able to find any other solution ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually what you see in Cargo.toml now - is the only "solution" I found for more effective development. I am uncommenting these lines in all repos, and local folders instead of GIT urls are used. In case of mixing local paths and GIT urls I am getting the incompatibility error in all combinations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood :/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some instructions on the readme.MD to explain this and open an issue


# [patch.'https://github.com/HorizenOfficial/ginger-lib']
# algebra = { path = './algebra' }

# [patch.'https://github.com/HorizenOfficial/ginger-algebra-ocl']
# algebra-kernels = { path = '../ginger-algebra-ocl/algebra-kernels' }
# algebra-cl-gen = { path = '../ginger-algebra-ocl/algebra-cl-gen' }
84 changes: 84 additions & 0 deletions algebra-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[package]
name = "algebra-utils"
version = "0.1.0"
authors = [
"Sean Bowe",
"Alessandro Chiesa",
"Matthew Green",
"Ian Miers",
"Pratyush Mishra",
"Howard Wu",
"Daniele Di Benedetto <[email protected]>",
"Marcelo Kaihara <[email protected]>",
"Ulrich Haboeck <[email protected]>"
]
description = "A library for finite fields, elliptic curves and FFTs evaluation over prime finite fields"
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
license = "MIT/Apache-2.0"
edition = "2018"

################################# Dependencies ################################

[dependencies]
algebra = { git = "https://github.com/HorizenOfficial/ginger-lib", branch = "algebra_ocl", features = [ "parallel" ] }

rand = { version = "0.7" }

rayon = { version = "1", optional = true }

# gpu feature
algebra-kernels = { git = "https://github.com/HorizenOfficial/ginger-algebra-ocl", branch = "ginger_ocl", optional = true }
algebra-cl-gen = { git = "https://github.com/HorizenOfficial/ginger-algebra-ocl", branch = "ginger_ocl", optional = true }

[dev-dependencies]
blake2 = "0.7"
criterion = "0.3.3"
rand_xorshift = { version = "0.2" }
paste = "1.0"
bench-utils = { path = "../bench-utils" }
algebra-utils = { path = "../algebra-utils", features = ["dev"] }

[features]
default = [ "parallel", "fft", "msm_affine" ]
dev = [ "bls12_381", "bn_382", "tweedle", "mnt4_753", "mnt6_753" ]

parallel = [ "rayon" ]
fft = []
msm_affine = []
gpu = [ "parallel", "algebra-kernels", "algebra-cl-gen" ]
llvm_asm = [ "algebra/llvm_asm" ]

bls12_377 = [ "algebra-kernels/bls12_377", "algebra/bls12_377" ]
bls12_381 = [ "algebra-kernels/bls12_381", "algebra/bls12_381" ]
edwards_bls12 = [ "algebra-kernels/edwards_bls12", "algebra/edwards_bls12" ]
edwards_sw6 = [ "algebra-kernels/edwards_sw6", "algebra/edwards_sw6" ]
jubjub = [ "algebra-kernels/jubjub", "algebra/jubjub" ]
sw6 = [ "algebra-kernels/sw6", "algebra/sw6" ]
mnt4_753 = [ "algebra-kernels/mnt4_753", "algebra/mnt4_753" ]
mnt6_298 = [ "algebra-kernels/mnt6_298", "algebra/mnt6_298" ]
mnt6_753 = [ "algebra-kernels/mnt6_753", "algebra/mnt6_753" ]
bn_382 = [ "algebra-kernels/bn_382", "algebra/bn_382" ]
tweedle = [ "algebra-kernels/tweedle", "algebra/tweedle" ]

[build-dependencies]
rustc_version = "0.2"

[[bench]]
name = "fft_bn382"
path = "benches/fft/fft_bn382.rs"
harness = false

[[bench]]
name = "fft_tweedle"
path = "benches/fft/fft_tweedle.rs"
harness = false

[[bench]]
name = "variable_msm_bn382"
path = "benches/msm/variable_msm_bn382.rs"
harness = false

[[bench]]
name = "variable_msm_tweedle"
path = "benches/msm/variable_msm_tweedle.rs"
harness = false
Loading