From deb6ca0da059261eb67302e0ef41743383091a41 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 24 Dec 2018 20:17:31 +0100 Subject: [PATCH] Fast-path good known prime in 2fa --- telethon/password.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/telethon/password.py b/telethon/password.py index 88b70852..bde21206 100644 --- a/telethon/password.py +++ b/telethon/password.py @@ -61,9 +61,8 @@ def check_prime_and_good(prime_bytes: bytes, g: int): 0x0D, 0x81, 0x15, 0xF6, 0x35, 0xB1, 0x05, 0xEE, 0x2E, 0x4E, 0x15, 0xD0, 0x4B, 0x24, 0x54, 0xBF, 0x6F, 0x4F, 0xAD, 0xF0, 0x34, 0xB1, 0x04, 0x03, 0x11, 0x9C, 0xD8, 0xE3, 0xB9, 0x2F, 0xCC, 0x5B)) - if good_prime != prime_bytes: - if g in (3, 4, 5, 7): - return # It's good + if good_prime == prime_bytes: + return # It's good check_prime_and_good_check(int.from_bytes(prime_bytes, 'big'), g)