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

Updates for CGGMP'24: Paillier/ring-Pedersen level #161

Merged
merged 10 commits into from
Dec 1, 2024

Conversation

fjarri
Copy link
Member

@fjarri fjarri commented Nov 25, 2024

Part of #157

  • Split Paillier keys and ring-Pedersen secrets, with the underlying SecretPrimes/PublicModulus. Note that according to the new version of the paper Paillier only needs mod 3 = 4 primes, while ring-Pedersen needs safe primes.
  • Use Exponentiable where approriate
  • Normalize naming for "wire" and "expanded" structures in paillier. Namely: the wire ones have the "Wire" postfix, the expanded ones have no postfixes. The conversion methods are to_wire() and to_precomputed().
  • Changed the type of various Uint bit size arguments to u32 to match crypto-bigint

The new Secret will be properly used throughout the codebase in a follow-up PR, this one is getting pretty big already.

@fjarri fjarri self-assigned this Nov 25, 2024
@fjarri fjarri marked this pull request as ready for review November 27, 2024 01:49
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 98.58233% with 13 lines in your changes missing coverage. Please review.

Project coverage is 92.36%. Comparing base (8ec70fd) to head (f6cd680).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
synedrion/src/cggmp21/interactive_signing.rs 90.00% 4 Missing ⚠️
synedrion/src/tools/secret.rs 85.71% 3 Missing ⚠️
synedrion/src/paillier/encryption.rs 97.43% 2 Missing ⚠️
synedrion/src/paillier/rsa.rs 98.89% 2 Missing ⚠️
synedrion/src/cggmp21/key_refresh.rs 94.11% 1 Missing ⚠️
synedrion/src/paillier/keys.rs 99.47% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #161      +/-   ##
==========================================
+ Coverage   92.21%   92.36%   +0.14%     
==========================================
  Files          33       35       +2     
  Lines        6422     6534     +112     
==========================================
+ Hits         5922     6035     +113     
+ Misses        500      499       -1     

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

@fjarri fjarri requested a review from dvdplm November 27, 2024 01:51
@fjarri fjarri mentioned this pull request Nov 28, 2024
Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

LGTM.

Left a few comments and nitpicks. At the end of the day I think using "wire" is probably fine, but I don't love it and think that the previous names were mostly ok and quite readable.

synedrion/src/tools/hide_debug.rs Outdated Show resolved Hide resolved
synedrion/src/tools.rs Outdated Show resolved Hide resolved
synedrion/src/paillier/rsa.rs Outdated Show resolved Hide resolved
synedrion/src/paillier/rsa.rs Outdated Show resolved Hide resolved
synedrion/src/paillier/rsa.rs Show resolved Hide resolved
synedrion/src/paillier/rsa.rs Outdated Show resolved Hide resolved
synedrion/src/paillier/ring_pedersen.rs Show resolved Hide resolved
synedrion/src/paillier/ring_pedersen.rs Show resolved Hide resolved
synedrion/src/cggmp21/sigma/prm.rs Outdated Show resolved Hide resolved
synedrion/src/cggmp21/sigma/prm.rs Show resolved Hide resolved
@fjarri
Copy link
Member Author

fjarri commented Nov 28, 2024

At the end of the day I think using "wire" is probably fine, but I don't love it and think that the previous names were mostly ok and quite readable.

The problem with the previous names was that the most used ones were also very long and had suffixes that had to be repeated everywhere. The goal was to make it so that one could use PublicKeyPaillier/SecretKeyPaillier in most places, and where they have to be serialized, they're converted to a "minimized" representation which has a longer name. Also sometimes it was Precomputed, and sometimes Mod, and the conversion method names were different while they were actually doing the same thing. Whether it's Wire or something else is secondary and can be changed.

@fjarri
Copy link
Member Author

fjarri commented Dec 1, 2024

Merging this for now to free the way for #163, we can work on naming in a separate PR.

@fjarri fjarri merged commit 9846887 into entropyxyz:master Dec 1, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2024
@fjarri fjarri deleted the cggmp24-paillier branch December 1, 2024 06:05
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.

2 participants