ingonyama-zk / icicle

a GPU Library for Zero-Knowledge Acceleration
MIT License
303 stars 88 forks source link

Feat/roman/tree builder #525

Closed ChickenLover closed 2 weeks ago

ChickenLover commented 2 months ago

Updates:

Hashing

Tree builder

Poseidon1

Keccak

Future work:

ChickenLover commented 2 months ago

@yshekel 1) There are no rust bindings for now 2) Tree builder is just a template, so instantiations will be both in hash and in field libraries, depending on which hash it is 3) Well, if we go with the current FFI design, then we will need to reimplement the tree builder for every backend. For hash functions - yes, that will do fine, but I am not sure what to do with the tree builder in that case

yshekel commented 2 months ago

@yshekel

  1. There are no rust bindings for now
  2. Tree builder is just a template, so instantiations will be both in hash and in field libraries, depending on which hash it is
  3. Well, if we go with the current FFI design, then we will need to reimplement the tree builder for every backend. For hash functions - yes, that will do fine, but I am not sure what to do with the tree builder in that case

If we can implement a generic tree builder (that is backend agnostic) then we can have the backend APIs implement only the hashes and then wrap it with the generic tree builder that calls the hashing APIs and builds the tree (and expose that to ffi in addition to hashes). I am not sure it's possible but maybe it is. Otherwise we would have to define the tree builder a backend API and have the backend implement it, per hash. Internally it can reuse templates etc. to avoid fully reimplementing like you did basically.