Skip to content
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

Expose NOT gadget #64

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crypto/finite_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,8 @@ function createField(p: bigint, t: bigint, twoadicRoot: bigint) {
fromBigint(x: bigint) {
return mod(x, p);
},
not(x: bigint) {
return ~x;
},
};
}
1 change: 1 addition & 0 deletions ocaml/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
kimchi_backend.common
kimchi_bindings
kimchi_types
kimchi_gadgets
pasta_bindings
base58_check
block_time
Expand Down
5 changes: 5 additions & 0 deletions ocaml/lib/snarky_js_bindings_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ module Snarky = struct
let seal x = Pickles.Util.seal (module Impl) x

let to_constant_and_terms x = Field.to_constant_and_terms x

let not left length =
Kimchi_gadgets.Bitwise.bnot (module Impl) left length
end

module Bool = struct
Expand Down Expand Up @@ -339,6 +342,8 @@ let snarky =
method seal = Snarky.Field.seal

method toConstantAndTerms = Snarky.Field.to_constant_and_terms

method not = Snarky.Field.not
end

val bool =
Expand Down