mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 22:45:38 +00:00
Remember the good primes to prevent verifying them twice
This commit is contained in:
parent
3701ba6f72
commit
67285c1c08
4 changed files with 13 additions and 11 deletions
|
|
@ -194,7 +194,7 @@ namespace WTelegram
|
|||
|
||||
private static void ValidityChecks(BigInteger p, int g)
|
||||
{
|
||||
Helpers.Log(2, "Verifying encryption key safety... (this happens only during session negociation)");
|
||||
Helpers.Log(2, "Verifying encryption key safety... (this should happen only once)");
|
||||
// check that 2^2047 <= p < 2^2048
|
||||
if (p.GetBitLength() != 2048) throw new ApplicationException("p is not 2048-bit number");
|
||||
// check that g generates a cyclic subgroup of prime order (p - 1) / 2, i.e. is a quadratic residue mod p.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue