Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No std #74

Draft
wants to merge 8 commits into
base: reddsa-2.0.0-rc.0
Choose a base branch
from
Draft

No std #74

wants to merge 8 commits into from

Conversation

jowparks
Copy link
Contributor

@jowparks jowparks commented Aug 8, 2024

Adds no-std compatibility to ironfish frost.

TODO:
Currently targeted to ironfish fork of reddsa waiting for this PR to merge:
ZcashFoundation/reddsa#166

@jowparks jowparks changed the base branch from main to reddsa-2.0.0-rc.0 August 8, 2024 18:31
@jowparks jowparks force-pushed the no-std branch 3 times, most recently from 5e87386 to 93a6030 Compare August 8, 2024 20:05
jowparks and others added 7 commits August 14, 2024 09:43
allows us to display error details in ironfish repo

enables std for reddsa dependency if std is enabled
brings back DecryptionError and EncryptionError type enums

adds string parameter back to InvalidInput, restores prior error message, and
adds error messages when std and string formatting not available
…-fmt

adds error formatting for IronfishFrostError if std is enabled
we recently made changes to the 'multienc' module that changed the structure of
encrypted data

since it's possible that users have exported multisig accounts encrypted using
the old legacy encryption methods we need to support decryption of that data

adds MultiRecipientBlob back into the multienc module behind the std feature and
defines 'decrypt_legacy' for use decrypting these blobs
adds decrypt_legacy to decrypt data from previous version
@mat-if mat-if marked this pull request as ready for review September 12, 2024 18:06
siphasher = { version = "1.0.0", optional = true }
x25519-dalek = { version = "2.0.0", features = ["reusable_secrets", "static_secrets"] }
rand_core = { version = "0.6.4", default-features = false, features = ["alloc"] }
reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev="9ac52c5c60e454b0032d78a22c05fb79aae1d51e", features = ["frost"], default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the commit here to ZcashFoundation/reddsa@e113475, which merged the feature into main

@@ -153,7 +163,8 @@ pub fn import_secret_package(
exported: &[u8],
secret: &participant::Secret,
) -> Result<SecretPackage, IronfishFrostError> {
let serialized = multienc::decrypt(secret, exported).map_err(io::Error::other)?;
let serialized =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just restoring the error type back to what it was before #73

use rand_core::CryptoRng;
use rand_core::RngCore;
use std::borrow::Borrow;
// use log::info;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️

@@ -53,7 +57,7 @@ mod io {
}
}

pub type Result<T> = core::result::Result<T, Error>;
pub(crate) type Result<T> = core::result::Result<T, Error>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to revert this and the answer is yes - linter complains about it being an unreachable pub item

image

where
R: io::Read,
R: crate::io::Read,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this just be io::Read?

@@ -74,6 +78,13 @@ mod io {
Err(Error)
}
}

fn by_ref(&mut self) -> &mut Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used?


[dev-dependencies]
hex-literal = "0.4.1"
rand = "0.8.5"

[features]
default = ["std", "signing"]
default = ["dkg", "std"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the default include all 3 (add signing)?

@NullSoldier NullSoldier marked this pull request as draft October 1, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants