62 Commits

Author SHA1 Message Date
yshekel
6a67893773 remove the recommnedation to use zk-contariners in examples (#569) 2024-08-01 14:58:02 +03:00
ChickenLover
ea71faf1fa add keccak tree builder (#555) 2024-07-15 15:31:12 +07:00
ChickenLover
7fd9ed1b49 Feat/roman/tree builder (#525)
# Updates:

## Hashing

 - Added SpongeHasher class
 - Can be used to accept any hash function as an argument
 - Absorb and squeeze are now separated
- Memory management is now mostly done by SpongeHasher class, each hash
function only describes permutation kernels

## Tree builder

 - Tree builder is now hash-agnostic. 
 - Tree builder now supports 2D input (matrices)
- Tree builder can now use two different hash functions for layer 0 and
compression layers

## Poseidon1

 - Interface changed to classes
 - Now allows for any alpha
 - Now allows passing constants not in a single vector
 - Now allows for any domain tag
 - Constants are now released upon going out of scope
 - Rust wrappers changed to Poseidon struct
 
 ## Poseidon2
 
 - Interface changed to classes
 - Constants are now released upon going out of scope
 - Rust wrappers changed to Poseidon2 struct
 
## Keccak

 - Added Keccak class which inherits SpongeHasher
 - Now doesn't use gpu registers for storing states
 
 To do:
- [x] Update poseidon1 golang bindings
- [x] Update poseidon1 examples
- [x] Fix poseidon2 cuda test
- [x] Fix poseidon2 merkle tree builder test
- [x] Update keccak class with new design
- [x] Update keccak test
- [x] Check keccak correctness
- [x] Update tree builder rust wrappers
- [x] Leave doc comments

Future work:  
- [ ] Add keccak merkle tree builder externs
- [ ] Add keccak rust tree builder wrappers
- [ ] Write docs
- [ ] Add example
- [ ] Fix device output for tree builder

---------

Co-authored-by: Jeremy Felder <jeremy.felder1@gmail.com>
Co-authored-by: nonam3e <71525212+nonam3e@users.noreply.github.com>
2024-07-11 13:46:25 +07:00
Stas
29da36d7be RISC0 example using Polynomial API (#548)
## New Example

This new c++ example shows the basics of RISC0 protocol using our
Polynomial API
2024-07-02 08:00:03 -06:00
Karthik Inbasekar
3a276ef23c added example cpp: example_commit_with_device_memory_view() (#532)
## Describe the changes

This PR...
Added an example for simple commit that makes use of polynomial views. 
Output attached

```
Example: a) commit with Polynomial views [(f1+f2)^2 + (f1-f2)^2 ]_1 = [4 (f1^2+ f_2^2)]_1
Example: b) commit with Polynomial views [(f1+f2)^2 - (f1-f2)^2 ]_1 = [4 f1 *f_2]_1
Setup: Generating mock SRS
Setup: SRS of length 1025 generated and loaded to device. Took: 19557 milliseconds
Setup: Generating polys (on device) f1,f2 of log degree 10
Setup: Gen poly done. Took: 7 milliseconds
Computing constraints..start 
Computing constraints..done. Took: 0 milliseconds
Computing Commitments with poly view
Commitments done. Took: 29 milliseconds
commitment [(f1+f2)^2 + (f1-f2)^2]_1:
[x: 0x1e35d81da10e5026dacdd907d6ed0dde673de449ff8c0137ec6acbfd6b1dfe1b, y: 0x21fc051415af35a781f84ebcf999313d489ae38ebefa561c9de2fb0b11091502]
commitment [[2 (f_1^2+f_2^2]_1:
[x: 0x1e35d81da10e5026dacdd907d6ed0dde673de449ff8c0137ec6acbfd6b1dfe1b, y: 0x21fc051415af35a781f84ebcf999313d489ae38ebefa561c9de2fb0b11091502]
commitment [(f1+f2)^2 - (f1-f2)^2]_1:
[x: 0x21e9dc012aef8d95107fbfe63f455d4345b9b21e37bcb0a49043b1066e211ffa, y: 0x2d6a3b2f1be1042a17c58ff595134b9cceb71d1af4f1c67a5696859cd4bafae3]
commitment [4 f_1*f_2]_1:
[x: 0x21e9dc012aef8d95107fbfe63f455d4345b9b21e37bcb0a49043b1066e211ffa, y: 0x2d6a3b2f1be1042a17c58ff595134b9cceb71d1af4f1c67a5696859cd4bafae3]
```

## Linked Issues

Resolves #
2024-06-05 18:25:12 +03:00
nonam3e
8e62bde16d bit reverse (#528)
This PR adds bit reverse operation support to icicle
2024-06-02 16:37:58 +07:00
Stas
02059fcfaa Stas/best-practice-ntt (#517)
## Describe the changes

Icicle examples:  Concurrent Data Transfer and NTT Computation

This PR introduces a Best Practice series of examples in c++.
Specifically, the example shows how to concurrently transfer data
to/from device and execute NTT

## Linked Issues

Resolves #
2024-05-16 23:51:49 +03:00
nonam3e
4496520a10 golang examples init (#516)
## Describe the changes

This PR adds golang examples

---------

Co-authored-by: Leon Hibnik <107353745+LeonHibnik@users.noreply.github.com>
Co-authored-by: Jeremy Felder <jeremy.felder1@gmail.com>
2024-05-16 19:40:13 +03:00
sukrucildirr
230a1da512 Fix broken link (#512)
## Describe the changes

There was a broken link is linked to ZKContainer word.

## Linked Issues

Resolves #
2024-05-14 08:36:39 +07:00
yshekel
2905d2a469 fix: bug regarding polynomial evaluations view in CUDA backend (#506)
fixing:
(1) not building polynomials and tests for grumpkin curve (no NTT)
(2) polynomial API C++ example compilation and (when compilation is
fixed) memory corruption
(3) bug fix in poly CUDA backend regarding transformation to evaluations
in some cases
2024-05-08 21:02:18 +03:00
Stas
41294b12e0 Stas/example poly (#434)
## Describe the changes

Added examples for Poly API

---------

Co-authored-by: Yuval Shekel <yshekel@gmail.com>
2024-05-07 11:52:13 +03:00
ChickenLover
7265d18d48 ICICLE V2 Release (#492)
This PR introduces major updates for ICICLE Core, Rust and Golang
bindings

---------

Co-authored-by: Yuval Shekel <yshekel@gmail.com>
Co-authored-by: DmytroTym <dmytrotym1@gmail.com>
Co-authored-by: Otsar <122266060+Otsar-Raikou@users.noreply.github.com>
Co-authored-by: VitaliiH <vhnatyk@gmail.com>
Co-authored-by: release-bot <release-bot@ingonyama.com>
Co-authored-by: Stas <spolonsky@icloud.com>
Co-authored-by: Jeremy Felder <jeremy.felder1@gmail.com>
Co-authored-by: ImmanuelSegol <3ditds@gmail.com>
Co-authored-by: JimmyHongjichuan <45908291+JimmyHongjichuan@users.noreply.github.com>
Co-authored-by: pierre <pierreuu@gmail.com>
Co-authored-by: Leon Hibnik <107353745+LeonHibnik@users.noreply.github.com>
Co-authored-by: nonam3e <timur@ingonyama.com>
Co-authored-by: Vlad <88586482+vladfdp@users.noreply.github.com>
Co-authored-by: LeonHibnik <leon@ingonyama.com>
Co-authored-by: nonam3e <71525212+nonam3e@users.noreply.github.com>
Co-authored-by: vladfdp <vlad.heintz@gmail.com>
2024-04-23 05:26:40 +03:00
Yuval Shekel
406020bda6 fix: NTT release domain linkage 2024-04-04 23:23:18 +03:00
Stas
d90081926f Pedersen commitment example in c++ (#397)
* 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 <jeremy.felder1@gmail.com>

* updates to PR comments

* codespell compliance

* corrected terminology in README

---------

Co-authored-by: Jeremy Felder <jeremy.felder1@gmail.com>
2024-02-28 18:09:03 +02:00
ChickenLover
efda4de48f add rust poseidon example (#392)
add rust poseidon example
2024-02-22 19:47:40 +02:00
yshekel
275b2f4958 feature: mixed-radix NTT fast twiddles mode (#382)
- this mode is allocating additional 4N twiddle-factors to achieve faster computation
- enabled by flag for initDomain(). Defaults to false.

Co-authored-by: hadaringonyama <hadar@ingonyama.com>
2024-02-22 00:02:02 +02:00
ChickenLover
965bf757f9 update examples with new vec ops (#388) 2024-02-21 22:30:40 +07:00
Stas
d1f19af64d Merge branch 'dev' into temp/stas/muli-gpu-example 2024-02-20 19:07:48 -06:00
stas
b1af193f6f fixed spelling 2024-02-20 19:14:25 -05:00
stas
4664cfded5 complied with reviewer's comments 2024-02-19 15:59:49 -05:00
stas
fb9e5c8511 updates example compares Radix2 and MixedRadix NTTs 2024-02-18 18:40:01 -05:00
Stas Polonsky
518a3ad9b6 ready for PR 2024-02-17 00:18:21 +00:00
Stas Polonsky
6681be549a fixed on-device memory issue 2024-02-16 19:43:58 +00:00
Stas Polonsky
319358427f cudaSetDevice in the thread function 2024-02-16 16:35:04 +00:00
Stas Polonsky
8dd52306dc update README 2024-02-15 23:07:33 +00:00
Stas Polonsky
418c3d844b completed example 2024-02-15 22:10:15 +00:00
ImmanuelSegol
29675bb40d executes without errors 2024-02-15 16:45:33 +00:00
ImmanuelSegol
481f144dc8 debug 2024-02-15 15:11:20 +00:00
ImmanuelSegol
086d36dd42 Merge remote-tracking branch 'origin/dev' into temp/stas/muli-gpu-example 2024-02-15 15:03:41 +00:00
ChickenLover
0929161a26 Merge branch 'dev' into fix-conflicts-main 2024-02-15 16:10:09 +07:00
ChickenLover
4f471ffa2a remove rust toolchains 2024-02-15 16:08:22 +07:00
Yuval Shekel
ba6c3ae59c merge NTT part 2024-02-15 10:28:02 +02:00
ChickenLover
fd08925ed4 merge WIP 2024-02-15 14:57:09 +07:00
ChickenLover
66018f2367 rename example folder 2024-02-15 14:13:18 +07:00
stas
62cf733c5f answers Roman's comments 2024-02-15 14:07:48 +07:00
DmytroTym
76c3b4ba01 Merge branch 'dev' into poseidon-examples-no-cuda 2024-02-15 08:27:28 +02:00
ImmanuelSegol
4d75fbac93 issue with init_optimized_poseidon_constants 2024-02-14 22:28:17 +00:00
VitaliiH
774250926c multi card support (#356)
multi-GPU support
2024-02-14 22:29:30 +01:00
DmytroTym
2008259adc Merge branch 'dev' into poseidon-examples-no-cuda 2024-02-14 21:10:25 +02:00
DmytroTym
303a3b8770 Temporarily removed Rust Poseidon example 2024-02-14 21:06:10 +02:00
yshekel
a02459c64d Mixed-radix NTT support all orderings (#371)
- Mixed-radix NTT orderings support
- radix-2 small refactor: split core logic to function and renamed ct_butterfly to dit
- testing both radix2 and mixed-radix algs for all ntt tests
2024-02-13 15:49:24 +02:00
ChickenLover
a65f44ad31 fix versioning problems 2024-02-09 15:55:36 +07:00
stas
582107fc7c added c++ example Poseidon-hash 2024-02-08 17:36:56 -05:00
Jeremy Felder
18fdd059da Fix: examples path deps (#363)
Change rust example deps to use paths

Co-authored-by: Leon Hibnik <107353745+LeonHibnik@users.noreply.github.com>
2024-02-08 20:43:12 +00:00
yshekel
382bec4ad3 Mixed-radix NTT algorithm
Co-authored-by: hadaringonyama <hadar@ingonyama.com>
2024-02-08 20:43:12 +00:00
Jeremy Felder
e77173f266 Fix: examples path deps (#363)
Change rust example deps to use paths

Co-authored-by: Leon Hibnik <107353745+LeonHibnik@users.noreply.github.com>
2024-02-08 16:23:44 +02:00
yshekel
3582df2669 Mixed-radix NTT algorithm
Co-authored-by: hadaringonyama <hadar@ingonyama.com>
2024-02-08 13:52:00 +02:00
ImmanuelSegol
04b1b3dda5 refactor: add a basic example 2024-02-07 20:07:21 -04:00
Jeremy Felder
bfd510b3bb Bump for release 2024-02-05 13:33:00 +02:00
Jeremy Felder
5a96f9937d Bump for release 2024-01-31 16:34:14 +02:00