don't use safe primes for private keys
This commit is contained in:
parent
ede1a43e4a
commit
bf265490a8
2 changed files with 2 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# toy Diffie-Hellman key exchange
|
||||
Uses 256-bit Sophie-Germain primes for stuff
|
||||
Uses 256-bit primes for stuff
|
||||
|
||||
```
|
||||
nix run git+https://git.pyrope.net/mbk/diffie-hellman
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ fn main() {
|
|||
|
||||
println!("p = {p}, g = {g}");
|
||||
|
||||
let a: BigUint = rng.gen_safe_prime(256);
|
||||
let a: BigUint = rng.gen_prime(256, None);
|
||||
println!("a = {a}");
|
||||
|
||||
let ga = g.modpow(&a, &p);
|
||||
|
|
|
|||
Loading…
Reference in a new issue