Correct in-tree code to Rust 1.69

This commit is contained in:
Luke Parker 2024-05-26 03:39:02 -04:00 committed by j-berman
parent 6d6a2e4bd2
commit c6327cc035
3 changed files with 8 additions and 5 deletions

View File

@ -249,6 +249,7 @@ dependencies = [
"generalized-bulletproofs",
"helioselene",
"rand_core",
"std-shims",
]
[[package]]

View File

@ -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"] }

View File

@ -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<HeliosPoint, io::Error> {
) -> CResult<HeliosPoint, ()> {
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<SelenePoint, io::Error> {
) -> CResult<SelenePoint, ()> {
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(())
}
}