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 k256 version and use the new functionality #87

Merged
merged 7 commits into from
Jan 15, 2022

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Dec 30, 2021

  • bumps k256 dependency to 0.10.1 (.1 supports ReduceNonZero<U256> that we need), and the sub-dependencies accordingly.
  • bumps MSRV to 1.56 and rust edition to 2021 (k256 0.10 requirement)
  • uses the new non-zero scalar functionality (reduction to a non-zero scalar and random non-zero scalars). Everywhere where non-zero scalars are used in the code they now have their own NonZeroCurveScalar type (a wrapper for the backend type). Fixes Hashing to nonzero scalars #39.
  • as a consequence of the previous item, ZeroHash errors were removed
  • the methods that could previously fail because if hash-to-scalar returned 0 are now infallible.
  • adds arithmetic impls for operations on NonZeroCurveScalar so that it could be used transparently in the code. If Add impl of Mul for NonZeroScalar * NonZeroScalar RustCrypto/traits#857 is merged, the impl for NonZeroCurveScalar * NonZeroCurveScalar can be simplified.
  • added usage of SecretBox in some places to wrap secret data. Filed Rethink zeroization when ZeroizeOnDrop is available #89 to be fixed when ZeroizeOnDrop is available.

If RustCrypto/elliptic-curves#499 is resolved before this PR is merged (unlikely, but who knows), NonZeroCurveScalar::invert() can be simplified.

@fjarri fjarri added enhancement New feature or request cryptography Needs attention of someone who knows what they're doing ABI Changes the format of serialized objects labels Dec 30, 2021
@fjarri fjarri marked this pull request as draft December 30, 2021 22:21
@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2022

Codecov Report

Merging #87 (365037a) into master (180a2cf) will increase coverage by 0.30%.
The diff coverage is 97.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   68.44%   68.75%   +0.30%     
==========================================
  Files          16       16              
  Lines        1334     1344      +10     
==========================================
+ Hits          913      924      +11     
+ Misses        421      420       -1     
Impacted Files Coverage Δ
umbral-pre/src/bindings_python.rs 0.00% <0.00%> (ø)
umbral-pre/src/capsule.rs 91.47% <100.00%> (+0.63%) ⬆️
umbral-pre/src/capsule_frag.rs 89.58% <100.00%> (ø)
umbral-pre/src/curve.rs 90.00% <100.00%> (-3.23%) ⬇️
umbral-pre/src/hashing.rs 98.76% <100.00%> (ø)
umbral-pre/src/hashing_ds.rs 100.00% <100.00%> (ø)
umbral-pre/src/key_frag.rs 90.50% <100.00%> (-0.06%) ⬇️
umbral-pre/src/keys.rs 78.23% <100.00%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 180a2cf...365037a. Read the comment docs.

@fjarri fjarri marked this pull request as ready for review January 8, 2022 23:01
@fjarri fjarri added the API Related to public API label Jan 8, 2022
Copy link
Contributor

@piotr-roslaniec piotr-roslaniec left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@fjarri fjarri merged commit c752d02 into nucypher:master Jan 15, 2022
@fjarri fjarri deleted the bump-k256 branch January 15, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Changes the format of serialized objects API Related to public API cryptography Needs attention of someone who knows what they're doing enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hashing to nonzero scalars
3 participants