-
Notifications
You must be signed in to change notification settings - Fork 118
feat: introduce no_std support for ff, curve, and crypto #306
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
Conversation
33eaca7
to
302939c
Compare
302939c
to
c606a74
Compare
Found this clippy lint that might be useful: Clippy rule link: https://rust-lang.github.io/rust-clippy/master/#std_instead_of_core |
Note that we should also add CI steps for building without the Edit: found this: https://github.com/KodrAus/rust-no-std |
Edit: never mind it looks like I have to also enable |
Is it possible that we make the crate work with everything turned off (not even Or maybe we should just unconditionally enable |
Yeah totally. impl Serialize for FieldElement {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(&ToString::to_string(&self))
}
}
impl<'de> Deserialize<'de> for FieldElement {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let value = String::deserialize(deserializer)?;
Self::from_str(&value).map_err(serde::de::Error::custom)
}
} So what we can do is: [dependencies]
serde = { version = "1.0.152", default-features = false, optional = true }
[features]
serde = ["alloc", "dep:serde"]
alloc = [""serde?/alloc"] |
c606a74
to
1550ae7
Compare
@xJonathanLEI I pushed a new version. Where the tree crates are full I also removed I think you will like this version better |
6614cf5
to
2d7d6dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this! Looks good to me apart from a few minor issues
2d7d6dc
to
329d4ac
Compare
329d4ac
to
2c0563d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot for working on this!
No description provided.