Use risc0-bigint2 FFI instead of risc0-zkvm sys_bigint2_n FFI#4
Use risc0-bigint2 FFI instead of risc0-zkvm sys_bigint2_n FFI#4iddo-bentov merged 2 commits intorelease/v0.3.14from
Conversation
|
Could you update the PR name to be more descriptive? |
tzerrell
left a comment
There was a problem hiding this comment.
Looks good, glad to have this running with the bigint2 externs rather than through importing blobs. Also make the PR name change and I'll be ready to approve.
This does add some code maintenance complexity around needing to use the precompiler for the sake of an #ifdef __RISC0_UNCHECKED__ that is currently never actually used. Probably this is fine -- the code's already written, and we can always make another PR either utilize this unchecked #ifdef or take it out if it's causing maintenance issues.
| //if env::var("RISC0_UNCHECKED").is_ok() { | ||
| // cc.define("__RISC0_UNCHECKED__", None); | ||
| //} |
There was a problem hiding this comment.
Maybe add a comment explaining what this does. Perhaps something like this
| //if env::var("RISC0_UNCHECKED").is_ok() { | |
| // cc.define("__RISC0_UNCHECKED__", None); | |
| //} | |
| // // Allows the use of precompiles that are faster but which can be misused insecurely | |
| //if env::var("RISC0_UNCHECKED").is_ok() { | |
| // cc.define("__RISC0_UNCHECKED__", None); | |
| //} |
There was a problem hiding this comment.
Ok, I added this comment now.
Switch to risc0-bigint2 extern "C" functions (instead of zkvm-platform sys_bigint2_n).
There's also support for more efficient "unchecked" bigint2 calls, but it's deactivated.