RustCrypto / RustCrypto/crypto-bigint

Less errors in `RandomBits` methods

Open
#534 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
309
Forks
95
Avg merge
1d 14h
Merged PRs (30d)
3

Description

A possible change of contract of RandomBits that can eliminate some error/panic cases: in the methods that take bits_precision, treat it as at_least_bits_precision in BoxedUint. That is if RandomBits::random_bits_with_precision() is called with bits_precision == 128 for U256, it will return U256 instead of panicking. Or is that too dynamic?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with RandomBits::random_bits_with_precision() and the other RandomBits methods that take bits_precision, then compare their current contract with BoxedUint's precision behavior. Done means reaching an agreed answer on whether bits_precision is treated as a minimum, including the U256/128 example, and documenting or testing the resulting contract.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.