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

Bump bincode and secrecy for no_std builds #140

Merged
merged 7 commits into from
Aug 4, 2024

Conversation

HCastano
Copy link
Contributor

I've been strugging to use Synedrion as a dependency in a Substrate pallet due to one of
its dependencies pulling in std transitively, as mentioned in entropyxyz/entropy-core#961.

Through a bit of digging I found that the bincode and secrecy dependencies were
pulling in serde without disable default features, causing std to be pulled in.

I've updated them to the latest releases which use better feature management to allow
serde to not be pulled in with default features. Note that the latest releases are
technically pre-releases.

@HCastano HCastano requested a review from fjarri July 31, 2024 20:47
Copy link

github-actions bot commented Jul 31, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@HCastano
Copy link
Contributor Author

@vitropy looks like I still need to sign the CLA even though I'm part of the Entropy org. I thought this wasn't supposed to be the case after #139 🤔

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.05%. Comparing base (bd15ac1) to head (f5a5f15).

Files Patch % Lines
synedrion/src/paillier/keys.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
- Coverage   90.08%   90.05%   -0.04%     
==========================================
  Files          43       43              
  Lines        7768     7771       +3     
==========================================
  Hits         6998     6998              
- Misses        770      773       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -12,20 +11,12 @@ use crate::uint::{
RandomPrimeWithRng, Retrieve, Signed, UintLike, UintModLike,
};

#[derive(Clone, Serialize, Deserialize, ZeroizeOnDrop)]
#[derive(Clone, Debug, Serialize, Deserialize, ZeroizeOnDrop)]
Copy link
Member

Choose a reason for hiding this comment

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

Does it somehow obscure the secret values in the output, the way the previous implementation did?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it doesn't log the inner value. See the implementation on SecretBox here.

Copy link
Member

Choose a reason for hiding this comment

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

But p and q are not SecretBox-ed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry, you're right. I thought they were SecretBox-ed for some reason. I've added a manual Debug implementation that matches the DebugSecret one.

One other option here would be to SecretBox p and q, but it would add bit of noise of this PR. Wdyt?

@vitropy
Copy link
Contributor

vitropy commented Aug 1, 2024

looks like I still need to sign the CLA even though I'm part of the Entropy org. I thought this wasn't supposed to be the case after #139 🤔

Oh shoot, you're right. It looks like this is a feature of a different CLA bot; the one we're using doesn't yet have this feature.

We don't need to keep compatibilty with `[email protected]`, so we can move
away from using the legacy config.
@HCastano
Copy link
Contributor Author

HCastano commented Aug 2, 2024

I have read the CLA Document and I hereby sign the CLA

This should match the previous implementation provided by the
`DebugSecret` crate.
@@ -164,8 +164,6 @@ impl<'de> Deserialize<'de> for Scalar {

impl DefaultIsZeroes for Scalar {}

impl DebugSecret for Scalar {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume we don't need a manual implementation of DebugSecret anymore like for SecretKeyPaillier since a) this already had a derived Debug implementation and b) anybody that's using for secret values these can wrap them in a SecretBox and use that Debug implementation

@fjarri fjarri merged commit 1d210d1 into master Aug 4, 2024
4 of 6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2024
@HCastano HCastano deleted the hc/bump-deps-for-no-std-builds branch August 6, 2024 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants