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

Pedersen commitment example in c++ #397

Merged
merged 10 commits into from
Feb 28, 2024
Merged

Conversation

svpolonsky
Copy link
Contributor

Describe the changes

Show using Icicle's MSM to perform Pedersen commitment

#include <cassert>
#include <nvml.h>

#define CURVE_ID 1
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use
#define CURVE_ID BN254
This is much more readable

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, would be great to change it in all examples

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

set(CMAKE_CUDA_FLAGS_RELEASE "")
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G -O0")
# change the path to your Icicle location
include_directories("../../../icicle")
Copy link
Collaborator

@jeremyfelder jeremyfelder Feb 26, 2024

Choose a reason for hiding this comment

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

This isn't specific to this example but it would be good to compile ICICLE once for all of the c++ examples and use target_link_libraries to link icicle. It would reduce the CI time significantly

## What's in the example

1. Define the curve and the size of commitment vector
2. Use public random seed to transparently generate elliptic points without known discrete logarithm
Copy link
Member

Choose a reason for hiding this comment

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

suggested rewrite: points on the elliptic curve

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Corrected.

@svpolonsky svpolonsky merged commit a37f4c5 into dev Feb 28, 2024
19 checks passed
@svpolonsky svpolonsky deleted the temp/stas/pedersen-commitment branch February 28, 2024 14:44
@jeremyfelder jeremyfelder mentioned this pull request Feb 28, 2024
jeremyfelder added a commit that referenced this pull request Feb 28, 2024
* initial commit

* random elliptic points

* initial complete example

* public random seed to prevent knowing dlogs

* cleaned up code

* add README

* Update examples/c++/pedersen-commitment/README.md

Co-authored-by: Jeremy Felder <[email protected]>

* updates to PR comments

* codespell compliance

* corrected terminology in README

---------

Co-authored-by: Jeremy Felder <[email protected]>
jeremyfelder added a commit that referenced this pull request Feb 29, 2024
Release v1.6.0

- Add vector operations to golang bindings #399 
- Add Pederson commitment example in c++ #397
- Update CI for faster/better flow #398 
- Fix dev docs CI #405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants