Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Oct 3, 2019

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

baloo and others added 23 commits March 4, 2025 16:08
Depends:
 - zkcrypto/ff#126
 - zkcrypto/ff#127
 
This is to provide an `ecdsa::SigningKey::try_from_rng` API
(RustCrypto/signatures#915)
New trait for customized hash function with variable output `CtVariableCoreWrapper`
like Blake2 to implement the `CustomizedInit` trait.
Renames `AeadInPlaceDetached` to `AeadInOut`, and changes the type
signature so the provided `buffer` is now an `InOutBuf`
This change automates Cargo.lock updates.
The module contents do not need to be defined in `aead` and can be moved
to the `aead-stream` crate.
Tests the inout methods and moves test vector code outside of the macro.
This fixes an invariant violation where you could create a secret key
from an all-zero scalar and convert it to a non-zero scala.

Fixes: #1607
Together with #1799 users would
need to implement `AssociatedOid` manually for created newtypes.

Also replaces `feature = "const-oid"` with `feature = "oid"`.
The flag is passed automatically by docs.rs.
This follows an alphabetic ordering and ordering-of-interest, which
should improve documentation
tarcieri and others added 18 commits November 5, 2025 08:12
Renames the (seemingly broken?) `os_rng` feature back to `getrandom` and
actually activates the corresponding feature in `crypto-common`
It seems it was never properly converted to `os_rng`.

Adds (back) a `getrandom` feature and a way to generate `SaltString`s
using the system random number generator.
Includes update to `rand_core` v0.10.0 prereleases
This notably switches to `EagerHash` for the digest bound
The change forbids seeking to the last keystream block and its application.
Additionally, unchecked methods added as an escape hatch.
Adds support for generating `SecretKey` and `NonZeroScalar` using the
system's cryptographically secure random number generator. Notably this
renames the former `SecretKey::random` and `NonZeroScalar::random`
methods to `SecretKey::generate` and `NonZeroScalar::generate`, which
take no parameters and are infallible.

This avoids the need for the user to import an `OsRng` type, or worry
about the generation failing (which it won't on most notable modern
OSes).

If a user still wants to handle RNG errors, the `try_from_rng` method
still exists, and they can pass `OsRng` if they'd like.
Has people use either the `generate` or `try_from_rng` methods instead.
newpavlov and others added 11 commits November 12, 2025 17:24
Switches (hopefully temporarily) to our forks of the `ff` and `group`
crates containing updates to `rand_core` v0.10.0 prereleases, which
allows us to cut crate releases of `elliptic-curve` and all of its
dependent crates
Ensures the `BasepointTable` type is documented
Replaces all of the previous RNG functionality with a `Generate` trait
which has the same basic shape as the existing methods, but allows types
to impl only `try_from_rng` and receive provided versions of all of the
other methods:

- `generate`: infallible generation using system RNG with panic on error
- `try_generate`: fallible version of above with RNG error `Result`s
- `from_rng`: infallible generation with RNG parameter that panics on
error

The `generate` and `try_generate` methods are available when the
`getrandom` feature is enabled.

Impls are provided for `hybrid_array::Array<u8, U>`.

With this approach we can generate things like symmetric keys and IVs
like:

    type Aes256CbcEnc = cbc::Encryptor<aes::Aes256>;
    let key = Key::<Aes256CbcEnc>::generate();
    let iv = Iv::<Aes256CbcEnc>::generate();

The trait is also intended to be impl'd by consuming crates for other
key generation use cases, e.g. `RsaPrivateKey`, `dsa::SigningKey`,
`ecdsa::SigningKey`, or KEM decapsulation keys.
Replaces them with the `Generate` trait introduced in #2096.

Moves documentation about generating random nonces to the `Nonce` type.
Adds a trait providing fallible key initialization, similar to the
existing `KeyInit` trait, but designed to handle the case that not all
bytestrings of a given length represent valid keys.

This is primarily useful in the context of public-key cryptography, e.g.
scalars representing elliptic curve private keys.

The API and method names are duplicated from `KeyInit`. It is assumed
that `KeyInit` and `TryKeyInit` have an either-or relationship, i.e.
types will not impl both `KeyInit` and `TryKeyInit`, and consumers of
code which is generic over these traits will not be attempting to
abstract over the `KeyInit`/`TryKeyInit` distinction, but one or the
other will make sense in a given context (e.g. symmetric cryptography
uses `KeyInit`, ECC uses `TryKeyInit`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants