-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add new hashing functions (SHA & Keccak) #53
Conversation
…upport SHA3 hashing in JS bindings
fb98a54
to
ec89821
Compare
…odule for checking if a value is less than a specified number of bits
@@ -8,6 +8,10 @@ module Poseidon : sig | |||
type sponge | |||
end | |||
|
|||
(** | |||
This type definition is copy/pasted from the `snarkyjs_bindings.ml` using an LSP to see the type definition of `snarky`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to describe how to add to this type? 🤔
|
||
let check_bits value bits = | ||
Kimchi_gadgets.Lookup.less_than_bits (module Impl) ~bits value ; | ||
Kimchi_gadgets.Range_check.bits64 (module Impl) Impl.Field.zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for calling Kimchi_gadgets.Range_check.bits64
is because less_than_bits
expects a "dummy gate" to be initialized before calling it (as noted here). Calling this every time check_bits
is called seems wasteful, is there a better way to initialize the range check once?
superseded by o1-labs/o1js#1291 |
Description
Implements o1-labs/rfcs#9
This PR adds support for hashing using various SHA algorithms and Keccak that is exposed in the OCaml bindings to be used by SnarkyJS. This is the layer in which the calls to Kimchi are made.
🔗 SnarkyJS o1-labs/o1js#999