Closed ChickenLover closed 2 weeks 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
- There are no rust bindings for now
- Tree builder is just a template, so instantiations will be both in hash and in field libraries, depending on which hash it is
- 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.
Updates:
Hashing
Tree builder
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
Now doesn't use gpu registers for storing states
To do:
Future work: