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", "generalized-bulletproofs",
"helioselene", "helioselene",
"rand_core", "rand_core",
"std-shims",
] ]
[[package]] [[package]]

View File

@ -8,6 +8,8 @@ name = "fcmp_rust"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[dependencies] [dependencies]
std-shims = { git = "https://github.com/kayabaNerve/fcmp-plus-plus" }
rand_core = { version = "0.6", features = ["getrandom"] } rand_core = { version = "0.6", features = ["getrandom"] }
transcript = { package = "flexible-transcript", git = "https://github.com/kayabaNerve/fcmp-plus-plus", features = ["recommended"] } 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; use rand_core::OsRng;
@ -154,7 +154,7 @@ pub extern "C" fn hash_grow_helios(
offset: usize, offset: usize,
existing_child_at_offset: HeliosScalar, existing_child_at_offset: HeliosScalar,
new_children: HeliosScalarSlice, new_children: HeliosScalarSlice,
) -> CResult<HeliosPoint, io::Error> { ) -> CResult<HeliosPoint, ()> {
let hash = hash_grow( let hash = hash_grow(
helios_generators(), helios_generators(),
existing_hash, existing_hash,
@ -166,7 +166,7 @@ pub extern "C" fn hash_grow_helios(
if let Some(hash) = hash { if let Some(hash) = hash {
CResult::ok(hash) CResult::ok(hash)
} else { } 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, offset: usize,
existing_child_at_offset: SeleneScalar, existing_child_at_offset: SeleneScalar,
new_children: SeleneScalarSlice, new_children: SeleneScalarSlice,
) -> CResult<SelenePoint, io::Error> { ) -> CResult<SelenePoint, ()> {
let hash = hash_grow( let hash = hash_grow(
selene_generators(), selene_generators(),
existing_hash, existing_hash,
@ -213,7 +213,7 @@ pub extern "C" fn hash_grow_selene(
if let Some(hash) = hash { if let Some(hash) = hash {
CResult::ok(hash) CResult::ok(hash)
} else { } else {
CResult::err(io::Error::new(io::ErrorKind::Other, "failed to grow hash")) CResult::err(())
} }
} }