From 0d79c88636f7e68bdd87916fa9b067b26ea8f336 Mon Sep 17 00:00:00 2001 From: Anton Grigoryev Date: Tue, 17 Mar 2015 01:04:23 +0300 Subject: [PATCH] Auth successful Python 2 is not supported since to_bytes function in testing.py --- crypt.py | 2 +- mtproto.py | 5 ++-- testing.py | 79 +++++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 72 insertions(+), 14 deletions(-) diff --git a/crypt.py b/crypt.py index f69ff43df..26200ccc5 100644 --- a/crypt.py +++ b/crypt.py @@ -40,12 +40,12 @@ class IGE: key must be 32 byte iv must be 32 byte (it's not internally used in AES 256 ECB, but it's needed for IGE)""" + blocksize = self.cipher.block_size if len(message) % blocksize != 0: raise ValueError("message must be a multiple of 16 bytes (try adding " + str(16 - len(message) % 16) + " bytes of padding)") - blocksize = self.cipher.block_size ivp = self.iv[0:blocksize] ivp2 = self.iv[blocksize:] diff --git a/mtproto.py b/mtproto.py index 231032406..9774d6540 100644 --- a/mtproto.py +++ b/mtproto.py @@ -104,7 +104,6 @@ def serialize_method(bytes_io, type_, **kwargs): def serialize_param(bytes_io, type_, value): - print("type(value): " + str(type(value))) if type_ == "int": assert isinstance(value, int) bytes_io.write(struct.pack('