Skip to content

Commit

Permalink
feat: remove std requirement for ark-serialize implementations (#250)
Browse files Browse the repository at this point in the history
# Rationale for this change
These implementations do not use any std functionality. The save_to_file
and load_from_file utilities do, which remain behind the "std" feature.
Being able to serialize and deserialize public parameters will be
important for some no_std use cases.

# What changes are included in this PR?

`#[cfg(feature = "std")]` has been removed from `ark-serialize` trait
implementations on `PublicParameters`.

# Are these changes tested?
No. These changes do not affect existing functionality, which is
verified by existing tests.
  • Loading branch information
tlovell-sxt authored Oct 10, 2024
2 parents 69e27c7 + 52bfa6b commit 0634804
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use super::{G1Affine, G2Affine};
use alloc::vec::Vec;
use ark_ff::UniformRand;
#[cfg(feature = "std")]
use ark_serialize::{
CanonicalDeserialize, CanonicalSerialize, Compress, SerializationError, Valid, Validate,
};
Expand Down Expand Up @@ -98,7 +97,6 @@ impl PublicParameters {
}
}

#[cfg(feature = "std")]
impl CanonicalSerialize for PublicParameters {
fn serialize_with_mode<W: ark_serialize::Write>(
&self,
Expand Down Expand Up @@ -164,7 +162,6 @@ impl CanonicalSerialize for PublicParameters {
}
}

#[cfg(feature = "std")]
impl CanonicalDeserialize for PublicParameters {
fn deserialize_with_mode<R: ark_serialize::Read>(
mut reader: R,
Expand Down Expand Up @@ -207,7 +204,6 @@ impl CanonicalDeserialize for PublicParameters {
// Remove unnecessary methods if they're not overridden
}

#[cfg(feature = "std")]
// Implement the Valid trait to perform validation on deserialized data
impl Valid for PublicParameters {
fn check(&self) -> Result<(), SerializationError> {
Expand Down

0 comments on commit 0634804

Please sign in to comment.