Skip to content

Commit e42154a

Browse files
authored
refactor: replace legacy random coins with Poseidon2-based RandomCoin (#871)
1 parent 3453ff5 commit e42154a

File tree

7 files changed

+56
-568
lines changed

7 files changed

+56
-568
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [BREAKING] Added info context field to secret box, bind IES HKDF info to a stable context string, scheme identifier, and ephemeral public key bytes. ([#843](https://github.com/0xMiden/crypto/pull/843)).
1818
- [BREAKING] Removed `PartialEq`/`Eq` for AEAD `SecretKey` in non-test builds, fix various hygiene issues in dealing with secret keys ([#849](https://github.com/0xMiden/crypto/pull/849)).
1919
- Added `PublicKey::from_der()` for ECDSA public keys over secp256k1 ([#855](https://github.com/0xMiden/crypto/pull/855)).
20+
- [BREAKING] Removed `RpoRandomCoin` and `RpxRandomCoin` and introduced a Poseidon2-based `RandomCoin` ([#871](https://github.com/0xMiden/crypto/pull/871)).
2021

2122
## 0.22.4 (2026-03-03)
2223

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ Messages sealed as one type must be unsealed using the corresponding method, oth
117117

118118
## Pseudo-Random Element Generator
119119

120-
[Pseudo random element generator module](./miden-crypto/src/rand/) provides a set of traits and data structures that facilitate generating pseudo-random elements in the context of Miden protocol. The module currently includes:
120+
[Pseudo random element generator module](./miden-crypto/src/rand/) provides a set of traits and utilities that facilitate generating pseudo-random elements in the context of Miden protocol. The module currently includes:
121121

122+
- `Randomizable`: a trait for constructing values from random bytes.
122123
- `FeltRng`: a trait for generating random field elements and random 4 field elements.
123-
- `RpoRandomCoin`: a struct implementing `FeltRng` as well as the [`RandomCoin`](https://github.com/facebook/winterfell/blob/main/crypto/src/random/mod.rs) trait using RPO hash function.
124-
- `RpxRandomCoin`: a struct implementing `FeltRng` as well as the [`RandomCoin`](https://github.com/facebook/winterfell/blob/main/crypto/src/random/mod.rs) trait using RPX hash function.
124+
- `RandomCoin`: a struct implementing `FeltRng` using the Poseidon2 hash function.
125+
- `random_felt` and `random_word`: `std`-only helpers for generating random field elements and words.
126+
- `test_utils`: deterministic and `std`-based helpers for tests and benchmarks.
125127

126128
## STARK proving system
127129

miden-crypto/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ harness = false
6464
name = "word"
6565
required-features = ["std"]
6666

67-
[[bench]]
68-
harness = false
69-
name = "rand"
70-
required-features = ["std"]
71-
7267
[[bench]]
7368
harness = false
7469
name = "sparse_path"

miden-crypto/benches/rand.rs

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)