[Pymoul-svn] SF.net SVN: pymoul: [228] xtea/trunk
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-03-04 02:44:32
|
Revision: 228
http://pymoul.svn.sourceforge.net/pymoul/?rev=228&view=rev
Author: tiran
Date: 2007-03-03 18:44:33 -0800 (Sat, 03 Mar 2007)
Log Message:
-----------
Renamed package and files
Modified Paths:
--------------
xtea/trunk/Makefile
xtea/trunk/setup.py
Added Paths:
-----------
xtea/trunk/src/crypttea/
xtea/trunk/src/crypttea/__init__.py
xtea/trunk/src/crypttea/_common.py
xtea/trunk/src/crypttea/_pyxtea.c
xtea/trunk/src/crypttea/_pyxtea.pyx
xtea/trunk/src/crypttea/ctea.c
xtea/trunk/src/crypttea/ctea.h
xtea/trunk/src/crypttea/tea.py
xtea/trunk/src/crypttea/tests.py
xtea/trunk/src/crypttea/xtea.py
xtea/trunk/src/crypttea/xxtea.py
xtea/trunk/src/crypttea.egg-info/
xtea/trunk/src/crypttea.egg-info/PKG-INFO
xtea/trunk/src/crypttea.egg-info/SOURCES.txt
xtea/trunk/src/crypttea.egg-info/dependency_links.txt
xtea/trunk/src/crypttea.egg-info/native_libs.txt
xtea/trunk/src/crypttea.egg-info/top_level.txt
xtea/trunk/src/crypttea.egg-info/zip-safe
Removed Paths:
-------------
xtea/trunk/src/crypttea/__init__.py
xtea/trunk/src/crypttea/_common.py
xtea/trunk/src/crypttea/_xtea.c
xtea/trunk/src/crypttea/_xtea.pyx
xtea/trunk/src/crypttea/cxtea.c
xtea/trunk/src/crypttea/cxtea.h
xtea/trunk/src/crypttea/tea.py
xtea/trunk/src/crypttea/tests.py
xtea/trunk/src/crypttea/xtea.py
xtea/trunk/src/crypttea/xxtea.py
xtea/trunk/src/crypttea.egg-info/PKG-INFO
xtea/trunk/src/crypttea.egg-info/SOURCES.txt
xtea/trunk/src/crypttea.egg-info/dependency_links.txt
xtea/trunk/src/crypttea.egg-info/native_libs.txt
xtea/trunk/src/crypttea.egg-info/top_level.txt
xtea/trunk/src/crypttea.egg-info/zip-safe
xtea/trunk/src/xtea/
xtea/trunk/src/xtea.egg-info/
Modified: xtea/trunk/Makefile
===================================================================
--- xtea/trunk/Makefile 2007-03-04 02:38:37 UTC (rev 227)
+++ xtea/trunk/Makefile 2007-03-04 02:44:33 UTC (rev 228)
@@ -32,7 +32,7 @@
# What should the default be?
test:
- PYTHONPATH=src $(PYTHON) src/xtea/tests.py
+ PYTHONPATH=src $(PYTHON) src/crypttea/tests.py
egg: egg24 egg25
@@ -52,3 +52,4 @@
rm -f TAGS
rm -rf dist
$(PYTHON) setup.py clean -a
+
Modified: xtea/trunk/setup.py
===================================================================
--- xtea/trunk/setup.py 2007-03-04 02:38:37 UTC (rev 227)
+++ xtea/trunk/setup.py 2007-03-04 02:44:33 UTC (rev 228)
@@ -1,15 +1,7 @@
#!/usr/bin/env python
-"""XTEA Block Encryption Algorithm
+"""TEA, XTEA and XXTEA Block Encryption Algorithms
-This module provides a Python implementation of the XTEA block encryption
-algorithm (http://www.cix.co.uk/~klockstone/xtea.pdf).
-
-The module implements the basic XTEA block encryption algortithm
-(`xtea_encrypt`/`xtea_decrypt`) and also provides a higher level `crypt`
-function which symmetrically encrypts/decrypts a variable length string using
-XTEA in OFB mode as a key generator. The `crypt` function does not use
-`xtea_decrypt` which is provided for completeness only (but can be used
-to support other stream modes - eg CBC/CFB).
+TODO
"""
__author__ = "Christian Heimes"
__version__ = "$Id: setup.py 203 2007-02-27 14:31:27Z tiran $"
@@ -38,25 +30,28 @@
me = "Christian Heimes"
email = "chr...@ch..."
-cxtea = Extension('xtea._pyxtea', ['src/xtea/_pyxtea.pyx', 'src/xtea/ctea.c'])
+cxtea = Extension('crypttea._pyxtea',
+ ['src/crypttea/_pyxtea.pyx', 'src/crypttea/ctea.c']
+ )
ext_modules = []
if os.name == 'posix':
ext_modules.append(cxtea)
setup_infos = dict(
- name = "xtea",
+ name = "crypttea",
version = VERSION,
description = __doc__[:__doc__.find('\n')].strip(),
long_description = '\n'.join([line
for line in __doc__.split('\n')[1:]]),
- author = "Paul Chakravarti",
- author_email = "paul_dot_chakravarti_at_mac_dot_com",
+ author = "Christian Heimes",
+ author_email = "chr...@ch...",
maintainer = "Christian Heimes",
maintainer_email = "chr...@ch...",
url = "http://sourceforge.net/projects/pymoul/",
download_url= "http://cheeseshop.python.org/pypi/",
license = "Public Domain",
- keywords = ["xtea", "crypt", "encryption", "decryption"],
+ keywords = ["xtea", "tea", "xxtea", "btea", "crypt",
+ "encryption", "decryption", "cipher", "crypto"],
platforms = ['Independent'],
classifiers = (
#'Development Status :: 6 - Mature',
@@ -70,9 +65,10 @@
),
ext_modules=ext_modules,
setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,],
- packages = ['xtea'],
+ packages = ['crypttea'],
package_dir = {'' : 'src'},
zip_safe = True,
)
setup(**setup_infos)
+
Copied: xtea/trunk/src/crypttea (from rev 226, xtea/trunk/src/xtea)
Property changes on: xtea/trunk/src/crypttea
___________________________________________________________________
Name: svn:ignore
+ _pyxtea.so
Deleted: xtea/trunk/src/crypttea/__init__.py
===================================================================
--- xtea/trunk/src/xtea/__init__.py 2007-03-04 02:21:04 UTC (rev 226)
+++ xtea/trunk/src/crypttea/__init__.py 2007-03-04 02:44:33 UTC (rev 228)
@@ -1,12 +0,0 @@
-# xtea package
-#from tea import TEA
-from xtea import XTEA
-#from xxtea import XXTEA
-
-from _common import MODE_ECB
-from _common import MODE_OFB
-from _common import BIG_ENDIAN
-from _common import LITTLE_ENDIAN
-from _common import NETWORK_ENDIAN
-from _common import HOST_ENDIAN
-from _common import pad
Copied: xtea/trunk/src/crypttea/__init__.py (from rev 227, xtea/trunk/src/xtea/__init__.py)
===================================================================
--- xtea/trunk/src/crypttea/__init__.py (rev 0)
+++ xtea/trunk/src/crypttea/__init__.py 2007-03-04 02:44:33 UTC (rev 228)
@@ -0,0 +1,12 @@
+# xtea package
+#from tea import TEA
+from xtea import XTEA
+#from xxtea import XXTEA
+
+from _common import MODE_ECB
+from _common import MODE_OFB
+from _common import BIG_ENDIAN
+from _common import LITTLE_ENDIAN
+from _common import NETWORK_ENDIAN
+from _common import HOST_ENDIAN
+from _common import pad
Deleted: xtea/trunk/src/crypttea/_common.py
===================================================================
--- xtea/trunk/src/xtea/_common.py 2007-03-04 02:21:04 UTC (rev 226)
+++ xtea/trunk/src/crypttea/_common.py 2007-03-04 02:44:33 UTC (rev 228)
@@ -1,213 +0,0 @@
-"""
-"""
-from struct import pack
-from struct import unpack
-import sys
-
-__all__ = ['MODE_ECB', 'MODE_OFB', 'BIG_ENDIAN', 'LITTLE_ENDIAN',
- 'NETWORK_ENDIAN', 'HOST_ENDIAN', 'pad']
-
-MODE_ECB = 1 # Electronic Code Book
-MODE_CBC = 2 # Cipher Block Chaining
-MODE_CFB = 4 # Cipher Feedback
-MODE_OFB = 5 # Output Feedback
-MODE_CTR = 6 # Counter
-
-BIG_ENDIAN = 'big'
-LITTLE_ENDIAN = 'little'
-NETWORK_ENDIAN = LITTLE_ENDIAN
-HOST_ENDIAN = sys.byteorder
-
-NULL='\x00'
-ULONG_SIZE=4
-DELTA=0x9E3779B9
-
-def pad(s, align, char=NULL):
- """Pad string 's' to 'align' number of elements with char 'char'
-
- >>> pad('abcd', 4)
- 'abcd'
- >>> pad('abcdabcd', 4)
- 'abcdabcd'
- >>> pad('abcdef', 4)
- 'abcdef\\x00\\x00'
- >>> pad('abcdef', 4, char='0')
- 'abcdef00'
- """
- mod = len(s) % align
- if mod != 0:
- return s+mod*char
- else:
- return s
-
-class _AbstractTEA(object):
- """Abstract TEA base class
- """
- @property
- def key_size(self):
- """Size of key
- """
- return 16
-
- @property
- def block_size(self):
- """Size of blocks
- """
- return 8
-
- @property
- def default_rounds(self):
- """Default number of rounds
- """
- return 32
-
- def __init__(self, key, mode=MODE_ECB, IV=8*NULL, rounds=None,
- endian=HOST_ENDIAN, counter=None, segment_size=None):
- if endian == BIG_ENDIAN:
- self._endian = ">"
- elif endian == LITTLE_ENDIAN:
- self._endian = "<"
- else:
- raise ValueError("Unknown endian: %s" % endian)
-
- ks = self.key_size
- if isinstance(key, tuple):
- if len(key) != ks/ULONG_SIZE:
- raise ValueError("Invalid key size")
- for e in key:
- if not isinstance(e, (long, int)):
- raise TypeError("Wrong type %s in key" % repr(e))
- self._key = key
- elif isinstance(key, str):
- if len(key) != ks:
- raise ValueError("Invalid key size")
- self._key = unpack("%s%iL" % (self._endian, ks/ULONG_SIZE), key)
- else:
- raise TypeError("Invalid key type")
-
- if mode == MODE_ECB:
- pass
- elif mode == MODE_OFB:
- if not isinstance(IV, str) or len(IV) != self.block_size:
- raise ValueError("Invalid IV")
- else:
- raise ValueError("Unknown or unsupported mode")
- self._mode = mode
- self._iv = IV
-
- if rounds is None:
- rounds = self.default_rounds
- if rounds < 2 or not isinstance(rounds, int):
- raise ValueError("Invalid rounds")
- self._rounds = rounds
- self._counter = counter
- self._segment_size = segment_size
-
- @classmethod
- def new(cls, key, **kwargs):
- """PEP 272 conform constructor
- """
- return cls(key, **kwargs)
-
- @classmethod
- def setDefaultImpl(cls, impl='py'):
- """Set default implementation
- """
- if impl == 'py':
- cls._decrypt = staticmethod(cls._py_decrypt)
- cls._encrypt = staticmethod(cls._py_encrypt)
- elif impl == 'c':
- assert cls._c_decrypt is not None
- cls._decrypt = cls._c_decrypt
- cls._encrypt = cls._c_encrypt
- else:
- raise ValueError(impl)
-
- def setImpl(self, impl='py'):
- """Set implementation for this instance
- """
- if impl == 'py':
- self._decrypt = staticmethod(self._py_decrypt)
- self._encrypt = staticmethod(self._py_encrypt)
- elif impl == 'c':
- assert self._c_decrypt is not None
- self._decrypt = self._c_decrypt
- self._encrypt = self._c_encrypt
- else:
- raise ValueError(impl)
-
- def encrypt(self, block):
- """Encrypt a block
-
- @param block: block to encrypt
- @type block: str
- """
- if self._mode == MODE_ECB:
- return self._ecb(block, func=self._encrypt)
- elif self._mode == MODE_OFB:
- return self._ofb(block)
- else:
- raise ValueError("Unknown or unsupported mode")
-
- def decrypt(self, block):
- """Decrypt a block
-
- @param block: block to decrypt
- @type block: str
- """
- if self._mode == MODE_ECB:
- return self._ecb(block, func=self._decrypt)
- elif self._mode == MODE_OFB:
- return self._ofb(block)
- else:
- raise ValueError("Unknown or unsupported mode")
-
- _decrypt = None
- _encrypt = None
- _c_decrypt = None
- _c_encrypt = None
- _py_decrypt = None
- _py_encrypt = None
-
- def _ecb(self, block, func):
- """Electronic Code Book encryption/decryption
-
- @type block: str
- @param func: decrypt or encrypt function
- @type func: callable(v0, v1, keys[4], rounds)
- """
- l = len(block)
- bs = self.block_size
- key, rounds = self._key, self._rounds
- fmt = self._endian+"2L"
- result = []
- if l % bs != 0:
- raise ValueError
- for i in range(l/bs):
- v = unpack(fmt, block[i*bs:(i+1)*bs])
- w = func(v, key, rounds)
- result.append(pack(fmt, *w))
- return ''.join(result)
-
- def _ofb_keygen(self):
- """Key generator
-
- @return: generator function
- """
- key, iv, rounds = self._key, self._iv, self._rounds
- fmt = self._endian+"%iL" % (self.block_size/ULONG_SIZE)
- #v0, v1 = unpack(self._endian+"2L", iv)
- while True:
- v = unpack(fmt, iv)
- w = self._encrypt(v, key, rounds)
- iv = pack(fmt, *w)
- for k in iv:
- yield ord(k)
-
- def _ofb(self, block):
- """Output Feedback (OFB) encryption requires an IV
- """
- key = pack(self._endian+"%iL" % (self.key_size/ULONG_SIZE), *self._key)
- gen = self._ofb_keygen()
- xor = [chr(x^y) for (x, y) in zip(map(ord, block), gen)]
- return ''.join(xor)
Copied: xtea/trunk/src/crypttea/_common.py (from rev 227, xtea/trunk/src/xtea/_common.py)
===================================================================
--- xtea/trunk/src/crypttea/_common.py (rev 0)
+++ xtea/trunk/src/crypttea/_common.py 2007-03-04 02:44:33 UTC (rev 228)
@@ -0,0 +1,213 @@
+"""
+"""
+from struct import pack
+from struct import unpack
+import sys
+
+__all__ = ['MODE_ECB', 'MODE_OFB', 'BIG_ENDIAN', 'LITTLE_ENDIAN',
+ 'NETWORK_ENDIAN', 'HOST_ENDIAN', 'pad']
+
+MODE_ECB = 1 # Electronic Code Book
+MODE_CBC = 2 # Cipher Block Chaining
+MODE_CFB = 4 # Cipher Feedback
+MODE_OFB = 5 # Output Feedback
+MODE_CTR = 6 # Counter
+
+BIG_ENDIAN = 'big'
+LITTLE_ENDIAN = 'little'
+NETWORK_ENDIAN = LITTLE_ENDIAN
+HOST_ENDIAN = sys.byteorder
+
+NULL='\x00'
+ULONG_SIZE=4
+DELTA=0x9E3779B9
+
+def pad(s, align, char=NULL):
+ """Pad string 's' to 'align' number of elements with char 'char'
+
+ >>> pad('abcd', 4)
+ 'abcd'
+ >>> pad('abcdabcd', 4)
+ 'abcdabcd'
+ >>> pad('abcdef', 4)
+ 'abcdef\\x00\\x00'
+ >>> pad('abcdef', 4, char='0')
+ 'abcdef00'
+ """
+ mod = len(s) % align
+ if mod != 0:
+ return s+mod*char
+ else:
+ return s
+
+class _AbstractTEA(object):
+ """Abstract TEA base class
+ """
+ @property
+ def key_size(self):
+ """Size of key
+ """
+ return 16
+
+ @property
+ def block_size(self):
+ """Size of blocks
+ """
+ return 8
+
+ @property
+ def default_rounds(self):
+ """Default number of rounds
+ """
+ return 32
+
+ def __init__(self, key, mode=MODE_ECB, IV=8*NULL, rounds=None,
+ endian=HOST_ENDIAN, counter=None, segment_size=None):
+ if endian == BIG_ENDIAN:
+ self._endian = ">"
+ elif endian == LITTLE_ENDIAN:
+ self._endian = "<"
+ else:
+ raise ValueError("Unknown endian: %s" % endian)
+
+ ks = self.key_size
+ if isinstance(key, tuple):
+ if len(key) != ks/ULONG_SIZE:
+ raise ValueError("Invalid key size")
+ for e in key:
+ if not isinstance(e, (long, int)):
+ raise TypeError("Wrong type %s in key" % repr(e))
+ self._key = key
+ elif isinstance(key, str):
+ if len(key) != ks:
+ raise ValueError("Invalid key size")
+ self._key = unpack("%s%iL" % (self._endian, ks/ULONG_SIZE), key)
+ else:
+ raise TypeError("Invalid key type")
+
+ if mode == MODE_ECB:
+ pass
+ elif mode == MODE_OFB:
+ if not isinstance(IV, str) or len(IV) != self.block_size:
+ raise ValueError("Invalid IV")
+ else:
+ raise ValueError("Unknown or unsupported mode")
+ self._mode = mode
+ self._iv = IV
+
+ if rounds is None:
+ rounds = self.default_rounds
+ if rounds < 2 or not isinstance(rounds, int):
+ raise ValueError("Invalid rounds")
+ self._rounds = rounds
+ self._counter = counter
+ self._segment_size = segment_size
+
+ @classmethod
+ def new(cls, key, **kwargs):
+ """PEP 272 conform constructor
+ """
+ return cls(key, **kwargs)
+
+ @classmethod
+ def setDefaultImpl(cls, impl='py'):
+ """Set default implementation
+ """
+ if impl == 'py':
+ cls._decrypt = staticmethod(cls._py_decrypt)
+ cls._encrypt = staticmethod(cls._py_encrypt)
+ elif impl == 'c':
+ assert cls._c_decrypt is not None
+ cls._decrypt = cls._c_decrypt
+ cls._encrypt = cls._c_encrypt
+ else:
+ raise ValueError(impl)
+
+ def setImpl(self, impl='py'):
+ """Set implementation for this instance
+ """
+ if impl == 'py':
+ self._decrypt = staticmethod(self._py_decrypt)
+ self._encrypt = staticmethod(self._py_encrypt)
+ elif impl == 'c':
+ assert self._c_decrypt is not None
+ self._decrypt = self._c_decrypt
+ self._encrypt = self._c_encrypt
+ else:
+ raise ValueError(impl)
+
+ def encrypt(self, block):
+ """Encrypt a block
+
+ @param block: block to encrypt
+ @type block: str
+ """
+ if self._mode == MODE_ECB:
+ return self._ecb(block, func=self._encrypt)
+ elif self._mode == MODE_OFB:
+ return self._ofb(block)
+ else:
+ raise ValueError("Unknown or unsupported mode")
+
+ def decrypt(self, block):
+ """Decrypt a block
+
+ @param block: block to decrypt
+ @type block: str
+ """
+ if self._mode == MODE_ECB:
+ return self._ecb(block, func=self._decrypt)
+ elif self._mode == MODE_OFB:
+ return self._ofb(block)
+ else:
+ raise ValueError("Unknown or unsupported mode")
+
+ _decrypt = None
+ _encrypt = None
+ _c_decrypt = None
+ _c_encrypt = None
+ _py_decrypt = None
+ _py_encrypt = None
+
+ def _ecb(self, block, func):
+ """Electronic Code Book encryption/decryption
+
+ @type block: str
+ @param func: decrypt or encrypt function
+ @type func: callable(v0, v1, keys[4], rounds)
+ """
+ l = len(block)
+ bs = self.block_size
+ key, rounds = self._key, self._rounds
+ fmt = self._endian+"2L"
+ result = []
+ if l % bs != 0:
+ raise ValueError
+ for i in range(l/bs):
+ v = unpack(fmt, block[i*bs:(i+1)*bs])
+ w = func(v, key, rounds)
+ result.append(pack(fmt, *w))
+ return ''.join(result)
+
+ def _ofb_keygen(self):
+ """Key generator
+
+ @return: generator function
+ """
+ key, iv, rounds = self._key, self._iv, self._rounds
+ fmt = self._endian+"%iL" % (self.block_size/ULONG_SIZE)
+ #v0, v1 = unpack(self._endian+"2L", iv)
+ while True:
+ v = unpack(fmt, iv)
+ w = self._encrypt(v, key, rounds)
+ iv = pack(fmt, *w)
+ for k in iv:
+ yield ord(k)
+
+ def _ofb(self, block):
+ """Output Feedback (OFB) encryption requires an IV
+ """
+ key = pack(self._endian+"%iL" % (self.key_size/ULONG_SIZE), *self._key)
+ gen = self._ofb_keygen()
+ xor = [chr(x^y) for (x, y) in zip(map(ord, block), gen)]
+ return ''.join(xor)
Copied: xtea/trunk/src/crypttea/_pyxtea.c (from rev 227, xtea/trunk/src/xtea/_pyxtea.c)
===================================================================
--- xtea/trunk/src/crypttea/_pyxtea.c (rev 0)
+++ xtea/trunk/src/crypttea/_pyxtea.c 2007-03-04 02:44:33 UTC (rev 228)
@@ -0,0 +1,1002 @@
+/* Generated by Pyrex 0.9.5.1a on Sun Mar 4 03:32:36 2007 */
+
+#include "Python.h"
+#include "structmember.h"
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C double pow(double, double);
+#include "stdlib.h"
+#include "ctea.h"
+
+
+typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static int __pyx_lineno;
+static char *__pyx_filename;
+static char **__pyx_f;
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+
+/* Declarations from _pyxtea */
+
+
+
+/* Implementation of _pyxtea */
+
+static PyObject *__pyx_n__c_tea_encrypt;
+static PyObject *__pyx_n__c_tea_decrypt;
+static PyObject *__pyx_n__c_xtea_encrypt;
+static PyObject *__pyx_n__c_xtea_decrypt;
+static PyObject *__pyx_n__c_xxtea_encrypt;
+static PyObject *__pyx_n__c_xxtea_decrypt;
+
+static PyObject *__pyx_f_7_pyxtea__c_tea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_tea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_v[2]);
+ unsigned long (__pyx_v_k[4]);
+ PyObject *__pyx_v_rc;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ unsigned long __pyx_3;
+ PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_rc = Py_None; Py_INCREF(Py_None);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":29 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":29 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":30 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":30 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":30 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":30 */
+ __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[3]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":31 */
+ __pyx_1 = PyInt_FromLong(tea_encipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_rc);
+ __pyx_v_rc = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":32 */
+ __pyx_2 = PyLong_FromUnsignedLong((__pyx_v_v[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
+ __pyx_1 = PyLong_FromUnsignedLong((__pyx_v_v[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
+ __pyx_4 = PyList_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
+ PyList_SET_ITEM(__pyx_4, 0, __pyx_2);
+ PyList_SET_ITEM(__pyx_4, 1, __pyx_1);
+ __pyx_2 = 0;
+ __pyx_1 = 0;
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_4;
+ __pyx_4 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":33 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
+ __Pyx_AddTraceback("_pyxtea._c_tea_encrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_rc);
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_7_pyxtea__c_tea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_tea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_v[2]);
+ unsigned long (__pyx_v_k[4]);
+ PyObject *__pyx_v_rc;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ unsigned long __pyx_3;
+ PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_rc = Py_None; Py_INCREF(Py_None);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":38 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":38 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":39 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":39 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":39 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":39 */
+ __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[3]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":40 */
+ __pyx_1 = PyInt_FromLong(tea_decipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_rc);
+ __pyx_v_rc = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":41 */
+ __pyx_2 = PyLong_FromUnsignedLong((__pyx_v_v[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+ __pyx_1 = PyLong_FromUnsignedLong((__pyx_v_v[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+ __pyx_4 = PyList_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
+ PyList_SET_ITEM(__pyx_4, 0, __pyx_2);
+ PyList_SET_ITEM(__pyx_4, 1, __pyx_1);
+ __pyx_2 = 0;
+ __pyx_1 = 0;
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_4;
+ __pyx_4 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":42 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
+ __Pyx_AddTraceback("_pyxtea._c_tea_decrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_rc);
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_7_pyxtea__c_xtea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_xtea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_v[2]);
+ unsigned long (__pyx_v_k[4]);
+ PyObject *__pyx_v_rc;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ unsigned long __pyx_3;
+ PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_rc = Py_None; Py_INCREF(Py_None);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":49 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":49 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":50 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":50 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":50 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":50 */
+ __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[3]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":51 */
+ __pyx_1 = PyInt_FromLong(xtea_encipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_rc);
+ __pyx_v_rc = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":52 */
+ __pyx_2 = PyLong_FromUnsignedLong((__pyx_v_v[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
+ __pyx_1 = PyLong_FromUnsignedLong((__pyx_v_v[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
+ __pyx_4 = PyList_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; goto __pyx_L1;}
+ PyList_SET_ITEM(__pyx_4, 0, __pyx_2);
+ PyList_SET_ITEM(__pyx_4, 1, __pyx_1);
+ __pyx_2 = 0;
+ __pyx_1 = 0;
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_4;
+ __pyx_4 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":53 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
+ __Pyx_AddTraceback("_pyxtea._c_xtea_encrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_rc);
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_7_pyxtea__c_xtea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_xtea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_v[2]);
+ unsigned long (__pyx_v_k[4]);
+ PyObject *__pyx_v_rc;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ unsigned long __pyx_3;
+ PyObject *__pyx_4 = 0;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_rc = Py_None; Py_INCREF(Py_None);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":58 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":58 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_block, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_v[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":59 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":59 */
+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[1]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":59 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":59 */
+ __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[3]) = __pyx_3;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":60 */
+ __pyx_1 = PyInt_FromLong(xtea_decipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_rc);
+ __pyx_v_rc = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":61 */
+ __pyx_2 = PyLong_FromUnsignedLong((__pyx_v_v[0])); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
+ __pyx_1 = PyLong_FromUnsignedLong((__pyx_v_v[1])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
+ __pyx_4 = PyList_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
+ PyList_SET_ITEM(__pyx_4, 0, __pyx_2);
+ PyList_SET_ITEM(__pyx_4, 1, __pyx_1);
+ __pyx_2 = 0;
+ __pyx_1 = 0;
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_4;
+ __pyx_4 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":62 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_4);
+ __Pyx_AddTraceback("_pyxtea._c_xtea_decrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_rc);
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_n_len;
+static PyObject *__pyx_n_ValueError;
+static PyObject *__pyx_n_append;
+
+static PyObject *__pyx_k1p;
+
+static char (__pyx_k1[]) = "len(block) %i != rounds %i";
+
+static PyObject *__pyx_f_7_pyxtea__c_xxtea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_xxtea_encrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_k[4]);
+ unsigned long (*__pyx_v_v);
+ int __pyx_v_rc;
+ int __pyx_v_size;
+ int __pyx_v_i;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ PyObject *__pyx_3 = 0;
+ int __pyx_4;
+ PyObject *__pyx_5 = 0;
+ unsigned long __pyx_6;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":69 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_block);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_block);
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_v_size = __pyx_4;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":70 */
+ __pyx_4 = (__pyx_v_size != __pyx_v_rounds);
+ if (__pyx_4) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":71 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_rounds); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_2 = 0;
+ __pyx_3 = 0;
+ __pyx_2 = PyNumber_Remainder(__pyx_k1p, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __Pyx_Raise(__pyx_1, __pyx_2, 0);
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
+ goto __pyx_L2;
+ }
+ __pyx_L2:;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":72 */
+ __pyx_v_v = ((unsigned long (*))malloc(((sizeof(unsigned long )) * __pyx_v_size)));
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":73 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_size; ++__pyx_v_i) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":74 */
+ __pyx_3 = PyInt_FromLong(__pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_block, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_v[__pyx_v_i]) = __pyx_6;
+ }
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":75 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":75 */
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_key, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_k[1]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":75 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":75 */
+ __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_key, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_k[3]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":76 */
+ __pyx_v_rc = xxtea_encipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":77 */
+ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":78 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_size; ++__pyx_v_i) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":79 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_result, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
+ __pyx_3 = PyLong_FromUnsignedLong((__pyx_v_v[__pyx_v_i])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ }
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":80 */
+ free(__pyx_v_v);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":81 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_5);
+ __Pyx_AddTraceback("_pyxtea._c_xxtea_encrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_k2p;
+
+static char (__pyx_k2[]) = "len(block) %i != rounds %i";
+
+static PyObject *__pyx_f_7_pyxtea__c_xxtea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_7_pyxtea__c_xxtea_decrypt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_block = 0;
+ PyObject *__pyx_v_key = 0;
+ unsigned int __pyx_v_rounds;
+ unsigned long (__pyx_v_k[4]);
+ unsigned long (*__pyx_v_v);
+ int __pyx_v_rc;
+ int __pyx_v_size;
+ int __pyx_v_i;
+ PyObject *__pyx_v_result;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ PyObject *__pyx_2 = 0;
+ PyObject *__pyx_3 = 0;
+ int __pyx_4;
+ PyObject *__pyx_5 = 0;
+ unsigned long __pyx_6;
+ static char *__pyx_argnames[] = {"block","key","rounds",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOI", __pyx_argnames, &__pyx_v_block, &__pyx_v_key, &__pyx_v_rounds)) return 0;
+ Py_INCREF(__pyx_v_block);
+ Py_INCREF(__pyx_v_key);
+ __pyx_v_result = Py_None; Py_INCREF(Py_None);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":86 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
+ Py_INCREF(__pyx_v_block);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_block);
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_v_size = __pyx_4;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":87 */
+ __pyx_4 = (__pyx_v_size != __pyx_v_rounds);
+ if (__pyx_4) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":88 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_rounds); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
+ __pyx_2 = 0;
+ __pyx_3 = 0;
+ __pyx_2 = PyNumber_Remainder(__pyx_k2p, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __Pyx_Raise(__pyx_1, __pyx_2, 0);
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
+ goto __pyx_L2;
+ }
+ __pyx_L2:;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":89 */
+ __pyx_v_v = ((unsigned long (*))malloc(((sizeof(unsigned long )) * __pyx_v_size)));
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":90 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_size; ++__pyx_v_i) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":91 */
+ __pyx_3 = PyInt_FromLong(__pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_block, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_v[__pyx_v_i]) = __pyx_6;
+ }
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":92 */
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[0]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":92 */
+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_key, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_k[1]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":92 */
+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetItem(__pyx_v_key, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ (__pyx_v_k[2]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":92 */
+ __pyx_3 = PyInt_FromLong(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ __pyx_5 = PyObject_GetItem(__pyx_v_key, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_6 = PyInt_AsUnsignedLongMask(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ (__pyx_v_k[3]) = __pyx_6;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":93 */
+ __pyx_v_rc = xxtea_decipher(__pyx_v_v,__pyx_v_k,__pyx_v_rounds);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":94 */
+ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_result);
+ __pyx_v_result = __pyx_1;
+ __pyx_1 = 0;
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":95 */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_size; ++__pyx_v_i) {
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":96 */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_result, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ __pyx_3 = PyLong_FromUnsignedLong((__pyx_v_v[__pyx_v_i])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
+ __pyx_3 = 0;
+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ }
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":97 */
+ free(__pyx_v_v);
+
+ /* "/home/heimes/dev/pymoul/xtea/src/xtea/_pyxtea.pyx":98 */
+ Py_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_5);
+ __Pyx_AddTraceback("_pyxtea._c_xxtea_decrypt");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_result);
+ Py_DECREF(__pyx_v_block);
+ Py_DECREF(__pyx_v_key);
+ return __pyx_r;
+}
+
+static __Pyx_InternTabEntry __pyx_intern_tab[] = {
+ {&__pyx_n_ValueError, "ValueError"},
+ {&__pyx_n__c_tea_decrypt, "_c_tea_decrypt"},
+ {&__pyx_n__c_tea_encrypt, "_c_tea_encrypt"},
+ {&__pyx_n__c_xtea_decrypt, "_c_xtea_decrypt"},
+ {&__pyx_n__c_xtea_encrypt, "_c_xtea_encrypt"},
+ {&__pyx_n__c_xxtea_decrypt, "_c_xxtea_decrypt"},
+ {&__pyx_n__c_xxtea_encrypt, "_c_xxtea_encrypt"},
+ {&__pyx_n_append, "append"},
+ {&__pyx_n_len, "len"},
+ {0, 0}
+};
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_k1p, __pyx_k1, sizeof(__pyx_k1)},
+ {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)},
+ {0, 0, 0}
+};
+
+static struct PyMethodDef __pyx_methods[] = {
+ {"_c_tea_encrypt", (PyCFunction)__pyx_f_7_pyxtea__c_tea_encrypt, METH_VARARGS|METH_KEYWORDS, 0},
+ {"_c_tea_decrypt", (PyCFunction)__pyx_f_7_pyxtea__c_tea_decrypt, METH_VARARGS|METH_KEYWORDS, 0},
+ {"_c_xtea_encrypt", (PyCFunction)__pyx_f_7_pyxtea__c_xtea_encrypt, METH_VARARGS|METH_KEYWORDS, 0},
+ {"_c_xtea_decrypt", (PyCFunctio...
[truncated message content] |