Skip to content

Commit b8a2d5a

Browse files
committed
1 parent a41bb59 commit b8a2d5a

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

README.md

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ This crate is `#[no_std]` compatible with `default-features = false`
2020
| :--- | :--- | :--- |
2121
| `std` || TODO |
2222
| `rand` || TODO |
23-
| `alloc | | TODO |
23+
| `alloc` | | TODO |
2424
| `batch` | | TODO |
25-
| `batch_deterministic` | | TODO |
2625
| `asm` | | Assembly implementation of SHA-2 compression functions |
2726
| `legacy_compatibility` | | See: A Note on Signature Malleability |
2827

@@ -179,60 +178,17 @@ transactions.
179178
The scalar component of a signature is not the only source of signature
180179
malleability, however. Both the public key used for signature verification and
181180
the group element component of the signature are malleable, as they may contain
182-
a small torsion component as a consquence of the curve25519 group not being of
181+
a small torsion component as a consequence of the curve25519 group not being of
183182
prime order, but having a small cofactor of 8.
184183

185184
If you wish to also eliminate this source of signature malleability, please
186185
review the
187186
[documentation for the `verify_strict()` function](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.PublicKey.html#method.verify_strict).
188187

189-
# A Note on Randomness Generation
190-
191-
The original paper's specification and the standarisation of RFC8032 do not
192-
specify precisely how randomness is to be generated, other than using a CSPRNG
193-
(Cryptographically Secure Random Number Generator). Particularly in the case of
194-
signature verification, where the security proof _relies_ on the uniqueness of
195-
the blinding factors/nonces, it is paramount that these samples of randomness be
196-
unguessable to an adversary. Because of this, a current growing belief among
197-
cryptographers is that it is safer to prefer _synthetic randomness_.
198-
199-
To explain synthetic randomness, we should first explain how `ed25519-dalek`
200-
handles generation of _deterministic randomness_. This mode is disabled by
201-
default due to a tiny-but-not-nonexistent chance that this mode will open users
202-
up to fault attacks, wherein an adversary who controls all of the inputs to
203-
batch verification (i.e. the public keys, signatures, and messages) can craft
204-
them in a specialised manner such as to induce a fault (e.g. causing a
205-
mistakenly flipped bit in RAM, overheating a processor, etc.). In the
206-
deterministic mode, we seed the PRNG which generates our blinding factors/nonces
207-
by creating
208-
[a PRNG based on the Fiat-Shamir transform of the public inputs](https://merlin.cool/transcript/rng.html).
209-
This mode is potentially useful to protocols which require strong auditability
210-
guarantees, as well as those which do not have access to secure system-/chip-
211-
provided randomness. This feature can be enabled via
212-
`--features='batch_deterministic'`. Note that we _do not_ support deterministic
213-
signing, due to the numerous pitfalls therein, including a re-used nonce
214-
accidentally revealing the secret key.
215-
216-
In the default mode, we do as above in the fully deterministic mode, but we
217-
ratchet the underlying keccak-f1600 function (used for the provided
218-
transcript-based PRNG) forward additionally based on some system-/chip- provided
219-
randomness. This provides _synthetic randomness_, that is, randomness based on
220-
both deterministic and undeterinistic data. The reason for doing this is to
221-
prevent badly seeded system RNGs from ruining the security of the signature
222-
verification scheme.
223-
224188
## Batch Signature Verification
225189

226190
The standard variants of batch signature verification (i.e. many signatures made
227191
with potentially many different public keys over potentially many different
228192
messages) is available via the `batch` feature. It uses synthetic randomness, as
229193
noted above. Batch verification requires allocation, so this won't function in
230194
heapless settings.
231-
232-
Batch verification is slightly faster with the `std` feature enabled, since it
233-
permits us to use `rand::thread_rng`.
234-
235-
### Deterministic Batch Signature Verification
236-
237-
The same notion of batch signature verification as above, but with purely
238-
deterministic randomness can be enabled via the `batch_deterministic` feature.

0 commit comments

Comments
 (0)