diff --git a/src/fcmp/fcmp_rust/Cargo.lock b/src/fcmp/fcmp_rust/Cargo.lock index e9c67b679..18edc208f 100644 --- a/src/fcmp/fcmp_rust/Cargo.lock +++ b/src/fcmp/fcmp_rust/Cargo.lock @@ -249,6 +249,7 @@ dependencies = [ "generalized-bulletproofs", "helioselene", "rand_core", + "std-shims", ] [[package]] diff --git a/src/fcmp/fcmp_rust/Cargo.toml b/src/fcmp/fcmp_rust/Cargo.toml index 828cd2c2e..f4efeff9c 100644 --- a/src/fcmp/fcmp_rust/Cargo.toml +++ b/src/fcmp/fcmp_rust/Cargo.toml @@ -8,6 +8,8 @@ name = "fcmp_rust" crate-type = ["staticlib"] [dependencies] +std-shims = { git = "https://github.com/kayabaNerve/fcmp-plus-plus" } + rand_core = { version = "0.6", features = ["getrandom"] } transcript = { package = "flexible-transcript", git = "https://github.com/kayabaNerve/fcmp-plus-plus", features = ["recommended"] } diff --git a/src/fcmp/fcmp_rust/src/lib.rs b/src/fcmp/fcmp_rust/src/lib.rs index 16d17510b..7907e6927 100644 --- a/src/fcmp/fcmp_rust/src/lib.rs +++ b/src/fcmp/fcmp_rust/src/lib.rs @@ -1,4 +1,4 @@ -use std::{io, sync::OnceLock}; +use std_shims::sync::OnceLock; use rand_core::OsRng; @@ -154,7 +154,7 @@ pub extern "C" fn hash_grow_helios( offset: usize, existing_child_at_offset: HeliosScalar, new_children: HeliosScalarSlice, -) -> CResult { +) -> CResult { let hash = hash_grow( helios_generators(), existing_hash, @@ -166,7 +166,7 @@ pub extern "C" fn hash_grow_helios( if let Some(hash) = hash { CResult::ok(hash) } else { - CResult::err(io::Error::new(io::ErrorKind::Other, "failed to grow hash")) + CResult::err(()) } } @@ -201,7 +201,7 @@ pub extern "C" fn hash_grow_selene( offset: usize, existing_child_at_offset: SeleneScalar, new_children: SeleneScalarSlice, -) -> CResult { +) -> CResult { let hash = hash_grow( selene_generators(), existing_hash, @@ -213,7 +213,7 @@ pub extern "C" fn hash_grow_selene( if let Some(hash) = hash { CResult::ok(hash) } else { - CResult::err(io::Error::new(io::ErrorKind::Other, "failed to grow hash")) + CResult::err(()) } }