-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xuyang/integrate_cairo_runner' into base
- Loading branch information
Showing
26 changed files
with
154 additions
and
2,349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
defmodule Cairo.Cairo0 do | ||
defmodule Cairo.CairoProver do | ||
use Rustler, | ||
otp_app: :cairo, | ||
crate: :cairo | ||
crate: :cairo_prover | ||
|
||
@moduledoc """ | ||
Documentation for `Cairo`. | ||
Documentation for `CairoProver`. | ||
""" | ||
|
||
# When loading a NIF module, dummy clauses for all NIF function are required. | ||
# NIF dummies usually just error out when called when the NIF is not loaded, as that should never normally happen. | ||
@spec cairo0_run_and_prove(binary()) :: {list(byte()), list(byte())} | ||
@spec cairo_prove(list(byte()), list(byte())) :: | ||
{list(byte()), list(byte())} | ||
@spec cairo_verify(list(byte()), list(byte())) :: boolean() | ||
|
||
def cairo0_run_and_prove(_program), do: :erlang.nif_error(:nif_not_loaded) | ||
def cairo_prove(_trace, _memory), do: :erlang.nif_error(:nif_not_loaded) | ||
def cairo_verify(_proof, _pub_input), do: :erlang.nif_error(:nif_not_loaded) | ||
end | ||
|
||
defmodule Cairo.Cairo1 do | ||
defmodule Cairo.CairoVM do | ||
use Rustler, | ||
otp_app: :cairo, | ||
crate: :cairo1 | ||
crate: :cairo_vm | ||
|
||
@moduledoc """ | ||
Documentation for `Cairo1`. | ||
Documentation for `CairoVM`. | ||
""" | ||
|
||
# When loading a NIF module, dummy clauses for all NIF function are required. | ||
# NIF dummies usually just error out when called when the NIF is not loaded, as that should never normally happen. | ||
@spec cairo1_vm_runner(binary(), binary()) :: {list(byte()), list(byte())} | ||
@spec cairo_vm_runner(binary(), binary()) :: {list(byte()), list(byte())} | ||
|
||
def cairo1_vm_runner(_path, _inputs), do: :erlang.nif_error(:nif_not_loaded) | ||
def cairo_vm_runner(_program_content, _program_inputs), | ||
do: :erlang.nif_error(:nif_not_loaded) | ||
end |
Oops, something went wrong.