-
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
Move Field to JS #12
Move Field to JS #12
Conversation
95a61f1
to
d18a305
Compare
ocaml/lib/snarky_js_bindings_lib.ml
Outdated
does 16 bits per row (vs 1 bits per row that you can do with generic gates). | ||
[length] has to be a multiple of 16 | ||
*) | ||
let truncate_to_bits (length : int) x = |
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.
can we make this parameter length_div_16
instead and multiply by 16 in the body of the function -- then the function is total and the caller can prove that it's a multiple of 16 by dividing it by 16 before passing it in.
Consider changing the name to truncate_to_bits16
also
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 input length is a plain integer, which will define the circuit statically, so the caller can't / doesn't have to prove anything about it.
do you still think we should change the signature?
I'm going to change it here but not in the user-facing SnarkyJS method for now (but will throw a quick error there)
This exposes snarky methods on field elements, in service of o1-labs/o1js#902