diff --git a/README.rst b/README.rst index 1065c03..3242366 100644 --- a/README.rst +++ b/README.rst @@ -25,5 +25,5 @@ Example: Note ==== - I does NOT guarantee that this implementation (or the base cipher) is secure. If there are bugs, tell me them on github. + I does NOT guarantee that this implementation (or the base cipher) is secure. If there are bugs, tell me them please. diff --git a/setup.py b/setup.py index 6d417d9..8e54bfd 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def get_file(name): long_text = get_file("README.rst") + "\n\n" + get_file("changelog.rst") setup(name='xtea', - version='0.4.0-dev', + version='0.4.0', description="A python version of XTEA", long_description = long_text, author="Simon Biewald", @@ -26,6 +26,7 @@ def get_file(name): url="https://github.com/Varbin/xtea/wiki", download_url="https://github.com/Varbin/xtea", bugtrack_url="https://github.com/Varbin/xtea/issues", + keywords = "xtea tea encryption crypt", license="Public Domain", py_modules=['xtea'], classifiers=[ diff --git a/xtea.py b/xtea.py index 8cd6746..568ca05 100644 --- a/xtea.py +++ b/xtea.py @@ -282,7 +282,10 @@ def _block(self, s): ################ CBCMAC class class CBCMAC(object): + name = "xtea-cbcmac" + block_size = 64 digest_size = 8 + """Just a small implementation of the CBCMAC algorithm, based on XTEA.""" def __init__(self, key, string="", endian="!"): self.cipher = new(key, mode=MODE_CBC, IV="\00"*8, endian=endian) @@ -296,6 +299,9 @@ def new(key, string="", endian="!"): def update(self, string): self.text += string + def copy(self): + return CBCMAC.new(self.key, self.text, self.cipher.endian) + def digest(self): return self.cipher.encrypt(self.text)[-8:]