From bc97d3669f1f8b70f1f17e1fc5161f70cfa701f3 Mon Sep 17 00:00:00 2001 From: Mathias Laurin Date: Tue, 19 Jan 2016 16:30:07 +0100 Subject: [PATCH] add C files for 0.5 --- mbedtls/__init__.c | 304 ++- mbedtls/_md.c | 324 +-- mbedtls/cipher/AES.c | 14 +- mbedtls/cipher/ARC4.c | 14 +- mbedtls/cipher/Blowfish.c | 14 +- mbedtls/cipher/Camellia.c | 14 +- mbedtls/cipher/DES.c | 14 +- mbedtls/cipher/DES3.c | 14 +- mbedtls/cipher/DES3dbl.c | 14 +- mbedtls/cipher/__init__.c | 16 +- mbedtls/cipher/_cipher.c | 885 ++++---- mbedtls/exceptions.c | 4031 ++++++++++++++++++++++++++++++++----- mbedtls/hash.c | 14 +- mbedtls/hmac.c | 817 ++++---- mbedtls/pk/RSA.c | 14 - mbedtls/pk/__init__.c | 13 - mbedtls/pk/_pk.c | 20 +- mbedtls/random.c | 14 - 18 files changed, 4905 insertions(+), 1645 deletions(-) diff --git a/mbedtls/__init__.c b/mbedtls/__init__.c index c7fc8673..c19f6383 100644 --- a/mbedtls/__init__.c +++ b/mbedtls/__init__.c @@ -533,6 +533,8 @@ static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, Py #define __Pyx_SetPackagePathFromImportLib(a, b) 0 #endif +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + typedef struct { int code_line; PyCodeObject* code_object; @@ -566,12 +568,56 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); int __pyx_module_is_main_mbedtls____init__ = 0; /* Implementation of 'mbedtls.__init__' */ +static char __pyx_k_[] = "*"; +static char __pyx_k_pk[] = "pk"; +static char __pyx_k_all[] = "__all__"; +static char __pyx_k_hash[] = "hash"; +static char __pyx_k_hmac[] = "hmac"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_test[] = "__test__"; +static char __pyx_k_author[] = "__author__"; +static char __pyx_k_cipher[] = "cipher"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_random[] = "random"; +static char __pyx_k_license[] = "__license__"; static char __pyx_k_mbedtls[] = "mbedtls"; +static char __pyx_k_copyright[] = "__copyright__"; +static char __pyx_k_exceptions[] = "exceptions"; +static char __pyx_k_mbedtls_pk[] = "mbedtls.pk"; +static char __pyx_k_MIT_License[] = "MIT License"; +static char __pyx_k_mbedtls_hash[] = "mbedtls.hash"; +static char __pyx_k_mbedtls_hmac[] = "mbedtls.hmac"; +static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; +static char __pyx_k_mbedtls_cipher[] = "mbedtls.cipher"; +static char __pyx_k_mbedtls_random[] = "mbedtls.random"; +static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; +static char __pyx_k_Copyright_2015_Elaborated_Networ[] = "Copyright 2015, Elaborated Networks GmbH"; +static char __pyx_k_python_mbedtls_is_a_this_wrapper[] = "python-mbedtls is a this wrapper to ARM's mbed TLS library."; +static PyObject *__pyx_n_s_; +static PyObject *__pyx_kp_s_Copyright_2015_Elaborated_Networ; +static PyObject *__pyx_kp_s_MIT_License; +static PyObject *__pyx_kp_s_Mathias_Laurin; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_author; +static PyObject *__pyx_n_s_cipher; +static PyObject *__pyx_n_s_copyright; +static PyObject *__pyx_n_s_exceptions; +static PyObject *__pyx_n_s_hash; +static PyObject *__pyx_n_s_hmac; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_license; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_u_mbedtls; +static PyObject *__pyx_n_s_mbedtls_cipher; +static PyObject *__pyx_n_s_mbedtls_exceptions; +static PyObject *__pyx_n_s_mbedtls_hash; +static PyObject *__pyx_n_s_mbedtls_hmac; +static PyObject *__pyx_n_s_mbedtls_pk; +static PyObject *__pyx_n_s_mbedtls_random; +static PyObject *__pyx_n_s_pk; +static PyObject *__pyx_n_s_random; static PyObject *__pyx_n_s_test; +static PyObject *__pyx_tuple__2; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} @@ -585,7 +631,7 @@ static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, #endif "mbedtls", - 0, /* m_doc */ + __pyx_k_python_mbedtls_is_a_this_wrapper, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -596,8 +642,29 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, + {&__pyx_kp_s_Copyright_2015_Elaborated_Networ, __pyx_k_Copyright_2015_Elaborated_Networ, sizeof(__pyx_k_Copyright_2015_Elaborated_Networ), 0, 0, 1, 0}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, + {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, + {&__pyx_n_s_cipher, __pyx_k_cipher, sizeof(__pyx_k_cipher), 0, 0, 1, 1}, + {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1}, + {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1}, + {&__pyx_n_s_hmac, __pyx_k_hmac, sizeof(__pyx_k_hmac), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_u_mbedtls, __pyx_k_mbedtls, sizeof(__pyx_k_mbedtls), 0, 1, 0, 1}, + {&__pyx_n_s_mbedtls_cipher, __pyx_k_mbedtls_cipher, sizeof(__pyx_k_mbedtls_cipher), 0, 0, 1, 1}, + {&__pyx_n_s_mbedtls_exceptions, __pyx_k_mbedtls_exceptions, sizeof(__pyx_k_mbedtls_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_mbedtls_hash, __pyx_k_mbedtls_hash, sizeof(__pyx_k_mbedtls_hash), 0, 0, 1, 1}, + {&__pyx_n_s_mbedtls_hmac, __pyx_k_mbedtls_hmac, sizeof(__pyx_k_mbedtls_hmac), 0, 0, 1, 1}, + {&__pyx_n_s_mbedtls_pk, __pyx_k_mbedtls_pk, sizeof(__pyx_k_mbedtls_pk), 0, 0, 1, 1}, + {&__pyx_n_s_mbedtls_random, __pyx_k_mbedtls_random, sizeof(__pyx_k_mbedtls_random), 0, 0, 1, 1}, + {&__pyx_n_s_pk, __pyx_k_pk, sizeof(__pyx_k_pk), 0, 0, 1, 1}, + {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -608,8 +675,20 @@ static int __Pyx_InitCachedBuiltins(void) { static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "mbedtls/__init__.pyx":16 + * + * + * __all__ = "cipher", "exceptions", "hash", "hmac", "pk", "random" # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(6, __pyx_n_s_cipher, __pyx_n_s_exceptions, __pyx_n_s_hash, __pyx_n_s_hmac, __pyx_n_s_pk, __pyx_n_s_random); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); __Pyx_RefNannyFinishContext(); return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; } static int __Pyx_InitGlobals(void) { @@ -628,6 +707,7 @@ PyMODINIT_FUNC PyInit_mbedtls(void) #endif { PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -669,7 +749,7 @@ PyMODINIT_FUNC PyInit_mbedtls(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("mbedtls", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + __pyx_m = Py_InitModule4("mbedtls", __pyx_methods, __pyx_k_python_mbedtls_is_a_this_wrapper, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -714,8 +794,152 @@ PyMODINIT_FUNC PyInit_mbedtls(void) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif + /* "mbedtls/__init__.pyx":3 + * """python-mbedtls is a this wrapper to ARM's mbed TLS library.""" + * + * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< + * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" + * __license__ = "MIT License" + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "mbedtls/__init__.pyx":4 + * + * __author__ = "Mathias Laurin" + * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< + * __license__ = "MIT License" + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "mbedtls/__init__.pyx":5 + * __author__ = "Mathias Laurin" + * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" + * __license__ = "MIT License" # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "mbedtls/__init__.pyx":8 + * + * + * import mbedtls.cipher as cipher # <<<<<<<<<<<<<< + * import mbedtls.exceptions as exceptions + * import mbedtls.hash as hash + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_mbedtls_cipher, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cipher, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/__init__.pyx":9 + * + * import mbedtls.cipher as cipher + * import mbedtls.exceptions as exceptions # <<<<<<<<<<<<<< + * import mbedtls.hash as hash + * import mbedtls.hmac as hmac + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_mbedtls_exceptions, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/__init__.pyx":10 + * import mbedtls.cipher as cipher + * import mbedtls.exceptions as exceptions + * import mbedtls.hash as hash # <<<<<<<<<<<<<< + * import mbedtls.hmac as hmac + * import mbedtls.pk as pk + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_mbedtls_hash, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hash, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/__init__.pyx":11 + * import mbedtls.exceptions as exceptions + * import mbedtls.hash as hash + * import mbedtls.hmac as hmac # <<<<<<<<<<<<<< + * import mbedtls.pk as pk + * import mbedtls.random as random + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_mbedtls_hmac, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_hmac, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/__init__.pyx":12 + * import mbedtls.hash as hash + * import mbedtls.hmac as hmac + * import mbedtls.pk as pk # <<<<<<<<<<<<<< + * import mbedtls.random as random + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_mbedtls_pk, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pk, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/__init__.pyx":13 + * import mbedtls.hmac as hmac + * import mbedtls.pk as pk + * import mbedtls.random as random # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_); + __Pyx_GIVEREF(__pyx_n_s_); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_mbedtls_random, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/__init__.pyx":16 + * + * + * __all__ = "cipher", "exceptions", "hash", "hmac", "pk", "random" # <<<<<<<<<<<<<< + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "mbedtls/__init__.pyx":1 - # <<<<<<<<<<<<<< + * """python-mbedtls is a this wrapper to ARM's mbed TLS library.""" # <<<<<<<<<<<<<< + * + * __author__ = "Mathias Laurin" */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -727,6 +951,7 @@ PyMODINIT_FUNC PyInit_mbedtls(void) goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init mbedtls.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -823,6 +1048,79 @@ static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, Py } #endif +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { diff --git a/mbedtls/_md.c b/mbedtls/_md.c index daf1decc..452b7671 100644 --- a/mbedtls/_md.c +++ b/mbedtls/_md.c @@ -1053,6 +1053,8 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mbedtls_md_type_t(mbedtls_md_type_t value); + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value); static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs, @@ -1244,6 +1246,7 @@ static char __pyx_k_md_lookup[] = "md_lookup"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_MemoryError[] = "MemoryError"; static char __pyx_k_check_error[] = "check_error"; static char __pyx_k_digest_size[] = "digest_size"; @@ -1253,7 +1256,6 @@ static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; static char __pyx_k_allocate_buffer[] = "allocate_buffer"; static char __pyx_k_dtype_is_object[] = "dtype_is_object"; static char __pyx_k_get_supported_mds[] = "__get_supported_mds"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_strided_and_direct[] = ""; static char __pyx_k_NotImplementedError[] = "NotImplementedError"; @@ -1288,11 +1290,11 @@ static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffe static char __pyx_k_The_canonical_name_of_the_hashin[] = "The canonical name of the hashing algorithm."; static char __pyx_k_The_internal_block_size_of_the_h[] = "The internal block size of the hash algorithm in bytes."; static char __pyx_k_The_size_of_the_resulting_hash_i[] = "The size of the resulting hash in bytes."; +static char __pyx_k_The_type_of_the_message_digest_o[] = "The type of the message digest output."; static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; @@ -1307,6 +1309,7 @@ static PyObject *__pyx_n_b_MD2; static PyObject *__pyx_n_b_MD4; static PyObject *__pyx_n_b_MD5; static PyObject *__pyx_n_s_MD_NAME; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; @@ -1408,6 +1411,7 @@ static int __pyx_pf_7mbedtls_3_md_6MDBase___init__(struct __pyx_obj_7mbedtls_3_m static int __pyx_pf_7mbedtls_3_md_6MDBase_2__cinit__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ static void __pyx_pf_7mbedtls_3_md_6MDBase_4__dealloc__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_6__str__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_5_type___get__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_11digest_size___get__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10block_size___get__(CYTHON_UNUSED struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self); /* proto */ @@ -2074,7 +2078,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_6__str__(struct __pyx_obj_7mbedt * """Return the name of the message digest output.""" * return self.name # <<<<<<<<<<<<<< * - * property digest_size: + * property _type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2103,6 +2107,69 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_6__str__(struct __pyx_obj_7mbedt } /* "mbedtls/_md.pyx":86 + * property _type: + * """The type of the message digest output.""" + * def __get__(self): # <<<<<<<<<<<<<< + * return _md.mbedtls_md_get_type(self._info) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7mbedtls_3_md_6MDBase_5_type_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_7mbedtls_3_md_6MDBase_5_type_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_7mbedtls_3_md_6MDBase_5_type___get__(((struct __pyx_obj_7mbedtls_3_md_MDBase *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_5_type___get__(struct __pyx_obj_7mbedtls_3_md_MDBase *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "mbedtls/_md.pyx":87 + * """The type of the message digest output.""" + * def __get__(self): + * return _md.mbedtls_md_get_type(self._info) # <<<<<<<<<<<<<< + * + * property digest_size: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mbedtls_md_type_t(mbedtls_md_get_type(__pyx_v_self->_info)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mbedtls/_md.pyx":86 + * property _type: + * """The type of the message digest output.""" + * def __get__(self): # <<<<<<<<<<<<<< + * return _md.mbedtls_md_get_type(self._info) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mbedtls._md.MDBase._type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mbedtls/_md.pyx":91 * property digest_size: * """The size of the resulting hash in bytes.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2132,7 +2199,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_11digest_size___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "mbedtls/_md.pyx":87 + /* "mbedtls/_md.pyx":92 * """The size of the resulting hash in bytes.""" * def __get__(self): * return _md.mbedtls_md_get_size(self._info) # <<<<<<<<<<<<<< @@ -2140,13 +2207,13 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_11digest_size___get__(struct __p * property block_size: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(mbedtls_md_get_size(__pyx_v_self->_info)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(mbedtls_md_get_size(__pyx_v_self->_info)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "mbedtls/_md.pyx":86 + /* "mbedtls/_md.pyx":91 * property digest_size: * """The size of the resulting hash in bytes.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2165,7 +2232,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_11digest_size___get__(struct __p return __pyx_r; } -/* "mbedtls/_md.pyx":91 +/* "mbedtls/_md.pyx":96 * property block_size: * """The internal block size of the hash algorithm in bytes.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2194,7 +2261,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10block_size___get__(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "mbedtls/_md.pyx":92 + /* "mbedtls/_md.pyx":97 * """The internal block size of the hash algorithm in bytes.""" * def __get__(self): * raise NotImplementedError # <<<<<<<<<<<<<< @@ -2202,9 +2269,9 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10block_size___get__(CYTHON_UNUS * property name: */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/_md.pyx":91 + /* "mbedtls/_md.pyx":96 * property block_size: * """The internal block size of the hash algorithm in bytes.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2221,7 +2288,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10block_size___get__(CYTHON_UNUS return __pyx_r; } -/* "mbedtls/_md.pyx":96 +/* "mbedtls/_md.pyx":101 * property name: * """The canonical name of the hashing algorithm.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2254,7 +2321,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "mbedtls/_md.pyx":97 + /* "mbedtls/_md.pyx":102 * """The canonical name of the hashing algorithm.""" * def __get__(self): * return _md.mbedtls_md_get_name(self._info).decode("ascii").lower() # <<<<<<<<<<<<<< @@ -2263,9 +2330,9 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7 */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = mbedtls_md_get_name(__pyx_v_self->_info); - __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -2279,10 +2346,10 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7 } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2290,7 +2357,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7 __pyx_t_1 = 0; goto __pyx_L0; - /* "mbedtls/_md.pyx":96 + /* "mbedtls/_md.pyx":101 * property name: * """The canonical name of the hashing algorithm.""" * def __get__(self): # <<<<<<<<<<<<<< @@ -2311,7 +2378,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_4name___get__(struct __pyx_obj_7 return __pyx_r; } -/* "mbedtls/_md.pyx":99 +/* "mbedtls/_md.pyx":104 * return _md.mbedtls_md_get_name(self._info).decode("ascii").lower() * * cdef _update(self, const unsigned char *input, size_t ilen): # <<<<<<<<<<<<<< @@ -2324,7 +2391,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__update(CYTHON_UNUSED struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_update", 0); - /* "mbedtls/_md.pyx":100 + /* "mbedtls/_md.pyx":105 * * cdef _update(self, const unsigned char *input, size_t ilen): * return -0x5100 # Bad input data error. # <<<<<<<<<<<<<< @@ -2336,7 +2403,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__update(CYTHON_UNUSED struct __py __pyx_r = __pyx_int_neg_20736; goto __pyx_L0; - /* "mbedtls/_md.pyx":99 + /* "mbedtls/_md.pyx":104 * return _md.mbedtls_md_get_name(self._info).decode("ascii").lower() * * cdef _update(self, const unsigned char *input, size_t ilen): # <<<<<<<<<<<<<< @@ -2351,7 +2418,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__update(CYTHON_UNUSED struct __py return __pyx_r; } -/* "mbedtls/_md.pyx":102 +/* "mbedtls/_md.pyx":107 * return -0x5100 # Bad input data error. * * cdef _finish(self, const unsigned char *output): # <<<<<<<<<<<<<< @@ -2364,7 +2431,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__finish(CYTHON_UNUSED struct __py __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_finish", 0); - /* "mbedtls/_md.pyx":103 + /* "mbedtls/_md.pyx":108 * * cdef _finish(self, const unsigned char *output): * return -0x5100 # Bad input data error. # <<<<<<<<<<<<<< @@ -2376,7 +2443,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__finish(CYTHON_UNUSED struct __py __pyx_r = __pyx_int_neg_20736; goto __pyx_L0; - /* "mbedtls/_md.pyx":102 + /* "mbedtls/_md.pyx":107 * return -0x5100 # Bad input data error. * * cdef _finish(self, const unsigned char *output): # <<<<<<<<<<<<<< @@ -2391,7 +2458,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase__finish(CYTHON_UNUSED struct __py return __pyx_r; } -/* "mbedtls/_md.pyx":105 +/* "mbedtls/_md.pyx":110 * return -0x5100 # Bad input data error. * * cpdef update(self, buffer): # <<<<<<<<<<<<<< @@ -2422,7 +2489,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7mbedtls_3_md_6MDBase_9update)) { __Pyx_XDECREF(__pyx_r); @@ -2438,16 +2505,16 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_buffer); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -2460,18 +2527,18 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "mbedtls/_md.pyx":106 + /* "mbedtls/_md.pyx":111 * * cpdef update(self, buffer): * if not buffer: # <<<<<<<<<<<<<< * return * cdef unsigned char[:] buf = bytearray(buffer) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_buffer); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((!__pyx_t_6) != 0); if (__pyx_t_7) { - /* "mbedtls/_md.pyx":107 + /* "mbedtls/_md.pyx":112 * cpdef update(self, buffer): * if not buffer: * return # <<<<<<<<<<<<<< @@ -2482,7 +2549,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "mbedtls/_md.pyx":106 + /* "mbedtls/_md.pyx":111 * * cpdef update(self, buffer): * if not buffer: # <<<<<<<<<<<<<< @@ -2491,36 +2558,36 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ */ } - /* "mbedtls/_md.pyx":108 + /* "mbedtls/_md.pyx":113 * if not buffer: * return * cdef unsigned char[:] buf = bytearray(buffer) # <<<<<<<<<<<<<< * check_error(self._update(&buf[0], buf.shape[0])) * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_buffer); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_2); - if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_8; __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL; - /* "mbedtls/_md.pyx":109 + /* "mbedtls/_md.pyx":114 * return * cdef unsigned char[:] buf = bytearray(buffer) * check_error(self._update(&buf[0], buf.shape[0])) # <<<<<<<<<<<<<< * * cpdef digest(self): */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = 0; __pyx_t_10 = -1; @@ -2530,9 +2597,9 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ } else if (unlikely(__pyx_t_9 >= __pyx_v_buf.shape[0])) __pyx_t_10 = 0; if (unlikely(__pyx_t_10 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_10); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->_update(__pyx_v_self, (&(*((unsigned char *) ( /* dim=0 */ (__pyx_v_buf.data + __pyx_t_9 * __pyx_v_buf.strides[0]) )))), (__pyx_v_buf.shape[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->_update(__pyx_v_self, (&(*((unsigned char *) ( /* dim=0 */ (__pyx_v_buf.data + __pyx_t_9 * __pyx_v_buf.strides[0]) )))), (__pyx_v_buf.shape[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -2545,24 +2612,24 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_update(struct __pyx_obj_7mbedtls_ } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/_md.pyx":105 + /* "mbedtls/_md.pyx":110 * return -0x5100 # Bad input data error. * * cpdef update(self, buffer): # <<<<<<<<<<<<<< @@ -2611,7 +2678,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_8update(struct __pyx_obj_7mbedtl int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_7mbedtls_3_md_6MDBase_update(__pyx_v_self, __pyx_v_buffer, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7mbedtls_3_md_6MDBase_update(__pyx_v_self, __pyx_v_buffer, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2628,7 +2695,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_8update(struct __pyx_obj_7mbedtl return __pyx_r; } -/* "mbedtls/_md.pyx":111 +/* "mbedtls/_md.pyx":116 * check_error(self._update(&buf[0], buf.shape[0])) * * cpdef digest(self): # <<<<<<<<<<<<<< @@ -2670,7 +2737,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7mbedtls_3_md_6MDBase_11digest)) { __Pyx_XDECREF(__pyx_r); @@ -2686,10 +2753,10 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -2701,20 +2768,20 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "mbedtls/_md.pyx":113 + /* "mbedtls/_md.pyx":118 * cpdef digest(self): * """Return the digest output of `message`.""" * cdef size_t sz = self.digest_size # <<<<<<<<<<<<<< * cdef unsigned char* output = malloc( * sz * sizeof(unsigned char)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sz = __pyx_t_5; - /* "mbedtls/_md.pyx":114 + /* "mbedtls/_md.pyx":119 * """Return the digest output of `message`.""" * cdef size_t sz = self.digest_size * cdef unsigned char* output = malloc( # <<<<<<<<<<<<<< @@ -2723,7 +2790,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ */ __pyx_v_output = ((unsigned char *)malloc((__pyx_v_sz * (sizeof(unsigned char))))); - /* "mbedtls/_md.pyx":116 + /* "mbedtls/_md.pyx":121 * cdef unsigned char* output = malloc( * sz * sizeof(unsigned char)) * if not output: # <<<<<<<<<<<<<< @@ -2733,16 +2800,16 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ __pyx_t_6 = ((!(__pyx_v_output != 0)) != 0); if (__pyx_t_6) { - /* "mbedtls/_md.pyx":117 + /* "mbedtls/_md.pyx":122 * sz * sizeof(unsigned char)) * if not output: * raise MemoryError() # <<<<<<<<<<<<<< * try: * check_error(self._finish(output)) */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/_md.pyx":116 + /* "mbedtls/_md.pyx":121 * cdef unsigned char* output = malloc( * sz * sizeof(unsigned char)) * if not output: # <<<<<<<<<<<<<< @@ -2751,7 +2818,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ */ } - /* "mbedtls/_md.pyx":118 + /* "mbedtls/_md.pyx":123 * if not output: * raise MemoryError() * try: # <<<<<<<<<<<<<< @@ -2760,16 +2827,16 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ */ /*try:*/ { - /* "mbedtls/_md.pyx":119 + /* "mbedtls/_md.pyx":124 * raise MemoryError() * try: * check_error(self._finish(output)) # <<<<<<<<<<<<<< * return bytes([output[n] for n in range(self.digest_size)]) * finally: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->_finish(__pyx_v_self, __pyx_v_output); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->_finish(__pyx_v_self, __pyx_v_output); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -2782,24 +2849,24 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/_md.pyx":120 + /* "mbedtls/_md.pyx":125 * try: * check_error(self._finish(output)) * return bytes([output[n] for n in range(self.digest_size)]) # <<<<<<<<<<<<<< @@ -2807,25 +2874,25 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ * free(output) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_digest_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -2833,17 +2900,17 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); #endif } @@ -2853,7 +2920,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} } break; } @@ -2861,19 +2928,19 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __pyx_t_2 = __Pyx_PyInt_From_unsigned_char((__pyx_v_output[__pyx_t_10])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = __Pyx_PyInt_From_unsigned_char((__pyx_v_output[__pyx_t_10])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_1; @@ -2881,7 +2948,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ goto __pyx_L4_return; } - /* "mbedtls/_md.pyx":122 + /* "mbedtls/_md.pyx":127 * return bytes([output[n] for n in range(self.digest_size)]) * finally: * free(output) # <<<<<<<<<<<<<< @@ -2933,7 +3000,7 @@ static PyObject *__pyx_f_7mbedtls_3_md_6MDBase_digest(struct __pyx_obj_7mbedtls_ } } - /* "mbedtls/_md.pyx":111 + /* "mbedtls/_md.pyx":116 * check_error(self._update(&buf[0], buf.shape[0])) * * cpdef digest(self): # <<<<<<<<<<<<<< @@ -2980,7 +3047,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10digest(struct __pyx_obj_7mbedt int __pyx_clineno = 0; __Pyx_RefNannySetupContext("digest", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_7mbedtls_3_md_6MDBase_digest(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7mbedtls_3_md_6MDBase_digest(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2997,7 +3064,7 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_10digest(struct __pyx_obj_7mbedt return __pyx_r; } -/* "mbedtls/_md.pyx":124 +/* "mbedtls/_md.pyx":129 * free(output) * * def hexdigest(self): # <<<<<<<<<<<<<< @@ -3032,18 +3099,18 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_12hexdigest(struct __pyx_obj_7mb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hexdigest", 0); - /* "mbedtls/_md.pyx":129 + /* "mbedtls/_md.pyx":134 * * """ * return binascii.hexlify(self.digest()).decode("ascii") # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexlify); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexlify); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_7mbedtls_3_md_MDBase *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -3056,32 +3123,32 @@ static PyObject *__pyx_pf_7mbedtls_3_md_6MDBase_12hexdigest(struct __pyx_obj_7mb } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "mbedtls/_md.pyx":124 + /* "mbedtls/_md.pyx":129 * free(output) * * def hexdigest(self): # <<<<<<<<<<<<<< @@ -14660,6 +14727,10 @@ static void __pyx_tp_dealloc_7mbedtls_3_md_MDBase(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } +static PyObject *__pyx_getprop_7mbedtls_3_md_6MDBase__type(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_7mbedtls_3_md_6MDBase_5_type_1__get__(o); +} + static PyObject *__pyx_getprop_7mbedtls_3_md_6MDBase_digest_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7mbedtls_3_md_6MDBase_11digest_size_1__get__(o); } @@ -14680,6 +14751,7 @@ static PyMethodDef __pyx_methods_7mbedtls_3_md_MDBase[] = { }; static struct PyGetSetDef __pyx_getsets_7mbedtls_3_md_MDBase[] = { + {(char *)"_type", __pyx_getprop_7mbedtls_3_md_6MDBase__type, 0, __pyx_k_The_type_of_the_message_digest_o, 0}, {(char *)"digest_size", __pyx_getprop_7mbedtls_3_md_6MDBase_digest_size, 0, __pyx_k_The_size_of_the_resulting_hash_i, 0}, {(char *)"block_size", __pyx_getprop_7mbedtls_3_md_6MDBase_block_size, 0, __pyx_k_The_internal_block_size_of_the_h, 0}, {(char *)"name", __pyx_getprop_7mbedtls_3_md_6MDBase_name, 0, __pyx_k_The_canonical_name_of_the_hashin, 0}, @@ -15451,11 +15523,6 @@ static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { type_name++; } if (0); - else if (__Pyx_StrEq(name, "contiguous")) { - Py_INCREF(o); - Py_DECREF(contiguous); - contiguous = o; - } else if (__Pyx_StrEq(name, "Py_None")) { PyErr_Format(PyExc_TypeError, "Cannot convert Python object Py_None to PyObject *"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L2_error;} @@ -15470,16 +15537,21 @@ static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { Py_DECREF(indirect_contiguous); indirect_contiguous = o; } - else if (__Pyx_StrEq(name, "generic")) { + else if (__Pyx_StrEq(name, "contiguous")) { Py_INCREF(o); - Py_DECREF(generic); - generic = o; + Py_DECREF(contiguous); + contiguous = o; } else if (__Pyx_StrEq(name, "indirect")) { Py_INCREF(o); Py_DECREF(indirect); indirect = o; } + else if (__Pyx_StrEq(name, "generic")) { + Py_INCREF(o); + Py_DECREF(generic); + generic = o; + } else { if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad; } @@ -15744,7 +15816,6 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, @@ -15759,6 +15830,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_b_MD4, __pyx_k_MD4, sizeof(__pyx_k_MD4), 0, 0, 0, 1}, {&__pyx_n_b_MD5, __pyx_k_MD5, sizeof(__pyx_k_MD5), 0, 0, 0, 1}, {&__pyx_n_s_MD_NAME, __pyx_k_MD_NAME, sizeof(__pyx_k_MD_NAME), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, @@ -15860,9 +15932,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15898,12 +15970,12 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "mbedtls/_md.pyx":129 + /* "mbedtls/_md.pyx":134 * * """ * return binascii.hexlify(self.digest()).decode("ascii") # <<<<<<<<<<<<<< */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); @@ -16338,7 +16410,7 @@ PyMODINIT_FUNC PyInit__md(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16346,7 +16418,7 @@ PyMODINIT_FUNC PyInit__md(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16354,11 +16426,11 @@ PyMODINIT_FUNC PyInit__md(void) /* "mbedtls/_md.pyx":5 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/_md.pyx":10 * cimport _md @@ -19161,6 +19233,32 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { return (int) -1; } +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mbedtls_md_type_t(mbedtls_md_type_t value) { + const mbedtls_md_type_t neg_one = (mbedtls_md_type_t) -1, const_zero = (mbedtls_md_type_t) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mbedtls_md_type_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mbedtls_md_type_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(mbedtls_md_type_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); + } + } else { + if (sizeof(mbedtls_md_type_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mbedtls_md_type_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(mbedtls_md_type_t), + little, !is_unsigned); + } +} + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) { const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; const int is_unsigned = neg_one > const_zero; diff --git a/mbedtls/cipher/AES.c b/mbedtls/cipher/AES.c index 6f524ee9..b5ccfc9c 100644 --- a/mbedtls/cipher/AES.c +++ b/mbedtls/cipher/AES.c @@ -686,9 +686,9 @@ static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_cipher_AES[] = "mbedtls.cipher.AES"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; @@ -700,10 +700,10 @@ static char __pyx_k_Advanced_Encryption_Standard_AES[] = "Advanced Encryption St static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static PyObject *__pyx_kp_s_128; static PyObject *__pyx_kp_s_AES_i_s; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_CCM; static PyObject *__pyx_n_s_MODE_CFB; @@ -1610,10 +1610,10 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 0}, {&__pyx_kp_s_AES_i_s, __pyx_k_AES_i_s, sizeof(__pyx_k_AES_i_s), 0, 0, 1, 0}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CCM, __pyx_k_MODE_CCM, sizeof(__pyx_k_MODE_CCM), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CFB, __pyx_k_MODE_CFB, sizeof(__pyx_k_MODE_CFB), 0, 0, 1, 1}, @@ -1794,7 +1794,7 @@ PyMODINIT_FUNC PyInit_AES(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1802,7 +1802,7 @@ PyMODINIT_FUNC PyInit_AES(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1810,11 +1810,11 @@ PyMODINIT_FUNC PyInit_AES(void) /* "mbedtls/cipher/AES.pyx":8 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/AES.pyx":12 * diff --git a/mbedtls/cipher/ARC4.c b/mbedtls/cipher/ARC4.c index 5d4474ef..86da363e 100644 --- a/mbedtls/cipher/ARC4.c +++ b/mbedtls/cipher/ARC4.c @@ -678,8 +678,8 @@ static char __pyx_k_key_size[] = "key_size"; static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_mbedtls_cipher_ARC4[] = "mbedtls.cipher.ARC4"; static char __pyx_k_InvalidKeyLengthError[] = "InvalidKeyLengthError"; @@ -688,9 +688,9 @@ static char __pyx_k_key_size_must_be_i_bytes_got_i[] = "key size must be %i byte static char __pyx_k_Alleged_River_Cipher_4_cipher_AR[] = "Alleged River Cipher 4 cipher (ARC4 or ARCFOUR) designed in 1987\nat RSA Security."; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static PyObject *__pyx_kp_s_ARC4_i; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; static PyObject *__pyx_n_s__2; static PyObject *__pyx_n_s_ascii; @@ -1263,9 +1263,9 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_ARC4_i, __pyx_k_ARC4_i, sizeof(__pyx_k_ARC4_i), 0, 0, 1, 0}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, @@ -1438,7 +1438,7 @@ PyMODINIT_FUNC PyInit_ARC4(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1446,7 +1446,7 @@ PyMODINIT_FUNC PyInit_ARC4(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1454,11 +1454,11 @@ PyMODINIT_FUNC PyInit_ARC4(void) /* "mbedtls/cipher/ARC4.pyx":7 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/ARC4.pyx":11 * diff --git a/mbedtls/cipher/Blowfish.c b/mbedtls/cipher/Blowfish.c index 3b4badae..efb27202 100644 --- a/mbedtls/cipher/Blowfish.c +++ b/mbedtls/cipher/Blowfish.c @@ -691,9 +691,9 @@ static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_BLOWFISH_s[] = "BLOWFISH-%s"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; static char __pyx_k_InvalidKeyLengthError[] = "InvalidKeyLengthError"; @@ -704,11 +704,11 @@ static char __pyx_k_Blowfish_cipher_designed_by_Bruc[] = "Blowfish cipher design static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static char __pyx_k_key_size_must_be_4_to_57_bytes_g[] = "key size must be 4 to 57 bytes, got %i"; static PyObject *__pyx_kp_s_64; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_BLOWFISH_s; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_CFB; static PyObject *__pyx_n_s_MODE_CTR; @@ -1548,11 +1548,11 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_BLOWFISH_s, __pyx_k_BLOWFISH_s, sizeof(__pyx_k_BLOWFISH_s), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CFB, __pyx_k_MODE_CFB, sizeof(__pyx_k_MODE_CFB), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CTR, __pyx_k_MODE_CTR, sizeof(__pyx_k_MODE_CTR), 0, 0, 1, 1}, @@ -1748,7 +1748,7 @@ PyMODINIT_FUNC PyInit_Blowfish(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1756,7 +1756,7 @@ PyMODINIT_FUNC PyInit_Blowfish(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1764,11 +1764,11 @@ PyMODINIT_FUNC PyInit_Blowfish(void) /* "mbedtls/cipher/Blowfish.pyx":6 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/Blowfish.pyx":10 * diff --git a/mbedtls/cipher/Camellia.c b/mbedtls/cipher/Camellia.c index 16deeb58..4fe6fa7a 100644 --- a/mbedtls/cipher/Camellia.c +++ b/mbedtls/cipher/Camellia.c @@ -685,10 +685,10 @@ static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_CAMELLIA_i_s[] = "CAMELLIA-%i-%s"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; static char __pyx_k_InvalidKeyLengthError[] = "InvalidKeyLengthError"; @@ -699,11 +699,11 @@ static char __pyx_k_key_size_must_16_24_or_32_bytes[] = "key size must 16, 24, o static char __pyx_k_Camellia_cipher_developed_by_Jap[] = "Camellia cipher developed by Japan's Mitsubishi an NTT in 2000."; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static PyObject *__pyx_kp_s_128; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_CAMELLIA_i_s; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_CCM; static PyObject *__pyx_n_s_MODE_CFB; @@ -1609,11 +1609,11 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 0}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_CAMELLIA_i_s, __pyx_k_CAMELLIA_i_s, sizeof(__pyx_k_CAMELLIA_i_s), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CCM, __pyx_k_MODE_CCM, sizeof(__pyx_k_MODE_CCM), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CFB, __pyx_k_MODE_CFB, sizeof(__pyx_k_MODE_CFB), 0, 0, 1, 1}, @@ -1794,7 +1794,7 @@ PyMODINIT_FUNC PyInit_Camellia(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1802,7 +1802,7 @@ PyMODINIT_FUNC PyInit_Camellia(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1810,11 +1810,11 @@ PyMODINIT_FUNC PyInit_Camellia(void) /* "mbedtls/cipher/Camellia.pyx":5 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/Camellia.pyx":9 * diff --git a/mbedtls/cipher/DES.c b/mbedtls/cipher/DES.c index a4626f0b..961374d3 100644 --- a/mbedtls/cipher/DES.c +++ b/mbedtls/cipher/DES.c @@ -681,9 +681,9 @@ static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_cipher_DES[] = "mbedtls.cipher.DES"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; @@ -693,11 +693,11 @@ static char __pyx_k_home_laurin_src_python_mbedtls[] = "/home/laurin/src/python- static char __pyx_k_key_size_must_be_16_bytes_got_r[] = "key size must be 16 bytes, got %r"; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static char __pyx_k_Data_Encryption_Standard_DES_cip[] = "Data Encryption Standard (DES) cipher developed by IBM\nin the 70's."; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_kp_s_DES_s; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_ECB; static PyObject *__pyx_kp_s_Mathias_Laurin; @@ -1421,11 +1421,11 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_kp_s_DES_s, __pyx_k_DES_s, sizeof(__pyx_k_DES_s), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_ECB, __pyx_k_MODE_ECB, sizeof(__pyx_k_MODE_ECB), 0, 0, 1, 1}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, @@ -1602,7 +1602,7 @@ PyMODINIT_FUNC PyInit_DES(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1610,7 +1610,7 @@ PyMODINIT_FUNC PyInit_DES(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1618,11 +1618,11 @@ PyMODINIT_FUNC PyInit_DES(void) /* "mbedtls/cipher/DES.pyx":7 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/DES.pyx":11 * diff --git a/mbedtls/cipher/DES3.c b/mbedtls/cipher/DES3.c index cc730c83..c33f67ca 100644 --- a/mbedtls/cipher/DES3.c +++ b/mbedtls/cipher/DES3.c @@ -681,9 +681,9 @@ static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_DES_EDE3_s[] = "DES-EDE3-%s"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; static char __pyx_k_mbedtls_cipher_DES3[] = "mbedtls.cipher.DES3"; @@ -693,11 +693,11 @@ static char __pyx_k_home_laurin_src_python_mbedtls[] = "/home/laurin/src/python- static char __pyx_k_key_size_must_be_i_bytes_got_i[] = "key size must be %i bytes, got %i"; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static char __pyx_k_Three_key_triple_DES_cipher_also[] = "Three-key triple DES cipher (also known as DES3, 3DES,\nTriple DES, or DES-EDE3)."; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_kp_s_DES_EDE3_s; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_ECB; static PyObject *__pyx_kp_s_Mathias_Laurin; @@ -1432,11 +1432,11 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_kp_s_DES_EDE3_s, __pyx_k_DES_EDE3_s, sizeof(__pyx_k_DES_EDE3_s), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_ECB, __pyx_k_MODE_ECB, sizeof(__pyx_k_MODE_ECB), 0, 0, 1, 1}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, @@ -1614,7 +1614,7 @@ PyMODINIT_FUNC PyInit_DES3(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1622,7 +1622,7 @@ PyMODINIT_FUNC PyInit_DES3(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1630,11 +1630,11 @@ PyMODINIT_FUNC PyInit_DES3(void) /* "mbedtls/cipher/DES3.pyx":7 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/DES3.pyx":11 * diff --git a/mbedtls/cipher/DES3dbl.c b/mbedtls/cipher/DES3dbl.c index caaa2146..b31d8e5a 100644 --- a/mbedtls/cipher/DES3dbl.c +++ b/mbedtls/cipher/DES3dbl.c @@ -681,9 +681,9 @@ static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_mode_name[] = "mode_name"; static char __pyx_k_block_size[] = "block_size"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_get_mode_name[] = "_get_mode_name"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_unsupported_mode_r[] = "unsupported mode %r"; static char __pyx_k_InvalidKeyLengthError[] = "InvalidKeyLengthError"; @@ -693,11 +693,11 @@ static char __pyx_k_home_laurin_src_python_mbedtls[] = "/home/laurin/src/python- static char __pyx_k_key_size_must_be_i_bytes_got_i[] = "key size must be %i bytes, got %i"; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static char __pyx_k_Two_key_triple_DES_cipher_also_k[] = "Two-key triple DES cipher (also known as DES3, 3DES, Triple DES,\nor DES-EDE)."; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_kp_s_DES_EDE_s; static PyObject *__pyx_n_s_FeatureUnavailableError; static PyObject *__pyx_n_s_InvalidKeyLengthError; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_ECB; static PyObject *__pyx_kp_s_Mathias_Laurin; @@ -1432,11 +1432,11 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_kp_s_DES_EDE_s, __pyx_k_DES_EDE_s, sizeof(__pyx_k_DES_EDE_s), 0, 0, 1, 0}, {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_ECB, __pyx_k_MODE_ECB, sizeof(__pyx_k_MODE_ECB), 0, 0, 1, 1}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, @@ -1614,7 +1614,7 @@ PyMODINIT_FUNC PyInit_DES3dbl(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1622,7 +1622,7 @@ PyMODINIT_FUNC PyInit_DES3dbl(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1630,11 +1630,11 @@ PyMODINIT_FUNC PyInit_DES3dbl(void) /* "mbedtls/cipher/DES3dbl.pyx":7 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/DES3dbl.pyx":11 * diff --git a/mbedtls/cipher/__init__.c b/mbedtls/cipher/__init__.c index 04feafd3..0b43ee4e 100644 --- a/mbedtls/cipher/__init__.c +++ b/mbedtls/cipher/__init__.c @@ -591,20 +591,20 @@ static char __pyx_k_Blowfish[] = "Blowfish"; static char __pyx_k_Camellia[] = "Camellia"; static char __pyx_k_cipher_2[] = "_cipher"; static char __pyx_k_copyright[] = "__copyright__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_Copyright_2016_Elaborated_Networ[] = "Copyright 2016, Elaborated Networks GmbH"; static char __pyx_k_The_cipher_package_provide_symme[] = "The cipher package provide symmetric encryption and decryption.\n\nThe API follows the recommendations from PEP 272 \"API for Block\nEncryption Algorithms\"\n\n"; static PyObject *__pyx_n_s_; static PyObject *__pyx_n_s_AES; static PyObject *__pyx_n_s_ARC4; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_n_s_Blowfish; static PyObject *__pyx_n_s_Camellia; static PyObject *__pyx_kp_s_Copyright_2016_Elaborated_Networ; static PyObject *__pyx_n_s_DES; static PyObject *__pyx_n_s_DES3; static PyObject *__pyx_n_s_DES3dbl; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_author; @@ -897,13 +897,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, {&__pyx_n_s_AES, __pyx_k_AES, sizeof(__pyx_k_AES), 0, 0, 1, 1}, {&__pyx_n_s_ARC4, __pyx_k_ARC4, sizeof(__pyx_k_ARC4), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_n_s_Blowfish, __pyx_k_Blowfish, sizeof(__pyx_k_Blowfish), 0, 0, 1, 1}, {&__pyx_n_s_Camellia, __pyx_k_Camellia, sizeof(__pyx_k_Camellia), 0, 0, 1, 1}, {&__pyx_kp_s_Copyright_2016_Elaborated_Networ, __pyx_k_Copyright_2016_Elaborated_Networ, sizeof(__pyx_k_Copyright_2016_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_DES, __pyx_k_DES, sizeof(__pyx_k_DES), 0, 0, 1, 1}, {&__pyx_n_s_DES3, __pyx_k_DES3, sizeof(__pyx_k_DES3), 0, 0, 1, 1}, {&__pyx_n_s_DES3dbl, __pyx_k_DES3dbl, sizeof(__pyx_k_DES3dbl), 0, 0, 1, 1}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, @@ -1035,7 +1035,7 @@ PyMODINIT_FUNC PyInit_cipher(void) * """ * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1043,7 +1043,7 @@ PyMODINIT_FUNC PyInit_cipher(void) * """ * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2016_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1051,14 +1051,14 @@ PyMODINIT_FUNC PyInit_cipher(void) /* "mbedtls/cipher/__init__.pyx":9 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2016, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * from _cipher import * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/__init__.pyx":11 - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * * from _cipher import * # <<<<<<<<<<<<<< * import AES diff --git a/mbedtls/cipher/_cipher.c b/mbedtls/cipher/_cipher.c index 00454c7b..7665a096 100644 --- a/mbedtls/cipher/_cipher.c +++ b/mbedtls/cipher/_cipher.c @@ -832,17 +832,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; @@ -859,6 +848,9 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); @@ -906,6 +898,8 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { @@ -1214,9 +1208,9 @@ static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; -static char __pyx_k_[] = "\000"; static char __pyx_k_O[] = "O"; static char __pyx_k_c[] = "c"; +static char __pyx_k__2[] = "\000"; static char __pyx_k_id[] = "id"; static char __pyx_k_iv[] = "iv"; static char __pyx_k_CBC[] = "CBC"; @@ -1226,7 +1220,7 @@ static char __pyx_k_CTR[] = "CTR"; static char __pyx_k_ECB[] = "ECB"; static char __pyx_k_GCM[] = "GCM"; static char __pyx_k_OFB[] = "OFB"; -static char __pyx_k__18[] = "*"; +static char __pyx_k__19[] = "*"; static char __pyx_k_all[] = "__all__"; static char __pyx_k_key[] = "key"; static char __pyx_k_obj[] = "obj"; @@ -1300,8 +1294,10 @@ static char __pyx_k_AES_256_CTR[] = "AES-256-CTR"; static char __pyx_k_AES_256_ECB[] = "AES-256-ECB"; static char __pyx_k_AES_256_GCM[] = "AES-256-GCM"; static char __pyx_k_CIPHER_NAME[] = "CIPHER_NAME"; +static char __pyx_k_CipherError[] = "CipherError"; static char __pyx_k_DES_EDE_CBC[] = "DES-EDE-CBC"; static char __pyx_k_DES_EDE_ECB[] = "DES-EDE-ECB"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_MODE_STREAM[] = "MODE_STREAM"; static char __pyx_k_MemoryError[] = "MemoryError"; static char __pyx_k_check_error[] = "check_error"; @@ -1335,7 +1331,6 @@ static char __pyx_k_CAMELLIA_256_CCM[] = "CAMELLIA-256-CCM"; static char __pyx_k_CAMELLIA_256_CTR[] = "CAMELLIA-256-CTR"; static char __pyx_k_CAMELLIA_256_ECB[] = "CAMELLIA-256-ECB"; static char __pyx_k_CAMELLIA_256_GCM[] = "CAMELLIA-256-GCM"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_strided_and_direct[] = ""; static char __pyx_k_CAMELLIA_128_CFB128[] = "CAMELLIA-128-CFB128"; @@ -1345,9 +1340,7 @@ static char __pyx_k_mode_requires_an_IV[] = "mode requires an IV"; static char __pyx_k_strided_and_indirect[] = ""; static char __pyx_k_unsupported_cipher_r[] = "unsupported cipher: %r"; static char __pyx_k_contiguous_and_direct[] = ""; -static char __pyx_k_FullBlockExpectedError[] = "FullBlockExpectedError"; static char __pyx_k_MemoryView_of_r_object[] = ""; -static char __pyx_k_UnsupportedCipherError[] = "UnsupportedCipherError"; static char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; static char __pyx_k_contiguous_and_indirect[] = ""; static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; @@ -1378,7 +1371,6 @@ static char __pyx_k_Return_the_size_of_the_ciphers_k[] = "Return the size of the static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; -static PyObject *__pyx_kp_b_; static PyObject *__pyx_kp_b_AES_128_CBC; static PyObject *__pyx_kp_b_AES_128_CCM; static PyObject *__pyx_kp_b_AES_128_CFB128; @@ -1399,7 +1391,6 @@ static PyObject *__pyx_kp_b_AES_256_ECB; static PyObject *__pyx_kp_b_AES_256_GCM; static PyObject *__pyx_kp_b_ARC4_128; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_b_BLOWFISH_CBC; static PyObject *__pyx_kp_b_BLOWFISH_CFB64; static PyObject *__pyx_kp_b_BLOWFISH_CTR; @@ -1431,6 +1422,7 @@ static PyObject *__pyx_n_s_CTR; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_n_s_Cipher; +static PyObject *__pyx_n_s_CipherError; static PyObject *__pyx_kp_s_Copyright_2015_Elaborated_Networ; static PyObject *__pyx_kp_b_DES_CBC; static PyObject *__pyx_kp_b_DES_ECB; @@ -1441,12 +1433,12 @@ static PyObject *__pyx_kp_b_DES_EDE_ECB; static PyObject *__pyx_n_s_ECB; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; -static PyObject *__pyx_n_s_FullBlockExpectedError; static PyObject *__pyx_n_s_GCM; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_n_s_MODE_CBC; static PyObject *__pyx_n_s_MODE_CCM; static PyObject *__pyx_n_s_MODE_CFB; @@ -1467,9 +1459,9 @@ static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; static PyObject *__pyx_n_s_STREAM; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_n_s_UnsupportedCipherError; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s__18; +static PyObject *__pyx_n_s__19; +static PyObject *__pyx_kp_b__2; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_ascii; @@ -1594,7 +1586,8 @@ static PyObject *__pyx_int_6; static PyObject *__pyx_int_7; static PyObject *__pyx_int_8; static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_tuple__2; +static PyObject *__pyx_int_neg_25216; +static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; @@ -1602,21 +1595,22 @@ static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__14; static PyObject *__pyx_slice__15; static PyObject *__pyx_slice__16; +static PyObject *__pyx_slice__17; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; -static PyObject *__pyx_tuple__17; -static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; /* "mbedtls/cipher/_cipher.pyx":88 * @@ -2152,9 +2146,9 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; - __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; @@ -2179,7 +2173,7 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte * """Generic all-in-one encryption/decryption.""" * # Make sure that `c_iv` has at least size 1 before dereferencing. * if not input: # <<<<<<<<<<<<<< - * raise FullBlockExpectedError() + * check_error(-0x6280) # Raise full block expected error. * cdef unsigned char[:] c_iv = ( */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_input); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2189,45 +2183,28 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte /* "mbedtls/cipher/_cipher.pyx":149 * # Make sure that `c_iv` has at least size 1 before dereferencing. * if not input: - * raise FullBlockExpectedError() # <<<<<<<<<<<<<< + * check_error(-0x6280) # Raise full block expected error. # <<<<<<<<<<<<<< * cdef unsigned char[:] c_iv = ( * bytearray(iv) if iv else bytearray(b"\x00")) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FullBlockExpectedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_5) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "mbedtls/cipher/_cipher.pyx":148 * """Generic all-in-one encryption/decryption.""" * # Make sure that `c_iv` has at least size 1 before dereferencing. * if not input: # <<<<<<<<<<<<<< - * raise FullBlockExpectedError() + * check_error(-0x6280) # Raise full block expected error. * cdef unsigned char[:] c_iv = ( */ } /* "mbedtls/cipher/_cipher.pyx":151 - * raise FullBlockExpectedError() + * check_error(-0x6280) # Raise full block expected error. * cdef unsigned char[:] c_iv = ( * bytearray(iv) if iv else bytearray(b"\x00")) # <<<<<<<<<<<<<< * cdef unsigned char[:] c_input = bytearray(input) @@ -2235,33 +2212,33 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_iv); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_iv); __Pyx_GIVEREF(__pyx_v_iv); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_iv); - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_4); - if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_iv); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __pyx_t_7; - __pyx_t_7.memview = NULL; - __pyx_t_7.data = NULL; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_3); + if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; } else { - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_4); - if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __pyx_t_7; - __pyx_t_7.memview = NULL; - __pyx_t_7.data = NULL; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_3); + if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; } - __pyx_v_c_iv = __pyx_t_6; - __pyx_t_6.memview = NULL; - __pyx_t_6.data = NULL; + __pyx_v_c_iv = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; /* "mbedtls/cipher/_cipher.pyx":152 * cdef unsigned char[:] c_iv = ( @@ -2270,20 +2247,20 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte * cdef size_t olen * cdef size_t sz = c_input.shape[0] + _c_get_block_size(ctx) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_input); __Pyx_GIVEREF(__pyx_v_input); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_input); - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_3); - if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_input); + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_c_input = __pyx_t_6; - __pyx_t_6.memview = NULL; - __pyx_t_6.data = NULL; + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_4); + if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_c_input = __pyx_t_5; + __pyx_t_5.memview = NULL; + __pyx_t_5.data = NULL; /* "mbedtls/cipher/_cipher.pyx":154 * cdef unsigned char[:] c_input = bytearray(input) @@ -2292,16 +2269,16 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte * cdef unsigned char* output = malloc( * sz * sizeof(unsigned char)) */ - __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_c_input.shape[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_f_7mbedtls_6cipher_7_cipher__c_get_block_size(__pyx_v_ctx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_c_input.shape[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_f_7mbedtls_6cipher_7_cipher__c_get_block_size(__pyx_v_ctx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_sz = __pyx_t_8; /* "mbedtls/cipher/_cipher.pyx":155 @@ -2402,37 +2379,37 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte * # The list comprehension is required. * return bytes([output[n] for n in range(olen)]) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_12) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "mbedtls/cipher/_cipher.pyx":168 * check_error(err) @@ -2442,26 +2419,26 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte * free(output) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_v_olen; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_8; __pyx_t_14+=1) { __pyx_v_n = __pyx_t_14; - __pyx_t_4 = __Pyx_PyInt_From_unsigned_char((__pyx_v_output[__pyx_v_n])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyInt_From_unsigned_char((__pyx_v_output[__pyx_v_n])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L5_return; } @@ -2476,13 +2453,13 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte /*exception exit:*/{ __pyx_L6_error:; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); @@ -2531,9 +2508,9 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher__c_crypt(mbedtls_cipher_conte __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); - __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("mbedtls.cipher._cipher._c_crypt", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -3014,7 +2991,7 @@ static int __pyx_pf_7mbedtls_6cipher_7_cipher_6Cipher___init__(struct __pyx_obj_ * self._setup(cipher_name) * self._setkey(key) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3065,7 +3042,7 @@ static int __pyx_pf_7mbedtls_6cipher_7_cipher_6Cipher___init__(struct __pyx_obj_ } else { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iv_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Multiply(__pyx_kp_b_, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Multiply(__pyx_kp_b__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_5; @@ -3233,7 +3210,8 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3284,7 +3262,7 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o * cpdef _setup(self, cipher_name): * """Initialize the context with `cipher_info_from_string`.""" * if cipher_name not in get_supported_ciphers(): # <<<<<<<<<<<<<< - * raise UnsupportedCipherError("unsupported cipher: %r" % cipher_name) + * raise CipherError(-1, "unsupported cipher: %r" % cipher_name) * cdef char[:] c_cipher_name = bytearray(cipher_name) */ __pyx_t_1 = __pyx_f_7mbedtls_6cipher_7_cipher_get_supported_ciphers(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3297,15 +3275,16 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o /* "mbedtls/cipher/_cipher.pyx":245 * """Initialize the context with `cipher_info_from_string`.""" * if cipher_name not in get_supported_ciphers(): - * raise UnsupportedCipherError("unsupported cipher: %r" % cipher_name) # <<<<<<<<<<<<<< + * raise CipherError(-1, "unsupported cipher: %r" % cipher_name) # <<<<<<<<<<<<<< * cdef char[:] c_cipher_name = bytearray(cipher_name) * check_error(_c_setup(&self._enc_ctx, c_cipher_name)) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_UnsupportedCipherError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unsupported_cipher_r, __pyx_v_cipher_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; + __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { @@ -3313,23 +3292,23 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_8 = 1; } } - if (!__pyx_t_5) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3339,14 +3318,14 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o * cpdef _setup(self, cipher_name): * """Initialize the context with `cipher_info_from_string`.""" * if cipher_name not in get_supported_ciphers(): # <<<<<<<<<<<<<< - * raise UnsupportedCipherError("unsupported cipher: %r" % cipher_name) + * raise CipherError(-1, "unsupported cipher: %r" % cipher_name) * cdef char[:] c_cipher_name = bytearray(cipher_name) */ } /* "mbedtls/cipher/_cipher.pyx":246 * if cipher_name not in get_supported_ciphers(): - * raise UnsupportedCipherError("unsupported cipher: %r" % cipher_name) + * raise CipherError(-1, "unsupported cipher: %r" % cipher_name) * cdef char[:] c_cipher_name = bytearray(cipher_name) # <<<<<<<<<<<<<< * check_error(_c_setup(&self._enc_ctx, c_cipher_name)) * check_error(_c_setup(&self._dec_ctx, c_cipher_name)) @@ -3359,15 +3338,15 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(__pyx_t_2); - if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_char(__pyx_t_2); + if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_c_cipher_name = __pyx_t_8; - __pyx_t_8.memview = NULL; - __pyx_t_8.data = NULL; + __pyx_v_c_cipher_name = __pyx_t_9; + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; /* "mbedtls/cipher/_cipher.pyx":247 - * raise UnsupportedCipherError("unsupported cipher: %r" % cipher_name) + * raise CipherError(-1, "unsupported cipher: %r" % cipher_name) * cdef char[:] c_cipher_name = bytearray(cipher_name) * check_error(_c_setup(&self._enc_ctx, c_cipher_name)) # <<<<<<<<<<<<<< * check_error(_c_setup(&self._dec_ctx, c_cipher_name)) @@ -3461,7 +3440,7 @@ static PyObject *__pyx_f_7mbedtls_6cipher_7_cipher_6Cipher__setup(struct __pyx_o __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); __Pyx_AddTraceback("mbedtls.cipher._cipher.Cipher._setup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -3826,7 +3805,7 @@ static PyObject *__pyx_pf_7mbedtls_6cipher_7_cipher_6Cipher_10__str__(struct __p __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; @@ -4554,7 +4533,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4586,7 +4565,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4621,7 +4600,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -4697,7 +4676,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4981,7 +4960,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5222,7 +5201,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8008,7 +7987,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -8838,7 +8817,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8955,7 +8934,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__13, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -10295,9 +10274,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__14); - __Pyx_GIVEREF(__pyx_slice__14); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__14); + __Pyx_INCREF(__pyx_slice__15); + __Pyx_GIVEREF(__pyx_slice__15); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__15); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10330,7 +10309,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__15); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__16); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; @@ -10475,9 +10454,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__16); - __Pyx_GIVEREF(__pyx_slice__16); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__16); + __Pyx_INCREF(__pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10604,7 +10583,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -16755,34 +16734,34 @@ static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { type_name++; } if (0); + else if (__Pyx_StrEq(name, "Py_None")) { + PyErr_Format(PyExc_TypeError, "Cannot convert Python object Py_None to PyObject *"); + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L2_error;} + } else if (__Pyx_StrEq(name, "contiguous")) { Py_INCREF(o); Py_DECREF(contiguous); contiguous = o; } - else if (__Pyx_StrEq(name, "Py_None")) { - PyErr_Format(PyExc_TypeError, "Cannot convert Python object Py_None to PyObject *"); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L2_error;} - } else if (__Pyx_StrEq(name, "indirect_contiguous")) { Py_INCREF(o); Py_DECREF(indirect_contiguous); indirect_contiguous = o; } - else if (__Pyx_StrEq(name, "indirect")) { + else if (__Pyx_StrEq(name, "strided")) { Py_INCREF(o); - Py_DECREF(indirect); - indirect = o; + Py_DECREF(strided); + strided = o; } else if (__Pyx_StrEq(name, "generic")) { Py_INCREF(o); Py_DECREF(generic); generic = o; } - else if (__Pyx_StrEq(name, "strided")) { + else if (__Pyx_StrEq(name, "indirect")) { Py_INCREF(o); - Py_DECREF(strided); - strided = o; + Py_DECREF(indirect); + indirect = o; } else { if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad; @@ -17047,7 +17026,6 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0}, {&__pyx_kp_b_AES_128_CBC, __pyx_k_AES_128_CBC, sizeof(__pyx_k_AES_128_CBC), 0, 0, 0, 0}, {&__pyx_kp_b_AES_128_CCM, __pyx_k_AES_128_CCM, sizeof(__pyx_k_AES_128_CCM), 0, 0, 0, 0}, {&__pyx_kp_b_AES_128_CFB128, __pyx_k_AES_128_CFB128, sizeof(__pyx_k_AES_128_CFB128), 0, 0, 0, 0}, @@ -17068,7 +17046,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_b_AES_256_GCM, __pyx_k_AES_256_GCM, sizeof(__pyx_k_AES_256_GCM), 0, 0, 0, 0}, {&__pyx_kp_b_ARC4_128, __pyx_k_ARC4_128, sizeof(__pyx_k_ARC4_128), 0, 0, 0, 0}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_b_BLOWFISH_CBC, __pyx_k_BLOWFISH_CBC, sizeof(__pyx_k_BLOWFISH_CBC), 0, 0, 0, 0}, {&__pyx_kp_b_BLOWFISH_CFB64, __pyx_k_BLOWFISH_CFB64, sizeof(__pyx_k_BLOWFISH_CFB64), 0, 0, 0, 0}, {&__pyx_kp_b_BLOWFISH_CTR, __pyx_k_BLOWFISH_CTR, sizeof(__pyx_k_BLOWFISH_CTR), 0, 0, 0, 0}, @@ -17100,6 +17077,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, {&__pyx_n_s_Cipher, __pyx_k_Cipher, sizeof(__pyx_k_Cipher), 0, 0, 1, 1}, + {&__pyx_n_s_CipherError, __pyx_k_CipherError, sizeof(__pyx_k_CipherError), 0, 0, 1, 1}, {&__pyx_kp_s_Copyright_2015_Elaborated_Networ, __pyx_k_Copyright_2015_Elaborated_Networ, sizeof(__pyx_k_Copyright_2015_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_kp_b_DES_CBC, __pyx_k_DES_CBC, sizeof(__pyx_k_DES_CBC), 0, 0, 0, 0}, {&__pyx_kp_b_DES_ECB, __pyx_k_DES_ECB, sizeof(__pyx_k_DES_ECB), 0, 0, 0, 0}, @@ -17110,12 +17088,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ECB, __pyx_k_ECB, sizeof(__pyx_k_ECB), 0, 0, 1, 1}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, - {&__pyx_n_s_FullBlockExpectedError, __pyx_k_FullBlockExpectedError, sizeof(__pyx_k_FullBlockExpectedError), 0, 0, 1, 1}, {&__pyx_n_s_GCM, __pyx_k_GCM, sizeof(__pyx_k_GCM), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_n_s_MODE_CBC, __pyx_k_MODE_CBC, sizeof(__pyx_k_MODE_CBC), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CCM, __pyx_k_MODE_CCM, sizeof(__pyx_k_MODE_CCM), 0, 0, 1, 1}, {&__pyx_n_s_MODE_CFB, __pyx_k_MODE_CFB, sizeof(__pyx_k_MODE_CFB), 0, 0, 1, 1}, @@ -17136,9 +17114,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_STREAM, __pyx_k_STREAM, sizeof(__pyx_k_STREAM), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, - {&__pyx_n_s_UnsupportedCipherError, __pyx_k_UnsupportedCipherError, sizeof(__pyx_k_UnsupportedCipherError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 1}, + {&__pyx_n_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 1}, + {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, @@ -17220,16 +17198,27 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "mbedtls/cipher/_cipher.pyx":149 + * # Make sure that `c_iv` has at least size 1 before dereferencing. + * if not input: + * check_error(-0x6280) # Raise full block expected error. # <<<<<<<<<<<<<< + * cdef unsigned char[:] c_iv = ( + * bytearray(iv) if iv else bytearray(b"\x00")) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_25216); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + /* "mbedtls/cipher/_cipher.pyx":151 - * raise FullBlockExpectedError() + * check_error(-0x6280) # Raise full block expected error. * cdef unsigned char[:] c_iv = ( * bytearray(iv) if iv else bytearray(b"\x00")) # <<<<<<<<<<<<<< * cdef unsigned char[:] c_input = bytearray(input) * cdef size_t olen */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_b_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_b__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); /* "mbedtls/cipher/_cipher.pyx":227 * def __init__(self, cipher_name, key, mode, iv): @@ -17238,9 +17227,9 @@ static int __Pyx_InitCachedConstants(void) { * self._setup(cipher_name) * self._setkey(key) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_mode_requires_an_IV); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_mode_requires_an_IV); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "mbedtls/cipher/_cipher.pyx":262 * def __str__(self): @@ -17249,9 +17238,9 @@ static int __Pyx_InitCachedConstants(void) { * * property block_size: */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "View.MemoryView":129 * @@ -17260,9 +17249,9 @@ static int __Pyx_InitCachedConstants(void) { * * if itemsize <= 0: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "View.MemoryView":132 * @@ -17271,9 +17260,9 @@ static int __Pyx_InitCachedConstants(void) { * * if not isinstance(format, bytes): */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "View.MemoryView":135 * @@ -17282,9 +17271,9 @@ static int __Pyx_InitCachedConstants(void) { * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "View.MemoryView":144 * @@ -17293,9 +17282,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "View.MemoryView":172 * self.data = malloc(self.len) @@ -17304,9 +17293,9 @@ static int __Pyx_InitCachedConstants(void) { * * if self.dtype_is_object: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "View.MemoryView":188 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -17315,9 +17304,9 @@ static int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "View.MemoryView":447 * result = struct.unpack(self.view.format, bytesitem) @@ -17326,9 +17315,9 @@ static int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "View.MemoryView":523 * if self.view.strides == NULL: @@ -17337,9 +17326,9 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":531 * def __get__(self): @@ -17348,12 +17337,12 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__13 = PyTuple_New(1); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__13); + __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__13, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__13); + PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":640 * if item is Ellipsis: @@ -17362,9 +17351,9 @@ static int __Pyx_InitCachedConstants(void) { * seen_ellipsis = True * else: */ - __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__14); - __Pyx_GIVEREF(__pyx_slice__14); + __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__15); + __Pyx_GIVEREF(__pyx_slice__15); /* "View.MemoryView":643 * seen_ellipsis = True @@ -17373,9 +17362,9 @@ static int __Pyx_InitCachedConstants(void) { * have_slices = True * else: */ - __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__15); - __Pyx_GIVEREF(__pyx_slice__15); + __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__16); + __Pyx_GIVEREF(__pyx_slice__16); /* "View.MemoryView":654 * nslices = ndim - len(result) @@ -17384,9 +17373,9 @@ static int __Pyx_InitCachedConstants(void) { * * return have_slices or nslices, tuple(result) */ - __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__16); - __Pyx_GIVEREF(__pyx_slice__16); + __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__17); + __Pyx_GIVEREF(__pyx_slice__17); /* "View.MemoryView":661 * for suboffset in suboffsets[:ndim]: @@ -17395,9 +17384,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "mbedtls/cipher/_cipher.pyx":16 * CIPHER_NAME = ( @@ -17406,9 +17395,9 @@ static int __Pyx_InitCachedConstants(void) { * b"NULL", * b"AES-128-ECB", */ - __pyx_tuple__19 = PyTuple_Pack(49, __pyx_n_b_NONE, __pyx_n_b_NULL, __pyx_kp_b_AES_128_ECB, __pyx_kp_b_AES_192_ECB, __pyx_kp_b_AES_256_ECB, __pyx_kp_b_AES_128_CBC, __pyx_kp_b_AES_192_CBC, __pyx_kp_b_AES_256_CBC, __pyx_kp_b_AES_128_CFB128, __pyx_kp_b_AES_192_CFB128, __pyx_kp_b_AES_256_CFB128, __pyx_kp_b_AES_128_CTR, __pyx_kp_b_AES_192_CTR, __pyx_kp_b_AES_256_CTR, __pyx_kp_b_AES_128_GCM, __pyx_kp_b_AES_192_GCM, __pyx_kp_b_AES_256_GCM, __pyx_kp_b_CAMELLIA_128_ECB, __pyx_kp_b_CAMELLIA_192_ECB, __pyx_kp_b_CAMELLIA_256_ECB, __pyx_kp_b_CAMELLIA_128_CBC, __pyx_kp_b_CAMELLIA_192_CBC, __pyx_kp_b_CAMELLIA_256_CBC, __pyx_kp_b_CAMELLIA_128_CFB128, __pyx_kp_b_CAMELLIA_192_CFB128, __pyx_kp_b_CAMELLIA_256_CFB128, __pyx_kp_b_CAMELLIA_128_CTR, __pyx_kp_b_CAMELLIA_192_CTR, __pyx_kp_b_CAMELLIA_256_CTR, __pyx_kp_b_CAMELLIA_128_GCM, __pyx_kp_b_CAMELLIA_192_GCM, __pyx_kp_b_CAMELLIA_256_GCM, __pyx_kp_b_DES_ECB, __pyx_kp_b_DES_CBC, __pyx_kp_b_DES_EDE_ECB, __pyx_kp_b_DES_EDE_CBC, __pyx_kp_b_DES_EDE3_ECB, __pyx_kp_b_DES_EDE3_CBC, __pyx_kp_b_BLOWFISH_ECB, __pyx_kp_b_BLOWFISH_CBC, __pyx_kp_b_BLOWFISH_CFB64, __pyx_kp_b_BLOWFISH_CTR, __pyx_kp_b_ARC4_128, __pyx_kp_b_AES_128_CCM, __pyx_kp_b_AES_192_CCM, __pyx_kp_b_AES_256_CCM, __pyx_kp_b_CAMELLIA_128_CCM, __pyx_kp_b_CAMELLIA_192_CCM, __pyx_kp_b_CAMELLIA_256_CCM); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__20 = PyTuple_Pack(49, __pyx_n_b_NONE, __pyx_n_b_NULL, __pyx_kp_b_AES_128_ECB, __pyx_kp_b_AES_192_ECB, __pyx_kp_b_AES_256_ECB, __pyx_kp_b_AES_128_CBC, __pyx_kp_b_AES_192_CBC, __pyx_kp_b_AES_256_CBC, __pyx_kp_b_AES_128_CFB128, __pyx_kp_b_AES_192_CFB128, __pyx_kp_b_AES_256_CFB128, __pyx_kp_b_AES_128_CTR, __pyx_kp_b_AES_192_CTR, __pyx_kp_b_AES_256_CTR, __pyx_kp_b_AES_128_GCM, __pyx_kp_b_AES_192_GCM, __pyx_kp_b_AES_256_GCM, __pyx_kp_b_CAMELLIA_128_ECB, __pyx_kp_b_CAMELLIA_192_ECB, __pyx_kp_b_CAMELLIA_256_ECB, __pyx_kp_b_CAMELLIA_128_CBC, __pyx_kp_b_CAMELLIA_192_CBC, __pyx_kp_b_CAMELLIA_256_CBC, __pyx_kp_b_CAMELLIA_128_CFB128, __pyx_kp_b_CAMELLIA_192_CFB128, __pyx_kp_b_CAMELLIA_256_CFB128, __pyx_kp_b_CAMELLIA_128_CTR, __pyx_kp_b_CAMELLIA_192_CTR, __pyx_kp_b_CAMELLIA_256_CTR, __pyx_kp_b_CAMELLIA_128_GCM, __pyx_kp_b_CAMELLIA_192_GCM, __pyx_kp_b_CAMELLIA_256_GCM, __pyx_kp_b_DES_ECB, __pyx_kp_b_DES_CBC, __pyx_kp_b_DES_EDE_ECB, __pyx_kp_b_DES_EDE_CBC, __pyx_kp_b_DES_EDE3_ECB, __pyx_kp_b_DES_EDE3_CBC, __pyx_kp_b_BLOWFISH_ECB, __pyx_kp_b_BLOWFISH_CBC, __pyx_kp_b_BLOWFISH_CFB64, __pyx_kp_b_BLOWFISH_CTR, __pyx_kp_b_ARC4_128, __pyx_kp_b_AES_128_CCM, __pyx_kp_b_AES_192_CCM, __pyx_kp_b_AES_256_CCM, __pyx_kp_b_CAMELLIA_128_CCM, __pyx_kp_b_CAMELLIA_192_CCM, __pyx_kp_b_CAMELLIA_256_CCM); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "mbedtls/cipher/_cipher.pyx":102 * @@ -17417,9 +17406,9 @@ static int __Pyx_InitCachedConstants(void) { * "Cipher" * ) */ - __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_MODE_ECB, __pyx_n_s_MODE_CBC, __pyx_n_s_MODE_CFB, __pyx_n_s_MODE_CTR, __pyx_n_s_MODE_GCM, __pyx_n_s_MODE_CCM, __pyx_n_s_Cipher); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__21 = PyTuple_Pack(7, __pyx_n_s_MODE_ECB, __pyx_n_s_MODE_CBC, __pyx_n_s_MODE_CFB, __pyx_n_s_MODE_CTR, __pyx_n_s_MODE_GCM, __pyx_n_s_MODE_CCM, __pyx_n_s_Cipher); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":278 * return self.name @@ -17428,9 +17417,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":279 * @@ -17439,9 +17428,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); /* "View.MemoryView":280 * cdef generic = Enum("") @@ -17450,9 +17439,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); /* "View.MemoryView":283 * @@ -17461,9 +17450,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); /* "View.MemoryView":284 * @@ -17472,9 +17461,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -17494,6 +17483,7 @@ static int __Pyx_InitGlobals(void) { __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_neg_25216 = PyInt_FromLong(-25216L); if (unlikely(!__pyx_int_neg_25216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -17654,7 +17644,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17662,7 +17652,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17670,11 +17660,11 @@ PyMODINIT_FUNC PyInit__cipher(void) /* "mbedtls/cipher/_cipher.pyx":6 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/_cipher.pyx":11 * cimport _cipher @@ -17685,9 +17675,9 @@ PyMODINIT_FUNC PyInit__cipher(void) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s__18); - __Pyx_GIVEREF(__pyx_n_s__18); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__18); + __Pyx_INCREF(__pyx_n_s__19); + __Pyx_GIVEREF(__pyx_n_s__19); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__19); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mbedtls_exceptions, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17701,7 +17691,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * b"NULL", * b"AES-128-ECB", */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIPHER_NAME, __pyx_tuple__19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIPHER_NAME, __pyx_tuple__20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/_cipher.pyx":68 * @@ -17882,7 +17872,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * "Cipher" * ) */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/cipher/_cipher.pyx":1 * """Ciphers for symmetric encryption and decryption.""" # <<<<<<<<<<<<<< @@ -17914,7 +17904,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_7); @@ -17928,7 +17918,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * cdef indirect = Enum("") * */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_7); @@ -17942,7 +17932,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * * */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_7); @@ -17956,7 +17946,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * cdef indirect_contiguous = Enum("") * */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_7); @@ -17970,7 +17960,7 @@ PyMODINIT_FUNC PyInit__cipher(void) * * */ - __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7); @@ -18163,21 +18153,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec } #endif -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -18209,166 +18184,6 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb #endif } -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON @@ -19305,6 +19120,166 @@ static int __Pyx_ParseOptionalKeywords( return -1; } +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, @@ -20060,7 +20035,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mbedtls_cipher_mode_t(mbedtls_cipher_mode_t value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mbedtls_cipher_mode_t(mbedtls_cipher_mode_t value) { const mbedtls_cipher_mode_t neg_one = (mbedtls_cipher_mode_t) -1, const_zero = (mbedtls_cipher_mode_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { diff --git a/mbedtls/exceptions.c b/mbedtls/exceptions.c index 89ae60e3..a71b7078 100644 --- a/mbedtls/exceptions.c +++ b/mbedtls/exceptions.c @@ -529,9 +529,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject static PyObject *__Pyx_GetBuiltinName(PyObject *name); -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); @@ -540,17 +545,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif - -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + return PyObject_SetAttr(obj, attr_name, value); +} #else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); @@ -558,6 +578,61 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, @@ -580,6 +655,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); +static CYTHON_INLINE int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); @@ -599,377 +676,825 @@ static PyObject *__pyx_f_7mbedtls_10exceptions_check_error(int const , int __pyx int __pyx_module_is_main_mbedtls__exceptions = 0; /* Implementation of 'mbedtls.exceptions' */ -static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_super; +static char __pyx_k_[] = ""; static char __pyx_k_all[] = "__all__"; static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_err[] = "err"; static char __pyx_k_get[] = "get"; +static char __pyx_k_msg[] = "msg"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_init[] = "__init__"; static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_self[] = "self"; static char __pyx_k_test[] = "__test__"; +static char __pyx_k_class[] = "__class__"; +static char __pyx_k_super[] = "super"; static char __pyx_k_author[] = "__author__"; +static char __pyx_k_lookup[] = "__lookup"; static char __pyx_k_module[] = "__module__"; -static char __pyx_k_IOError[] = "IOError"; +static char __pyx_k_EcError[] = "EcError"; +static char __pyx_k_PkError[] = "PkError"; static char __pyx_k_license[] = "__license__"; static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_PemError[] = "PemError"; +static char __pyx_k_RsaError[] = "RsaError"; static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_Asn1Error[] = "Asn1Error"; static char __pyx_k_ErrorBase[] = "_ErrorBase"; -static char __pyx_k_Exception[] = "Exception"; static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_metaclass[] = "__metaclass__"; -static char __pyx_k_MemoryError[] = "MemoryError"; +static char __pyx_k_ValueError[] = "ValueError"; +static char __pyx_k_s_0x_04X_s[] = "%s([0x%04X] %s)"; +static char __pyx_k_Base64Error[] = "Base64Error"; +static char __pyx_k_CipherError[] = "CipherError"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_check_error[] = "check_error"; +static char __pyx_k_EntropyError[] = "EntropyError"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_AuthFailedError[] = "AuthFailedError"; -static char __pyx_k_AllocFailedError[] = "AllocFailedError"; -static char __pyx_k_BadInputDataError[] = "BadInputDataError"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; +static char __pyx_k_ErrorBase___str[] = "_ErrorBase.__str__"; +static char __pyx_k_data_is_invalid[] = "data is invalid"; +static char __pyx_k_ErrorBase___init[] = "_ErrorBase.__init__"; +static char __pyx_k_or_invalid_length[] = "or invalid length"; +static char __pyx_k_Invalid_key_length[] = "Invalid key length."; +static char __pyx_k_MessageDigestError[] = "MessageDigestError"; +static char __pyx_k_correct_decryption[] = "correct decryption"; +static char __pyx_k_invalid_key_length[] = "invalid key length"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; -static char __pyx_k_InvalidPaddingError[] = "InvalidPaddingError"; +static char __pyx_k_Invalid_input_length[] = "Invalid input length."; static char __pyx_k_InvalidKeyLengthError[] = "InvalidKeyLengthError"; -static char __pyx_k_FullBlockExpectedError[] = "FullBlockExpectedError"; -static char __pyx_k_UnsupportedCipherError[] = "UnsupportedCipherError"; -static char __pyx_k_FeatureUnavailableError[] = "FeatureUnavailableError"; +static char __pyx_k_is_less_than_expected[] = "is less than expected"; +static char __pyx_k_for_correct_decryption[] = "for correct decryption"; static char __pyx_k_InvalidInputLengthError[] = "InvalidInputLengthError"; -static char __pyx_k_Raised_for_bad_input_data[] = "Raised for bad input data."; -static char __pyx_k_Raised_for_invalid_padding[] = "Raised for invalid padding."; -static char __pyx_k_Raised_for_invalid_key_length[] = "Raised for invalid key length."; -static char __pyx_k_Raised_for_invalid_input_length[] = "Raised for invalid input length."; +static char __pyx_k_output_buffer_too_small[] = "output buffer too small"; +static char __pyx_k_unsupported_key_version[] = "unsupported key version"; +static char __pyx_k_Errors_defined_in_asn1_h[] = "Errors defined in `asn1.h`."; +static char __pyx_k_invalid_key_tag_or_value[] = "invalid key tag or value"; +static char __pyx_k_memory_allocation_failed[] = "memory allocation failed"; +static char __pyx_k_read_write_error_in_file[] = "read/write error in file"; +static char __pyx_k_failed_to_allocate_memory[] = "failed to allocate memory"; +static char __pyx_k_invalid_data_input_length[] = "invalid data input length"; +static char __pyx_k_read_write_of_file_failed[] = "read/write of file failed"; +static char __pyx_k_Errors_defined_in_base64_h[] = "Errors defined in `base64.h`."; +static char __pyx_k_invalid_character_in_input[] = "invalid character in input"; +static char __pyx_k_the_signature_is_not_valid[] = "the signature is not valid"; +static char __pyx_k_RSA_IV_is_not_in_hex_format[] = "RSA IV is not in hex-format"; +static char __pyx_k_no_more_source_can_be_added[] = "no more source can be added"; +static char __pyx_k_key_algorithm_is_unsupported[] = "key algorithm is unsupported"; +static char __pyx_k_PEM_string_is_not_as_expected[] = "PEM string is not as expected"; +static char __pyx_k_elliptic_curve_is_unsupported[] = "elliptic curve is unsupported"; +static char __pyx_k_invalid_private_or_public_key[] = "invalid private or public key"; +static char __pyx_k_no_PEM_header_or_footer_found[] = "no PEM header or footer found"; +static char __pyx_k_only_RSA_and_EC_are_supported[] = "(only RSA and EC are supported)"; +static char __pyx_k_requested_curve_not_available[] = "requested curve not available"; +static char __pyx_k_home_laurin_src_python_mbedtls[] = "/home/laurin/src/python-mbedtls.git/mbedtls/exceptions.pyx"; +static char __pyx_k_only_NIST_curves_are_supported[] = "(only NIST curves are supported)"; +static char __pyx_k_the_PKCS_1_verification_failed[] = "the PKCS#1 verification failed"; +static char __pyx_k_Errors_defined_in_the_md_module[] = "Errors defined in the md module."; +static char __pyx_k_Errors_defined_in_the_pk_module[] = "Errors defined in the pk module."; +static char __pyx_k_bad_input_parameter_to_function[] = "bad input parameter to function"; +static char __pyx_k_critical_entropy_source_failure[] = "critical entropy source failure"; +static char __pyx_k_generation_of_random_value_such[] = "generation of random value, such as (ephemeral) key, failed"; +static char __pyx_k_given_private_key_password_does[] = "given private key password does not allow for"; +static char __pyx_k_the_public_key_operation_failed[] = "the public key operation failed"; +static char __pyx_k_unavailable_feature_e_g_hashing[] = "unavailable feature, e.g. hashing/decryption combination"; +static char __pyx_k_ASN_1_tag_was_of_an_unexpected_v[] = "ASN.1 tag was of an unexpected value"; static char __pyx_k_Base_class_for_cipher_exceptions[] = "Base class for cipher exceptions."; static char __pyx_k_Copyright_2015_Elaborated_Networ[] = "Copyright 2015, Elaborated Networks GmbH"; -static char __pyx_k_Exception_raised_when_allocation[] = "Exception raised when allocation failed."; -static char __pyx_k_Raised_upon_trying_to_instantiat[] = "Raised upon trying to instantiate an unsupported cipher."; -static char __pyx_k_Raised_when_authentication_faile[] = "Raised when authentication failed."; -static char __pyx_k_Raised_when_calling_a_feature_th[] = "Raised when calling a feature that is not available."; -static char __pyx_k_Raised_when_encryption_expects_f[] = "Raised when encryption expects full blocks."; +static char __pyx_k_Errors_defined_in_the_cipher_mod[] = "Errors defined in the cipher module."; +static char __pyx_k_Errors_defined_in_the_ecp_module[] = "Errors defined in the ecp module."; +static char __pyx_k_Errors_defined_in_the_entropy_mo[] = "Errors defined in the entropy module."; +static char __pyx_k_Errors_defined_in_the_pem_module[] = "Errors defined in the pem module."; +static char __pyx_k_Errors_defined_in_the_rsa_module[] = "Errors defined in the rsa module."; static char __pyx_k_This_module_defines_exceptions_a[] = "This module defines exceptions and errors."; -static PyObject *__pyx_n_s_AllocFailedError; -static PyObject *__pyx_kp_s_Apache_License_2_0; -static PyObject *__pyx_n_s_AuthFailedError; -static PyObject *__pyx_n_s_BadInputDataError; +static char __pyx_k_actual_length_differs_from_expec[] = "actual length differs from expected length"; +static char __pyx_k_authentication_failed_for_AEAD_m[] = "authentication failed (for AEAD modes)"; +static char __pyx_k_bad_input_parameters_to_function[] = "bad input parameters to function"; +static char __pyx_k_buffer_too_small_when_writing_AS[] = "buffer too small when writing ASN.1 data structure"; +static char __pyx_k_decryption_of_block_requires_a_f[] = "decryption of block requires a full block"; +static char __pyx_k_error_when_trying_to_determine_t[] = "error when trying to determine the length"; +static char __pyx_k_input_contains_invalid_padding_a[] = "input contains invalid padding and is rejected"; +static char __pyx_k_input_data_contains_invalid_padd[] = "input data contains invalid padding and is rejected"; +static char __pyx_k_key_failed_to_pass_the_library_s[] = "key failed to pass the library's validity check"; +static char __pyx_k_no_sources_have_been_added_to_po[] = "no sources have been added to poll"; +static char __pyx_k_no_strong_source_have_been_added[] = "no strong source have been added to poll"; +static char __pyx_k_opening_or_reading_of_file_faile[] = "opening or reading of file failed"; +static char __pyx_k_out_of_data_when_parsing_and_ASN[] = "out of data when parsing and ASN1 data structure"; +static char __pyx_k_private_key_password_can_t_be_em[] = "private key password can't be empty"; +static char __pyx_k_signature_is_valid_but_shorter_t[] = "signature is valid but shorter than the user-specified length"; +static char __pyx_k_something_failed_during_generati[] = "something failed during generation of a key"; +static char __pyx_k_the_algorithm_tag_or_value_is_in[] = "the algorithm tag or value is invalid"; +static char __pyx_k_the_buffer_is_too_small_to_write[] = "the buffer is too small to write to"; +static char __pyx_k_the_data_input_has_an_invalid_le[] = "the data input has an invalid length"; +static char __pyx_k_the_output_buffer_for_decryption[] = "the output buffer for decryption is not large enough"; +static char __pyx_k_the_private_key_operation_failed[] = "the private key operation failed"; +static char __pyx_k_the_pubkey_tag_or_value_is_inval[] = "the pubkey tag or value is invalid"; +static char __pyx_k_the_random_generator_failed_to_g[] = "the random generator failed to generate non-zeros"; +static char __pyx_k_the_selected_feature_is_not_avai[] = "the selected feature is not available"; +static char __pyx_k_the_signature_is_valid_but_its_l[] = "the signature is valid but its length"; +static char __pyx_k_type_mismatch_eg_attempt_to_encr[] = "type mismatch, eg attempt to encrypt with an ECDSA key"; +static char __pyx_k_unavailable_feature_eg_RSA_disab[] = "unavailable feature, eg RSA disabled for RSA key"; +static char __pyx_k_unsupported_key_encryption_algor[] = "unsupported key encryption algorithm"; +static char __pyx_k_given_private_key_password_does_2[] = "given private key password does not allow"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_kp_s_ASN_1_tag_was_of_an_unexpected_v; +static PyObject *__pyx_n_s_Asn1Error; +static PyObject *__pyx_n_s_Base64Error; static PyObject *__pyx_kp_s_Base_class_for_cipher_exceptions; +static PyObject *__pyx_n_s_CipherError; static PyObject *__pyx_kp_s_Copyright_2015_Elaborated_Networ; +static PyObject *__pyx_n_s_EcError; +static PyObject *__pyx_n_s_EntropyError; static PyObject *__pyx_n_s_ErrorBase; -static PyObject *__pyx_n_s_Exception; -static PyObject *__pyx_kp_s_Exception_raised_when_allocation; -static PyObject *__pyx_n_s_FeatureUnavailableError; -static PyObject *__pyx_n_s_FullBlockExpectedError; -static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_ErrorBase___init; +static PyObject *__pyx_n_s_ErrorBase___str; +static PyObject *__pyx_kp_s_Errors_defined_in_asn1_h; +static PyObject *__pyx_kp_s_Errors_defined_in_base64_h; +static PyObject *__pyx_kp_s_Errors_defined_in_the_cipher_mod; +static PyObject *__pyx_kp_s_Errors_defined_in_the_ecp_module; +static PyObject *__pyx_kp_s_Errors_defined_in_the_entropy_mo; +static PyObject *__pyx_kp_s_Errors_defined_in_the_md_module; +static PyObject *__pyx_kp_s_Errors_defined_in_the_pem_module; +static PyObject *__pyx_kp_s_Errors_defined_in_the_pk_module; +static PyObject *__pyx_kp_s_Errors_defined_in_the_rsa_module; static PyObject *__pyx_n_s_InvalidInputLengthError; static PyObject *__pyx_n_s_InvalidKeyLengthError; -static PyObject *__pyx_n_s_InvalidPaddingError; +static PyObject *__pyx_kp_s_Invalid_input_length; +static PyObject *__pyx_kp_s_Invalid_key_length; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; -static PyObject *__pyx_n_s_MemoryError; -static PyObject *__pyx_kp_s_Raised_for_bad_input_data; -static PyObject *__pyx_kp_s_Raised_for_invalid_input_length; -static PyObject *__pyx_kp_s_Raised_for_invalid_key_length; -static PyObject *__pyx_kp_s_Raised_for_invalid_padding; -static PyObject *__pyx_kp_s_Raised_upon_trying_to_instantiat; -static PyObject *__pyx_kp_s_Raised_when_authentication_faile; -static PyObject *__pyx_kp_s_Raised_when_calling_a_feature_th; -static PyObject *__pyx_kp_s_Raised_when_encryption_expects_f; -static PyObject *__pyx_n_s_UnsupportedCipherError; +static PyObject *__pyx_n_s_MessageDigestError; +static PyObject *__pyx_kp_s_PEM_string_is_not_as_expected; +static PyObject *__pyx_n_s_PemError; +static PyObject *__pyx_n_s_PkError; +static PyObject *__pyx_kp_s_RSA_IV_is_not_in_hex_format; +static PyObject *__pyx_n_s_RsaError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s_actual_length_differs_from_expec; static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_authentication_failed_for_AEAD_m; static PyObject *__pyx_n_s_author; +static PyObject *__pyx_kp_s_bad_input_parameter_to_function; +static PyObject *__pyx_kp_s_bad_input_parameters_to_function; +static PyObject *__pyx_kp_s_buffer_too_small_when_writing_AS; static PyObject *__pyx_n_s_check_error; +static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_copyright; +static PyObject *__pyx_kp_s_correct_decryption; +static PyObject *__pyx_kp_s_critical_entropy_source_failure; +static PyObject *__pyx_kp_s_data_is_invalid; +static PyObject *__pyx_kp_s_decryption_of_block_requires_a_f; static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_kp_s_elliptic_curve_is_unsupported; +static PyObject *__pyx_n_s_err; +static PyObject *__pyx_kp_s_error_when_trying_to_determine_t; +static PyObject *__pyx_kp_s_failed_to_allocate_memory; +static PyObject *__pyx_kp_s_for_correct_decryption; +static PyObject *__pyx_kp_s_generation_of_random_value_such; static PyObject *__pyx_n_s_get; +static PyObject *__pyx_kp_s_given_private_key_password_does; +static PyObject *__pyx_kp_s_given_private_key_password_does_2; +static PyObject *__pyx_kp_s_home_laurin_src_python_mbedtls; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_kp_s_input_contains_invalid_padding_a; +static PyObject *__pyx_kp_s_input_data_contains_invalid_padd; +static PyObject *__pyx_kp_s_invalid_character_in_input; +static PyObject *__pyx_kp_s_invalid_data_input_length; +static PyObject *__pyx_kp_s_invalid_key_length; +static PyObject *__pyx_kp_s_invalid_key_tag_or_value; +static PyObject *__pyx_kp_s_invalid_private_or_public_key; +static PyObject *__pyx_kp_s_is_less_than_expected; +static PyObject *__pyx_kp_s_key_algorithm_is_unsupported; +static PyObject *__pyx_kp_s_key_failed_to_pass_the_library_s; static PyObject *__pyx_n_s_license; +static PyObject *__pyx_n_s_lookup; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mbedtls_exceptions; +static PyObject *__pyx_kp_s_memory_allocation_failed; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_msg; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_kp_s_no_PEM_header_or_footer_found; +static PyObject *__pyx_kp_s_no_more_source_can_be_added; +static PyObject *__pyx_kp_s_no_sources_have_been_added_to_po; +static PyObject *__pyx_kp_s_no_strong_source_have_been_added; +static PyObject *__pyx_kp_s_only_NIST_curves_are_supported; +static PyObject *__pyx_kp_s_only_RSA_and_EC_are_supported; +static PyObject *__pyx_kp_s_opening_or_reading_of_file_faile; +static PyObject *__pyx_kp_s_or_invalid_length; +static PyObject *__pyx_kp_s_out_of_data_when_parsing_and_ASN; +static PyObject *__pyx_kp_s_output_buffer_too_small; static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_kp_s_private_key_password_can_t_be_em; static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_kp_s_read_write_error_in_file; +static PyObject *__pyx_kp_s_read_write_of_file_failed; +static PyObject *__pyx_kp_s_requested_curve_not_available; +static PyObject *__pyx_kp_s_s_0x_04X_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_kp_s_signature_is_valid_but_shorter_t; +static PyObject *__pyx_kp_s_something_failed_during_generati; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_super; static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_s_the_PKCS_1_verification_failed; +static PyObject *__pyx_kp_s_the_algorithm_tag_or_value_is_in; +static PyObject *__pyx_kp_s_the_buffer_is_too_small_to_write; +static PyObject *__pyx_kp_s_the_data_input_has_an_invalid_le; +static PyObject *__pyx_kp_s_the_output_buffer_for_decryption; +static PyObject *__pyx_kp_s_the_private_key_operation_failed; +static PyObject *__pyx_kp_s_the_pubkey_tag_or_value_is_inval; +static PyObject *__pyx_kp_s_the_public_key_operation_failed; +static PyObject *__pyx_kp_s_the_random_generator_failed_to_g; +static PyObject *__pyx_kp_s_the_selected_feature_is_not_avai; +static PyObject *__pyx_kp_s_the_signature_is_not_valid; +static PyObject *__pyx_kp_s_the_signature_is_valid_but_its_l; +static PyObject *__pyx_kp_s_type_mismatch_eg_attempt_to_encr; +static PyObject *__pyx_kp_s_unavailable_feature_e_g_hashing; +static PyObject *__pyx_kp_s_unavailable_feature_eg_RSA_disab; +static PyObject *__pyx_kp_s_unsupported_key_encryption_algor; +static PyObject *__pyx_kp_s_unsupported_key_version; +static PyObject *__pyx_pf_7mbedtls_10exceptions_10_ErrorBase___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_err, PyObject *__pyx_v_msg, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_7mbedtls_10exceptions_10_ErrorBase_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7mbedtls_10exceptions_check_error(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_err); /* proto */ -static PyObject *__pyx_int_neg_22; -static PyObject *__pyx_int_neg_24; -static PyObject *__pyx_int_neg_50; -static PyObject *__pyx_int_neg_20608; -static PyObject *__pyx_int_neg_20736; -static PyObject *__pyx_int_neg_20864; -static PyObject *__pyx_int_neg_20992; -static PyObject *__pyx_int_neg_24704; -static PyObject *__pyx_int_neg_24832; -static PyObject *__pyx_int_neg_24960; -static PyObject *__pyx_int_neg_25088; -static PyObject *__pyx_int_neg_25216; -static PyObject *__pyx_int_neg_25344; -static PyObject *__pyx_tuple_; - -/* "mbedtls/exceptions.pyx":62 - * +static PyObject *__pyx_int_22; +static PyObject *__pyx_int_24; +static PyObject *__pyx_int_42; +static PyObject *__pyx_int_44; +static PyObject *__pyx_int_50; +static PyObject *__pyx_int_60; +static PyObject *__pyx_int_61; +static PyObject *__pyx_int_62; +static PyObject *__pyx_int_63; +static PyObject *__pyx_int_64; +static PyObject *__pyx_int_96; +static PyObject *__pyx_int_98; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_102; +static PyObject *__pyx_int_104; +static PyObject *__pyx_int_106; +static PyObject *__pyx_int_108; +static PyObject *__pyx_int_4224; +static PyObject *__pyx_int_4352; +static PyObject *__pyx_int_4480; +static PyObject *__pyx_int_4608; +static PyObject *__pyx_int_4736; +static PyObject *__pyx_int_4864; +static PyObject *__pyx_int_4992; +static PyObject *__pyx_int_5120; +static PyObject *__pyx_int_5248; +static PyObject *__pyx_int_14592; +static PyObject *__pyx_int_14720; +static PyObject *__pyx_int_14848; +static PyObject *__pyx_int_14976; +static PyObject *__pyx_int_15104; +static PyObject *__pyx_int_15232; +static PyObject *__pyx_int_15360; +static PyObject *__pyx_int_15488; +static PyObject *__pyx_int_15616; +static PyObject *__pyx_int_15744; +static PyObject *__pyx_int_15872; +static PyObject *__pyx_int_16000; +static PyObject *__pyx_int_16128; +static PyObject *__pyx_int_16256; +static PyObject *__pyx_int_16512; +static PyObject *__pyx_int_16640; +static PyObject *__pyx_int_16768; +static PyObject *__pyx_int_16896; +static PyObject *__pyx_int_17024; +static PyObject *__pyx_int_17152; +static PyObject *__pyx_int_17280; +static PyObject *__pyx_int_17408; +static PyObject *__pyx_int_17536; +static PyObject *__pyx_int_19456; +static PyObject *__pyx_int_19584; +static PyObject *__pyx_int_19712; +static PyObject *__pyx_int_19840; +static PyObject *__pyx_int_19968; +static PyObject *__pyx_int_20096; +static PyObject *__pyx_int_20224; +static PyObject *__pyx_int_20352; +static PyObject *__pyx_int_20608; +static PyObject *__pyx_int_20736; +static PyObject *__pyx_int_20864; +static PyObject *__pyx_int_20992; +static PyObject *__pyx_int_24704; +static PyObject *__pyx_int_24832; +static PyObject *__pyx_int_24960; +static PyObject *__pyx_int_25088; +static PyObject *__pyx_int_25216; +static PyObject *__pyx_int_25344; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__7; + +/* "mbedtls/exceptions.pyx":18 + * """Base class for cipher exceptions.""" * - * cpdef check_error(const int err): # <<<<<<<<<<<<<< - * if not err: - * return + * def __init__(self, err=None, msg="", *args): # <<<<<<<<<<<<<< + * super().__init__(*args) + * self.err = err */ -static PyObject *__pyx_pw_7mbedtls_10exceptions_1check_error(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/ -static PyObject *__pyx_f_7mbedtls_10exceptions_check_error(int const __pyx_v_err, CYTHON_UNUSED int __pyx_skip_dispatch) { +/* Python wrapper */ +static PyObject *__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_7mbedtls_10exceptions_10_ErrorBase_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_err = 0; + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_v_args = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 3) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_err,&__pyx_n_s_msg,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)((PyObject *)Py_None)); + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_err); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msg); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + default: + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + case 0: + goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_err = values[1]; + __pyx_v_msg = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("mbedtls.exceptions._ErrorBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_7mbedtls_10exceptions_10_ErrorBase___init__(__pyx_self, __pyx_v_self, __pyx_v_err, __pyx_v_msg, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7mbedtls_10exceptions_10_ErrorBase___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_err, PyObject *__pyx_v_msg, PyObject *__pyx_v_args) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("check_error", 0); + __Pyx_RefNannySetupContext("__init__", 0); - /* "mbedtls/exceptions.pyx":63 + /* "mbedtls/exceptions.pyx":19 * - * cpdef check_error(const int err): - * if not err: # <<<<<<<<<<<<<< - * return - * else: + * def __init__(self, err=None, msg="", *args): + * super().__init__(*args) # <<<<<<<<<<<<<< + * self.err = err + * self.msg = msg */ - __pyx_t_1 = ((!(__pyx_v_err != 0)) != 0); - if (__pyx_t_1) { + __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":64 - * cpdef check_error(const int err): - * if not err: - * return # <<<<<<<<<<<<<< - * else: - * raise { + /* "mbedtls/exceptions.pyx":20 + * def __init__(self, err=None, msg="", *args): + * super().__init__(*args) + * self.err = err # <<<<<<<<<<<<<< + * self.msg = msg + * */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_err, __pyx_v_err) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/exceptions.pyx":63 + /* "mbedtls/exceptions.pyx":21 + * super().__init__(*args) + * self.err = err + * self.msg = msg # <<<<<<<<<<<<<< * - * cpdef check_error(const int err): - * if not err: # <<<<<<<<<<<<<< - * return - * else: + * def __str__(self): */ - } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/exceptions.pyx":66 - * return - * else: - * raise { # <<<<<<<<<<<<<< - * # Blowfish-specific - * -0x0016: InvalidKeyLengthError, + /* "mbedtls/exceptions.pyx":18 + * """Base class for cipher exceptions.""" + * + * def __init__(self, err=None, msg="", *args): # <<<<<<<<<<<<<< + * super().__init__(*args) + * self.err = err */ - /*else*/ { - /* "mbedtls/exceptions.pyx":68 - * raise { - * # Blowfish-specific - * -0x0016: InvalidKeyLengthError, # <<<<<<<<<<<<<< - * -0x0018: InvalidInputLengthError, - * # DES - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidKeyLengthError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_22, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mbedtls.exceptions._ErrorBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "mbedtls/exceptions.pyx":69 - * # Blowfish-specific - * -0x0016: InvalidKeyLengthError, - * -0x0018: InvalidInputLengthError, # <<<<<<<<<<<<<< - * # DES - * -0x0032: InvalidInputLengthError, +/* "mbedtls/exceptions.pyx":23 + * self.msg = msg + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s([0x%04X] %s)" % (self.__class__.__name__, + * self.err, self.msg) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidInputLengthError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_24, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "mbedtls/exceptions.pyx":71 - * -0x0018: InvalidInputLengthError, - * # DES - * -0x0032: InvalidInputLengthError, # <<<<<<<<<<<<<< - * # MD errors - * -0x5080: FeatureUnavailableError, - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidInputLengthError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_50, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_7mbedtls_10exceptions_10_ErrorBase_3__str__ = {"__str__", (PyCFunction)__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_3__str__, METH_O, 0}; +static PyObject *__pyx_pw_7mbedtls_10exceptions_10_ErrorBase_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_7mbedtls_10exceptions_10_ErrorBase_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); - /* "mbedtls/exceptions.pyx":73 - * -0x0032: InvalidInputLengthError, - * # MD errors - * -0x5080: FeatureUnavailableError, # <<<<<<<<<<<<<< - * -0x5100: BadInputDataError, - * -0x5180: AllocFailedError, - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureUnavailableError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_20608, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "mbedtls/exceptions.pyx":74 - * # MD errors - * -0x5080: FeatureUnavailableError, - * -0x5100: BadInputDataError, # <<<<<<<<<<<<<< - * -0x5180: AllocFailedError, - * -0x5200: IOError, - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BadInputDataError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_20736, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +static PyObject *__pyx_pf_7mbedtls_10exceptions_10_ErrorBase_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); - /* "mbedtls/exceptions.pyx":75 - * -0x5080: FeatureUnavailableError, - * -0x5100: BadInputDataError, - * -0x5180: AllocFailedError, # <<<<<<<<<<<<<< - * -0x5200: IOError, - * # Cipher errors + /* "mbedtls/exceptions.pyx":24 + * + * def __str__(self): + * return "%s([0x%04X] %s)" % (self.__class__.__name__, # <<<<<<<<<<<<<< + * self.err, self.msg) + * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AllocFailedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_20864, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":76 - * -0x5100: BadInputDataError, - * -0x5180: AllocFailedError, - * -0x5200: IOError, # <<<<<<<<<<<<<< - * # Cipher errors - * -0x6080: FeatureUnavailableError, + /* "mbedtls/exceptions.pyx":25 + * def __str__(self): + * return "%s([0x%04X] %s)" % (self.__class__.__name__, + * self.err, self.msg) # <<<<<<<<<<<<<< + * + * */ - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_20992, __pyx_builtin_IOError) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_err); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "mbedtls/exceptions.pyx":78 - * -0x5200: IOError, - * # Cipher errors - * -0x6080: FeatureUnavailableError, # <<<<<<<<<<<<<< - * -0x6100: BadInputDataError, - * -0x6180: AllocFailedError, + /* "mbedtls/exceptions.pyx":24 + * + * def __str__(self): + * return "%s([0x%04X] %s)" % (self.__class__.__name__, # <<<<<<<<<<<<<< + * self.err, self.msg) + * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FeatureUnavailableError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_24704, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_0x_04X_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* "mbedtls/exceptions.pyx":79 - * # Cipher errors - * -0x6080: FeatureUnavailableError, - * -0x6100: BadInputDataError, # <<<<<<<<<<<<<< - * -0x6180: AllocFailedError, - * -0x6200: InvalidPaddingError, + /* "mbedtls/exceptions.pyx":23 + * self.msg = msg + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s([0x%04X] %s)" % (self.__class__.__name__, + * self.err, self.msg) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BadInputDataError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_24832, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "mbedtls/exceptions.pyx":80 - * -0x6080: FeatureUnavailableError, - * -0x6100: BadInputDataError, - * -0x6180: AllocFailedError, # <<<<<<<<<<<<<< - * -0x6200: InvalidPaddingError, - * -0x6280: FullBlockExpectedError, - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AllocFailedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_24960, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mbedtls.exceptions._ErrorBase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "mbedtls/exceptions.pyx":81 - * -0x6100: BadInputDataError, - * -0x6180: AllocFailedError, - * -0x6200: InvalidPaddingError, # <<<<<<<<<<<<<< - * -0x6280: FullBlockExpectedError, - * -0x6300: AuthFailedError, +/* "mbedtls/exceptions.pyx":174 + * + * + * cpdef check_error(const int err): # <<<<<<<<<<<<<< + * if err < 0: + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidPaddingError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_25088, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "mbedtls/exceptions.pyx":82 - * -0x6180: AllocFailedError, - * -0x6200: InvalidPaddingError, - * -0x6280: FullBlockExpectedError, # <<<<<<<<<<<<<< - * -0x6300: AuthFailedError, - * }.get(err, _ErrorBase)() - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FullBlockExpectedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_25216, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +static PyObject *__pyx_pw_7mbedtls_10exceptions_1check_error(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/ +static PyObject *__pyx_f_7mbedtls_10exceptions_check_error(int const __pyx_v_err, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_exc = NULL; + PyObject *__pyx_v_msg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_error", 0); - /* "mbedtls/exceptions.pyx":83 - * -0x6200: InvalidPaddingError, - * -0x6280: FullBlockExpectedError, - * -0x6300: AuthFailedError, # <<<<<<<<<<<<<< - * }.get(err, _ErrorBase)() + /* "mbedtls/exceptions.pyx":175 + * + * cpdef check_error(const int err): + * if err < 0: # <<<<<<<<<<<<<< + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) + * raise exc(-err, msg) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_AuthFailedError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_int_neg_25344, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = ((__pyx_v_err < 0) != 0); + if (__pyx_t_1) { - /* "mbedtls/exceptions.pyx":84 - * -0x6280: FullBlockExpectedError, - * -0x6300: AuthFailedError, - * }.get(err, _ErrorBase)() # <<<<<<<<<<<<<< + /* "mbedtls/exceptions.pyx":176 + * cpdef check_error(const int err): + * if err < 0: + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) # <<<<<<<<<<<<<< + * raise exc(-err, msg) */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int((-__pyx_v_err)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_); + __Pyx_GIVEREF(__pyx_kp_s_); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s_); + __pyx_t_5 = 0; __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; } } + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L5_unpacking_done:; + } + __pyx_v_exc = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_msg = __pyx_t_8; + __pyx_t_8 = 0; + + /* "mbedtls/exceptions.pyx":177 + * if err < 0: + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) + * raise exc(-err, msg) # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_err)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_exc); + __pyx_t_4 = __pyx_v_exc; __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_7 = 1; + } + } + __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_8); + __Pyx_INCREF(__pyx_v_msg); + __Pyx_GIVEREF(__pyx_v_msg); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_msg); + __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "mbedtls/exceptions.pyx":175 + * + * cpdef check_error(const int err): + * if err < 0: # <<<<<<<<<<<<<< + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) + * raise exc(-err, msg) + */ } - /* "mbedtls/exceptions.pyx":62 + /* "mbedtls/exceptions.pyx":174 * * * cpdef check_error(const int err): # <<<<<<<<<<<<<< - * if not err: - * return + * if err < 0: + * exc, msg = __lookup.get(-err, (_ErrorBase, "")) */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("mbedtls.exceptions.check_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_exc); + __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -986,7 +1511,7 @@ static PyObject *__pyx_pw_7mbedtls_10exceptions_1check_error(PyObject *__pyx_sel __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("check_error (wrapper)", 0); assert(__pyx_arg_err); { - __pyx_v_err = __Pyx_PyInt_As_int(__pyx_arg_err); if (unlikely((__pyx_v_err == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_err = __Pyx_PyInt_As_int(__pyx_arg_err); if (unlikely((__pyx_v_err == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -1010,7 +1535,7 @@ static PyObject *__pyx_pf_7mbedtls_10exceptions_check_error(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_error", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_7mbedtls_10exceptions_check_error(__pyx_v_err, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7mbedtls_10exceptions_check_error(__pyx_v_err, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1051,52 +1576,131 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_AllocFailedError, __pyx_k_AllocFailedError, sizeof(__pyx_k_AllocFailedError), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, - {&__pyx_n_s_AuthFailedError, __pyx_k_AuthFailedError, sizeof(__pyx_k_AuthFailedError), 0, 0, 1, 1}, - {&__pyx_n_s_BadInputDataError, __pyx_k_BadInputDataError, sizeof(__pyx_k_BadInputDataError), 0, 0, 1, 1}, + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_kp_s_ASN_1_tag_was_of_an_unexpected_v, __pyx_k_ASN_1_tag_was_of_an_unexpected_v, sizeof(__pyx_k_ASN_1_tag_was_of_an_unexpected_v), 0, 0, 1, 0}, + {&__pyx_n_s_Asn1Error, __pyx_k_Asn1Error, sizeof(__pyx_k_Asn1Error), 0, 0, 1, 1}, + {&__pyx_n_s_Base64Error, __pyx_k_Base64Error, sizeof(__pyx_k_Base64Error), 0, 0, 1, 1}, {&__pyx_kp_s_Base_class_for_cipher_exceptions, __pyx_k_Base_class_for_cipher_exceptions, sizeof(__pyx_k_Base_class_for_cipher_exceptions), 0, 0, 1, 0}, + {&__pyx_n_s_CipherError, __pyx_k_CipherError, sizeof(__pyx_k_CipherError), 0, 0, 1, 1}, {&__pyx_kp_s_Copyright_2015_Elaborated_Networ, __pyx_k_Copyright_2015_Elaborated_Networ, sizeof(__pyx_k_Copyright_2015_Elaborated_Networ), 0, 0, 1, 0}, + {&__pyx_n_s_EcError, __pyx_k_EcError, sizeof(__pyx_k_EcError), 0, 0, 1, 1}, + {&__pyx_n_s_EntropyError, __pyx_k_EntropyError, sizeof(__pyx_k_EntropyError), 0, 0, 1, 1}, {&__pyx_n_s_ErrorBase, __pyx_k_ErrorBase, sizeof(__pyx_k_ErrorBase), 0, 0, 1, 1}, - {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, - {&__pyx_kp_s_Exception_raised_when_allocation, __pyx_k_Exception_raised_when_allocation, sizeof(__pyx_k_Exception_raised_when_allocation), 0, 0, 1, 0}, - {&__pyx_n_s_FeatureUnavailableError, __pyx_k_FeatureUnavailableError, sizeof(__pyx_k_FeatureUnavailableError), 0, 0, 1, 1}, - {&__pyx_n_s_FullBlockExpectedError, __pyx_k_FullBlockExpectedError, sizeof(__pyx_k_FullBlockExpectedError), 0, 0, 1, 1}, - {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_ErrorBase___init, __pyx_k_ErrorBase___init, sizeof(__pyx_k_ErrorBase___init), 0, 0, 1, 1}, + {&__pyx_n_s_ErrorBase___str, __pyx_k_ErrorBase___str, sizeof(__pyx_k_ErrorBase___str), 0, 0, 1, 1}, + {&__pyx_kp_s_Errors_defined_in_asn1_h, __pyx_k_Errors_defined_in_asn1_h, sizeof(__pyx_k_Errors_defined_in_asn1_h), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_base64_h, __pyx_k_Errors_defined_in_base64_h, sizeof(__pyx_k_Errors_defined_in_base64_h), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_cipher_mod, __pyx_k_Errors_defined_in_the_cipher_mod, sizeof(__pyx_k_Errors_defined_in_the_cipher_mod), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_ecp_module, __pyx_k_Errors_defined_in_the_ecp_module, sizeof(__pyx_k_Errors_defined_in_the_ecp_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_entropy_mo, __pyx_k_Errors_defined_in_the_entropy_mo, sizeof(__pyx_k_Errors_defined_in_the_entropy_mo), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_md_module, __pyx_k_Errors_defined_in_the_md_module, sizeof(__pyx_k_Errors_defined_in_the_md_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_pem_module, __pyx_k_Errors_defined_in_the_pem_module, sizeof(__pyx_k_Errors_defined_in_the_pem_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_pk_module, __pyx_k_Errors_defined_in_the_pk_module, sizeof(__pyx_k_Errors_defined_in_the_pk_module), 0, 0, 1, 0}, + {&__pyx_kp_s_Errors_defined_in_the_rsa_module, __pyx_k_Errors_defined_in_the_rsa_module, sizeof(__pyx_k_Errors_defined_in_the_rsa_module), 0, 0, 1, 0}, {&__pyx_n_s_InvalidInputLengthError, __pyx_k_InvalidInputLengthError, sizeof(__pyx_k_InvalidInputLengthError), 0, 0, 1, 1}, {&__pyx_n_s_InvalidKeyLengthError, __pyx_k_InvalidKeyLengthError, sizeof(__pyx_k_InvalidKeyLengthError), 0, 0, 1, 1}, - {&__pyx_n_s_InvalidPaddingError, __pyx_k_InvalidPaddingError, sizeof(__pyx_k_InvalidPaddingError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_input_length, __pyx_k_Invalid_input_length, sizeof(__pyx_k_Invalid_input_length), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_key_length, __pyx_k_Invalid_key_length, sizeof(__pyx_k_Invalid_key_length), 0, 0, 1, 0}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, - {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, - {&__pyx_kp_s_Raised_for_bad_input_data, __pyx_k_Raised_for_bad_input_data, sizeof(__pyx_k_Raised_for_bad_input_data), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_for_invalid_input_length, __pyx_k_Raised_for_invalid_input_length, sizeof(__pyx_k_Raised_for_invalid_input_length), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_for_invalid_key_length, __pyx_k_Raised_for_invalid_key_length, sizeof(__pyx_k_Raised_for_invalid_key_length), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_for_invalid_padding, __pyx_k_Raised_for_invalid_padding, sizeof(__pyx_k_Raised_for_invalid_padding), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_upon_trying_to_instantiat, __pyx_k_Raised_upon_trying_to_instantiat, sizeof(__pyx_k_Raised_upon_trying_to_instantiat), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_when_authentication_faile, __pyx_k_Raised_when_authentication_faile, sizeof(__pyx_k_Raised_when_authentication_faile), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_when_calling_a_feature_th, __pyx_k_Raised_when_calling_a_feature_th, sizeof(__pyx_k_Raised_when_calling_a_feature_th), 0, 0, 1, 0}, - {&__pyx_kp_s_Raised_when_encryption_expects_f, __pyx_k_Raised_when_encryption_expects_f, sizeof(__pyx_k_Raised_when_encryption_expects_f), 0, 0, 1, 0}, - {&__pyx_n_s_UnsupportedCipherError, __pyx_k_UnsupportedCipherError, sizeof(__pyx_k_UnsupportedCipherError), 0, 0, 1, 1}, + {&__pyx_n_s_MessageDigestError, __pyx_k_MessageDigestError, sizeof(__pyx_k_MessageDigestError), 0, 0, 1, 1}, + {&__pyx_kp_s_PEM_string_is_not_as_expected, __pyx_k_PEM_string_is_not_as_expected, sizeof(__pyx_k_PEM_string_is_not_as_expected), 0, 0, 1, 0}, + {&__pyx_n_s_PemError, __pyx_k_PemError, sizeof(__pyx_k_PemError), 0, 0, 1, 1}, + {&__pyx_n_s_PkError, __pyx_k_PkError, sizeof(__pyx_k_PkError), 0, 0, 1, 1}, + {&__pyx_kp_s_RSA_IV_is_not_in_hex_format, __pyx_k_RSA_IV_is_not_in_hex_format, sizeof(__pyx_k_RSA_IV_is_not_in_hex_format), 0, 0, 1, 0}, + {&__pyx_n_s_RsaError, __pyx_k_RsaError, sizeof(__pyx_k_RsaError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s_actual_length_differs_from_expec, __pyx_k_actual_length_differs_from_expec, sizeof(__pyx_k_actual_length_differs_from_expec), 0, 0, 1, 0}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_kp_s_authentication_failed_for_AEAD_m, __pyx_k_authentication_failed_for_AEAD_m, sizeof(__pyx_k_authentication_failed_for_AEAD_m), 0, 0, 1, 0}, {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, + {&__pyx_kp_s_bad_input_parameter_to_function, __pyx_k_bad_input_parameter_to_function, sizeof(__pyx_k_bad_input_parameter_to_function), 0, 0, 1, 0}, + {&__pyx_kp_s_bad_input_parameters_to_function, __pyx_k_bad_input_parameters_to_function, sizeof(__pyx_k_bad_input_parameters_to_function), 0, 0, 1, 0}, + {&__pyx_kp_s_buffer_too_small_when_writing_AS, __pyx_k_buffer_too_small_when_writing_AS, sizeof(__pyx_k_buffer_too_small_when_writing_AS), 0, 0, 1, 0}, {&__pyx_n_s_check_error, __pyx_k_check_error, sizeof(__pyx_k_check_error), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1}, + {&__pyx_kp_s_correct_decryption, __pyx_k_correct_decryption, sizeof(__pyx_k_correct_decryption), 0, 0, 1, 0}, + {&__pyx_kp_s_critical_entropy_source_failure, __pyx_k_critical_entropy_source_failure, sizeof(__pyx_k_critical_entropy_source_failure), 0, 0, 1, 0}, + {&__pyx_kp_s_data_is_invalid, __pyx_k_data_is_invalid, sizeof(__pyx_k_data_is_invalid), 0, 0, 1, 0}, + {&__pyx_kp_s_decryption_of_block_requires_a_f, __pyx_k_decryption_of_block_requires_a_f, sizeof(__pyx_k_decryption_of_block_requires_a_f), 0, 0, 1, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_kp_s_elliptic_curve_is_unsupported, __pyx_k_elliptic_curve_is_unsupported, sizeof(__pyx_k_elliptic_curve_is_unsupported), 0, 0, 1, 0}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_kp_s_error_when_trying_to_determine_t, __pyx_k_error_when_trying_to_determine_t, sizeof(__pyx_k_error_when_trying_to_determine_t), 0, 0, 1, 0}, + {&__pyx_kp_s_failed_to_allocate_memory, __pyx_k_failed_to_allocate_memory, sizeof(__pyx_k_failed_to_allocate_memory), 0, 0, 1, 0}, + {&__pyx_kp_s_for_correct_decryption, __pyx_k_for_correct_decryption, sizeof(__pyx_k_for_correct_decryption), 0, 0, 1, 0}, + {&__pyx_kp_s_generation_of_random_value_such, __pyx_k_generation_of_random_value_such, sizeof(__pyx_k_generation_of_random_value_such), 0, 0, 1, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_kp_s_given_private_key_password_does, __pyx_k_given_private_key_password_does, sizeof(__pyx_k_given_private_key_password_does), 0, 0, 1, 0}, + {&__pyx_kp_s_given_private_key_password_does_2, __pyx_k_given_private_key_password_does_2, sizeof(__pyx_k_given_private_key_password_does_2), 0, 0, 1, 0}, + {&__pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_k_home_laurin_src_python_mbedtls, sizeof(__pyx_k_home_laurin_src_python_mbedtls), 0, 0, 1, 0}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_kp_s_input_contains_invalid_padding_a, __pyx_k_input_contains_invalid_padding_a, sizeof(__pyx_k_input_contains_invalid_padding_a), 0, 0, 1, 0}, + {&__pyx_kp_s_input_data_contains_invalid_padd, __pyx_k_input_data_contains_invalid_padd, sizeof(__pyx_k_input_data_contains_invalid_padd), 0, 0, 1, 0}, + {&__pyx_kp_s_invalid_character_in_input, __pyx_k_invalid_character_in_input, sizeof(__pyx_k_invalid_character_in_input), 0, 0, 1, 0}, + {&__pyx_kp_s_invalid_data_input_length, __pyx_k_invalid_data_input_length, sizeof(__pyx_k_invalid_data_input_length), 0, 0, 1, 0}, + {&__pyx_kp_s_invalid_key_length, __pyx_k_invalid_key_length, sizeof(__pyx_k_invalid_key_length), 0, 0, 1, 0}, + {&__pyx_kp_s_invalid_key_tag_or_value, __pyx_k_invalid_key_tag_or_value, sizeof(__pyx_k_invalid_key_tag_or_value), 0, 0, 1, 0}, + {&__pyx_kp_s_invalid_private_or_public_key, __pyx_k_invalid_private_or_public_key, sizeof(__pyx_k_invalid_private_or_public_key), 0, 0, 1, 0}, + {&__pyx_kp_s_is_less_than_expected, __pyx_k_is_less_than_expected, sizeof(__pyx_k_is_less_than_expected), 0, 0, 1, 0}, + {&__pyx_kp_s_key_algorithm_is_unsupported, __pyx_k_key_algorithm_is_unsupported, sizeof(__pyx_k_key_algorithm_is_unsupported), 0, 0, 1, 0}, + {&__pyx_kp_s_key_failed_to_pass_the_library_s, __pyx_k_key_failed_to_pass_the_library_s, sizeof(__pyx_k_key_failed_to_pass_the_library_s), 0, 0, 1, 0}, {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1}, + {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_mbedtls_exceptions, __pyx_k_mbedtls_exceptions, sizeof(__pyx_k_mbedtls_exceptions), 0, 0, 1, 1}, + {&__pyx_kp_s_memory_allocation_failed, __pyx_k_memory_allocation_failed, sizeof(__pyx_k_memory_allocation_failed), 0, 0, 1, 0}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_s_no_PEM_header_or_footer_found, __pyx_k_no_PEM_header_or_footer_found, sizeof(__pyx_k_no_PEM_header_or_footer_found), 0, 0, 1, 0}, + {&__pyx_kp_s_no_more_source_can_be_added, __pyx_k_no_more_source_can_be_added, sizeof(__pyx_k_no_more_source_can_be_added), 0, 0, 1, 0}, + {&__pyx_kp_s_no_sources_have_been_added_to_po, __pyx_k_no_sources_have_been_added_to_po, sizeof(__pyx_k_no_sources_have_been_added_to_po), 0, 0, 1, 0}, + {&__pyx_kp_s_no_strong_source_have_been_added, __pyx_k_no_strong_source_have_been_added, sizeof(__pyx_k_no_strong_source_have_been_added), 0, 0, 1, 0}, + {&__pyx_kp_s_only_NIST_curves_are_supported, __pyx_k_only_NIST_curves_are_supported, sizeof(__pyx_k_only_NIST_curves_are_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_only_RSA_and_EC_are_supported, __pyx_k_only_RSA_and_EC_are_supported, sizeof(__pyx_k_only_RSA_and_EC_are_supported), 0, 0, 1, 0}, + {&__pyx_kp_s_opening_or_reading_of_file_faile, __pyx_k_opening_or_reading_of_file_faile, sizeof(__pyx_k_opening_or_reading_of_file_faile), 0, 0, 1, 0}, + {&__pyx_kp_s_or_invalid_length, __pyx_k_or_invalid_length, sizeof(__pyx_k_or_invalid_length), 0, 0, 1, 0}, + {&__pyx_kp_s_out_of_data_when_parsing_and_ASN, __pyx_k_out_of_data_when_parsing_and_ASN, sizeof(__pyx_k_out_of_data_when_parsing_and_ASN), 0, 0, 1, 0}, + {&__pyx_kp_s_output_buffer_too_small, __pyx_k_output_buffer_too_small, sizeof(__pyx_k_output_buffer_too_small), 0, 0, 1, 0}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_kp_s_private_key_password_can_t_be_em, __pyx_k_private_key_password_can_t_be_em, sizeof(__pyx_k_private_key_password_can_t_be_em), 0, 0, 1, 0}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_kp_s_read_write_error_in_file, __pyx_k_read_write_error_in_file, sizeof(__pyx_k_read_write_error_in_file), 0, 0, 1, 0}, + {&__pyx_kp_s_read_write_of_file_failed, __pyx_k_read_write_of_file_failed, sizeof(__pyx_k_read_write_of_file_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_requested_curve_not_available, __pyx_k_requested_curve_not_available, sizeof(__pyx_k_requested_curve_not_available), 0, 0, 1, 0}, + {&__pyx_kp_s_s_0x_04X_s, __pyx_k_s_0x_04X_s, sizeof(__pyx_k_s_0x_04X_s), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_signature_is_valid_but_shorter_t, __pyx_k_signature_is_valid_but_shorter_t, sizeof(__pyx_k_signature_is_valid_but_shorter_t), 0, 0, 1, 0}, + {&__pyx_kp_s_something_failed_during_generati, __pyx_k_something_failed_during_generati, sizeof(__pyx_k_something_failed_during_generati), 0, 0, 1, 0}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_the_PKCS_1_verification_failed, __pyx_k_the_PKCS_1_verification_failed, sizeof(__pyx_k_the_PKCS_1_verification_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_the_algorithm_tag_or_value_is_in, __pyx_k_the_algorithm_tag_or_value_is_in, sizeof(__pyx_k_the_algorithm_tag_or_value_is_in), 0, 0, 1, 0}, + {&__pyx_kp_s_the_buffer_is_too_small_to_write, __pyx_k_the_buffer_is_too_small_to_write, sizeof(__pyx_k_the_buffer_is_too_small_to_write), 0, 0, 1, 0}, + {&__pyx_kp_s_the_data_input_has_an_invalid_le, __pyx_k_the_data_input_has_an_invalid_le, sizeof(__pyx_k_the_data_input_has_an_invalid_le), 0, 0, 1, 0}, + {&__pyx_kp_s_the_output_buffer_for_decryption, __pyx_k_the_output_buffer_for_decryption, sizeof(__pyx_k_the_output_buffer_for_decryption), 0, 0, 1, 0}, + {&__pyx_kp_s_the_private_key_operation_failed, __pyx_k_the_private_key_operation_failed, sizeof(__pyx_k_the_private_key_operation_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_the_pubkey_tag_or_value_is_inval, __pyx_k_the_pubkey_tag_or_value_is_inval, sizeof(__pyx_k_the_pubkey_tag_or_value_is_inval), 0, 0, 1, 0}, + {&__pyx_kp_s_the_public_key_operation_failed, __pyx_k_the_public_key_operation_failed, sizeof(__pyx_k_the_public_key_operation_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_the_random_generator_failed_to_g, __pyx_k_the_random_generator_failed_to_g, sizeof(__pyx_k_the_random_generator_failed_to_g), 0, 0, 1, 0}, + {&__pyx_kp_s_the_selected_feature_is_not_avai, __pyx_k_the_selected_feature_is_not_avai, sizeof(__pyx_k_the_selected_feature_is_not_avai), 0, 0, 1, 0}, + {&__pyx_kp_s_the_signature_is_not_valid, __pyx_k_the_signature_is_not_valid, sizeof(__pyx_k_the_signature_is_not_valid), 0, 0, 1, 0}, + {&__pyx_kp_s_the_signature_is_valid_but_its_l, __pyx_k_the_signature_is_valid_but_its_l, sizeof(__pyx_k_the_signature_is_valid_but_its_l), 0, 0, 1, 0}, + {&__pyx_kp_s_type_mismatch_eg_attempt_to_encr, __pyx_k_type_mismatch_eg_attempt_to_encr, sizeof(__pyx_k_type_mismatch_eg_attempt_to_encr), 0, 0, 1, 0}, + {&__pyx_kp_s_unavailable_feature_e_g_hashing, __pyx_k_unavailable_feature_e_g_hashing, sizeof(__pyx_k_unavailable_feature_e_g_hashing), 0, 0, 1, 0}, + {&__pyx_kp_s_unavailable_feature_eg_RSA_disab, __pyx_k_unavailable_feature_eg_RSA_disab, sizeof(__pyx_k_unavailable_feature_eg_RSA_disab), 0, 0, 1, 0}, + {&__pyx_kp_s_unsupported_key_encryption_algor, __pyx_k_unsupported_key_encryption_algor, sizeof(__pyx_k_unsupported_key_encryption_algor), 0, 0, 1, 0}, + {&__pyx_kp_s_unsupported_key_version, __pyx_k_unsupported_key_version, sizeof(__pyx_k_unsupported_key_version), 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -1109,13 +1713,40 @@ static int __Pyx_InitCachedConstants(void) { /* "mbedtls/exceptions.pyx":9 * * - * __all__ = ("AllocFailedError", # <<<<<<<<<<<<<< - * "InvalidKeyLengthError", - * "InvalidInputLengthError", + * __all__ = ("CipherError", "InvalidInputLengthError", "InvalidKeyLengthError", # <<<<<<<<<<<<<< + * "EntropyError", "MessageDigestError", "PkError", + * "check_error", + */ + __pyx_tuple__2 = PyTuple_Pack(7, __pyx_n_s_CipherError, __pyx_n_s_InvalidInputLengthError, __pyx_n_s_InvalidKeyLengthError, __pyx_n_s_EntropyError, __pyx_n_s_MessageDigestError, __pyx_n_s_PkError, __pyx_n_s_check_error); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "mbedtls/exceptions.pyx":18 + * """Base class for cipher exceptions.""" + * + * def __init__(self, err=None, msg="", *args): # <<<<<<<<<<<<<< + * super().__init__(*args) + * self.err = err + */ + __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_err, __pyx_n_s_msg, __pyx_n_s_args); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__5 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject*)__pyx_kp_s_)); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "mbedtls/exceptions.pyx":23 + * self.msg = msg + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s([0x%04X] %s)" % (self.__class__.__name__, + * self.err, self.msg) */ - __pyx_tuple_ = PyTuple_Pack(10, __pyx_n_s_AllocFailedError, __pyx_n_s_InvalidKeyLengthError, __pyx_n_s_InvalidInputLengthError, __pyx_n_s_InvalidPaddingError, __pyx_n_s_FeatureUnavailableError, __pyx_n_s_BadInputDataError, __pyx_n_s_FullBlockExpectedError, __pyx_n_s_AuthFailedError, __pyx_n_s_UnsupportedCipherError, __pyx_n_s_check_error); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_str, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -1125,19 +1756,73 @@ static int __Pyx_InitCachedConstants(void) { static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_neg_22 = PyInt_FromLong(-22); if (unlikely(!__pyx_int_neg_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_24 = PyInt_FromLong(-24); if (unlikely(!__pyx_int_neg_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_50 = PyInt_FromLong(-50); if (unlikely(!__pyx_int_neg_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_20608 = PyInt_FromLong(-20608L); if (unlikely(!__pyx_int_neg_20608)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_20736 = PyInt_FromLong(-20736L); if (unlikely(!__pyx_int_neg_20736)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_20864 = PyInt_FromLong(-20864L); if (unlikely(!__pyx_int_neg_20864)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_20992 = PyInt_FromLong(-20992L); if (unlikely(!__pyx_int_neg_20992)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_24704 = PyInt_FromLong(-24704L); if (unlikely(!__pyx_int_neg_24704)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_24832 = PyInt_FromLong(-24832L); if (unlikely(!__pyx_int_neg_24832)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_24960 = PyInt_FromLong(-24960L); if (unlikely(!__pyx_int_neg_24960)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_25088 = PyInt_FromLong(-25088L); if (unlikely(!__pyx_int_neg_25088)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_25216 = PyInt_FromLong(-25216L); if (unlikely(!__pyx_int_neg_25216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_int_neg_25344 = PyInt_FromLong(-25344L); if (unlikely(!__pyx_int_neg_25344)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_44 = PyInt_FromLong(44); if (unlikely(!__pyx_int_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_61 = PyInt_FromLong(61); if (unlikely(!__pyx_int_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_62 = PyInt_FromLong(62); if (unlikely(!__pyx_int_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_98 = PyInt_FromLong(98); if (unlikely(!__pyx_int_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_104 = PyInt_FromLong(104); if (unlikely(!__pyx_int_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_106 = PyInt_FromLong(106); if (unlikely(!__pyx_int_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_108 = PyInt_FromLong(108); if (unlikely(!__pyx_int_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4224 = PyInt_FromLong(4224); if (unlikely(!__pyx_int_4224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4352 = PyInt_FromLong(4352); if (unlikely(!__pyx_int_4352)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4480 = PyInt_FromLong(4480); if (unlikely(!__pyx_int_4480)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4608 = PyInt_FromLong(4608); if (unlikely(!__pyx_int_4608)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4736 = PyInt_FromLong(4736); if (unlikely(!__pyx_int_4736)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4864 = PyInt_FromLong(4864); if (unlikely(!__pyx_int_4864)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_4992 = PyInt_FromLong(4992); if (unlikely(!__pyx_int_4992)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_5120 = PyInt_FromLong(5120); if (unlikely(!__pyx_int_5120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_5248 = PyInt_FromLong(5248); if (unlikely(!__pyx_int_5248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14592 = PyInt_FromLong(14592L); if (unlikely(!__pyx_int_14592)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14720 = PyInt_FromLong(14720L); if (unlikely(!__pyx_int_14720)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14848 = PyInt_FromLong(14848L); if (unlikely(!__pyx_int_14848)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_14976 = PyInt_FromLong(14976L); if (unlikely(!__pyx_int_14976)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15104 = PyInt_FromLong(15104L); if (unlikely(!__pyx_int_15104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15232 = PyInt_FromLong(15232L); if (unlikely(!__pyx_int_15232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15360 = PyInt_FromLong(15360L); if (unlikely(!__pyx_int_15360)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15488 = PyInt_FromLong(15488L); if (unlikely(!__pyx_int_15488)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15616 = PyInt_FromLong(15616L); if (unlikely(!__pyx_int_15616)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15744 = PyInt_FromLong(15744L); if (unlikely(!__pyx_int_15744)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_15872 = PyInt_FromLong(15872L); if (unlikely(!__pyx_int_15872)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16000 = PyInt_FromLong(16000L); if (unlikely(!__pyx_int_16000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16128 = PyInt_FromLong(16128L); if (unlikely(!__pyx_int_16128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16256 = PyInt_FromLong(16256L); if (unlikely(!__pyx_int_16256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16512 = PyInt_FromLong(16512L); if (unlikely(!__pyx_int_16512)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16640 = PyInt_FromLong(16640L); if (unlikely(!__pyx_int_16640)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16768 = PyInt_FromLong(16768L); if (unlikely(!__pyx_int_16768)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_16896 = PyInt_FromLong(16896L); if (unlikely(!__pyx_int_16896)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17024 = PyInt_FromLong(17024L); if (unlikely(!__pyx_int_17024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17152 = PyInt_FromLong(17152L); if (unlikely(!__pyx_int_17152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17280 = PyInt_FromLong(17280L); if (unlikely(!__pyx_int_17280)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17408 = PyInt_FromLong(17408L); if (unlikely(!__pyx_int_17408)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_17536 = PyInt_FromLong(17536L); if (unlikely(!__pyx_int_17536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_19456 = PyInt_FromLong(19456L); if (unlikely(!__pyx_int_19456)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_19584 = PyInt_FromLong(19584L); if (unlikely(!__pyx_int_19584)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_19712 = PyInt_FromLong(19712L); if (unlikely(!__pyx_int_19712)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_19840 = PyInt_FromLong(19840L); if (unlikely(!__pyx_int_19840)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_19968 = PyInt_FromLong(19968L); if (unlikely(!__pyx_int_19968)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20096 = PyInt_FromLong(20096L); if (unlikely(!__pyx_int_20096)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20224 = PyInt_FromLong(20224L); if (unlikely(!__pyx_int_20224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20352 = PyInt_FromLong(20352L); if (unlikely(!__pyx_int_20352)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20608 = PyInt_FromLong(20608L); if (unlikely(!__pyx_int_20608)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20736 = PyInt_FromLong(20736L); if (unlikely(!__pyx_int_20736)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20864 = PyInt_FromLong(20864L); if (unlikely(!__pyx_int_20864)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_20992 = PyInt_FromLong(20992L); if (unlikely(!__pyx_int_20992)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24704 = PyInt_FromLong(24704L); if (unlikely(!__pyx_int_24704)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24832 = PyInt_FromLong(24832L); if (unlikely(!__pyx_int_24832)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_24960 = PyInt_FromLong(24960L); if (unlikely(!__pyx_int_24960)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_25088 = PyInt_FromLong(25088L); if (unlikely(!__pyx_int_25088)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_25216 = PyInt_FromLong(25216L); if (unlikely(!__pyx_int_25216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_25344 = PyInt_FromLong(25344L); if (unlikely(!__pyx_int_25344)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -1155,6 +1840,7 @@ PyMODINIT_FUNC PyInit_exceptions(void) PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -1245,7 +1931,7 @@ PyMODINIT_FUNC PyInit_exceptions(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1253,7 +1939,7 @@ PyMODINIT_FUNC PyInit_exceptions(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1261,287 +1947,1851 @@ PyMODINIT_FUNC PyInit_exceptions(void) /* "mbedtls/exceptions.pyx":6 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/exceptions.pyx":9 * * - * __all__ = ("AllocFailedError", # <<<<<<<<<<<<<< - * "InvalidKeyLengthError", - * "InvalidInputLengthError", + * __all__ = ("CipherError", "InvalidInputLengthError", "InvalidKeyLengthError", # <<<<<<<<<<<<<< + * "EntropyError", "MessageDigestError", "PkError", + * "check_error", */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple_) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/exceptions.pyx":22 + /* "mbedtls/exceptions.pyx":15 * * - * class AllocFailedError(MemoryError): # <<<<<<<<<<<<<< - * """Exception raised when allocation failed.""" + * class _ErrorBase(ValueError): # <<<<<<<<<<<<<< + * """Base class for cipher exceptions.""" * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_builtin_MemoryError); - __Pyx_GIVEREF(__pyx_builtin_MemoryError); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_MemoryError); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(__pyx_builtin_ValueError); + __Pyx_GIVEREF(__pyx_builtin_ValueError); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_ValueError); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_AllocFailedError, __pyx_n_s_AllocFailedError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Exception_raised_when_allocation); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ErrorBase, __pyx_n_s_ErrorBase, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Base_class_for_cipher_exceptions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_AllocFailedError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllocFailedError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":26 + /* "mbedtls/exceptions.pyx":18 + * """Base class for cipher exceptions.""" + * + * def __init__(self, err=None, msg="", *args): # <<<<<<<<<<<<<< + * super().__init__(*args) + * self.err = err + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7mbedtls_10exceptions_10_ErrorBase_1__init__, 0, __pyx_n_s_ErrorBase___init, NULL, __pyx_n_s_mbedtls_exceptions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_5); + PyList_Append(__pyx_t_4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__5); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":23 + * self.msg = msg + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "%s([0x%04X] %s)" % (self.__class__.__name__, + * self.err, self.msg) + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7mbedtls_10exceptions_10_ErrorBase_3__str__, 0, __pyx_n_s_ErrorBase___str, NULL, __pyx_n_s_mbedtls_exceptions, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_str, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":15 * * - * class _ErrorBase(Exception): # <<<<<<<<<<<<<< + * class _ErrorBase(ValueError): # <<<<<<<<<<<<<< * """Base class for cipher exceptions.""" * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_builtin_Exception); - __Pyx_GIVEREF(__pyx_builtin_Exception); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ErrorBase, __pyx_n_s_ErrorBase, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Base_class_for_cipher_exceptions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ErrorBase, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorBase, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ErrorBase, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_4, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorBase, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":30 + /* "mbedtls/exceptions.pyx":28 * * - * class InvalidKeyLengthError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised for invalid key length.""" + * class Asn1Error(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in `asn1.h`.""" * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InvalidKeyLengthError, __pyx_n_s_InvalidKeyLengthError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_for_invalid_key_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Asn1Error, __pyx_n_s_Asn1Error, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_asn1_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InvalidKeyLengthError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidKeyLengthError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Asn1Error, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Asn1Error, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/exceptions.pyx":34 + /* "mbedtls/exceptions.pyx":32 * * - * class InvalidInputLengthError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised for invalid input length.""" + * class Base64Error(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in `base64.h`.""" * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InvalidInputLengthError, __pyx_n_s_InvalidInputLengthError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_for_invalid_input_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Base64Error, __pyx_n_s_Base64Error, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_base64_h); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InvalidInputLengthError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidInputLengthError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Base64Error, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Base64Error, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":38 + /* "mbedtls/exceptions.pyx":36 * * - * class InvalidPaddingError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised for invalid padding.""" + * class CipherError(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in the cipher module.""" * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InvalidPaddingError, __pyx_n_s_InvalidPaddingError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_for_invalid_padding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CipherError, __pyx_n_s_CipherError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_cipher_mod); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InvalidPaddingError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidPaddingError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CipherError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CipherError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/exceptions.pyx":42 + /* "mbedtls/exceptions.pyx":40 * * - * class FeatureUnavailableError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised when calling a feature that is not available.""" + * class InvalidInputLengthError(CipherError): # <<<<<<<<<<<<<< + * """Invalid input length.""" * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FeatureUnavailableError, __pyx_n_s_FeatureUnavailableError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_when_calling_a_feature_th); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InvalidInputLengthError, __pyx_n_s_InvalidInputLengthError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Invalid_input_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FeatureUnavailableError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatureUnavailableError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InvalidInputLengthError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidInputLengthError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":46 + /* "mbedtls/exceptions.pyx":44 * * - * class BadInputDataError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised for bad input data.""" + * class InvalidKeyLengthError(CipherError): # <<<<<<<<<<<<<< + * """Invalid key length.""" * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_BadInputDataError, __pyx_n_s_BadInputDataError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_for_bad_input_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InvalidKeyLengthError, __pyx_n_s_InvalidKeyLengthError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Invalid_key_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BadInputDataError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BadInputDataError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InvalidKeyLengthError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidKeyLengthError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/exceptions.pyx":50 + /* "mbedtls/exceptions.pyx":48 * * - * class FullBlockExpectedError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised when encryption expects full blocks.""" + * class EntropyError(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in the entropy module.""" * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FullBlockExpectedError, __pyx_n_s_FullBlockExpectedError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_when_encryption_expects_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_EntropyError, __pyx_n_s_EntropyError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_entropy_mo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FullBlockExpectedError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FullBlockExpectedError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_EntropyError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EntropyError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":54 + /* "mbedtls/exceptions.pyx":52 * * - * class AuthFailedError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised when authentication failed.""" + * class MessageDigestError(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in the md module.""" * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_AuthFailedError, __pyx_n_s_AuthFailedError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_when_authentication_faile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_MessageDigestError, __pyx_n_s_MessageDigestError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_md_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_AuthFailedError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AuthFailedError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MessageDigestError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MessageDigestError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/exceptions.pyx":58 + /* "mbedtls/exceptions.pyx":56 * * - * class UnsupportedCipherError(_ErrorBase): # <<<<<<<<<<<<<< - * """Raised upon trying to instantiate an unsupported cipher.""" + * class PkError(_ErrorBase): # <<<<<<<<<<<<<< + * """Errors defined in the pk module.""" * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorBase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnsupportedCipherError, __pyx_n_s_UnsupportedCipherError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Raised_upon_trying_to_instantiat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PkError, __pyx_n_s_PkError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_pk_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnsupportedCipherError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnsupportedCipherError, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PkError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PkError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/exceptions.pyx":1 - * """This module defines exceptions and errors.""" # <<<<<<<<<<<<<< + /* "mbedtls/exceptions.pyx":60 + * + * + * class PemError(PkError): # <<<<<<<<<<<<<< + * """Errors defined in the pem module.""" + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PemError, __pyx_n_s_PemError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_pem_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PemError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PemError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/exceptions.pyx":64 + * * + * class RsaError(PkError): # <<<<<<<<<<<<<< + * """Errors defined in the rsa module.""" * */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_RsaError, __pyx_n_s_RsaError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_rsa_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RsaError, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RsaError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":68 + * + * + * class EcError(PkError): # <<<<<<<<<<<<<< + * """Errors defined in the ecp module.""" + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_EcError, __pyx_n_s_EcError, (PyObject *) NULL, __pyx_n_s_mbedtls_exceptions, __pyx_kp_s_Errors_defined_in_the_ecp_module); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EcError, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EcError, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/exceptions.pyx":74 + * __lookup = { + * # Blowfish-specific + * 0x0016: (InvalidKeyLengthError, "invalid key length"), # <<<<<<<<<<<<<< + * 0x0018: (InvalidInputLengthError, "invalid data input length"), + * # Base64 + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidKeyLengthError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_invalid_key_length); + __Pyx_GIVEREF(__pyx_kp_s_invalid_key_length); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_invalid_key_length); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_22, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":75 + * # Blowfish-specific + * 0x0016: (InvalidKeyLengthError, "invalid key length"), + * 0x0018: (InvalidInputLengthError, "invalid data input length"), # <<<<<<<<<<<<<< + * # Base64 + * 0x002a: (Base64Error, "output buffer too small"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidInputLengthError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_invalid_data_input_length); + __Pyx_GIVEREF(__pyx_kp_s_invalid_data_input_length); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_invalid_data_input_length); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_24, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":77 + * 0x0018: (InvalidInputLengthError, "invalid data input length"), + * # Base64 + * 0x002a: (Base64Error, "output buffer too small"), # <<<<<<<<<<<<<< + * 0x002c: (Base64Error, "invalid character in input"), + * # DES + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Base64Error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_output_buffer_too_small); + __Pyx_GIVEREF(__pyx_kp_s_output_buffer_too_small); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_output_buffer_too_small); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_42, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":78 + * # Base64 + * 0x002a: (Base64Error, "output buffer too small"), + * 0x002c: (Base64Error, "invalid character in input"), # <<<<<<<<<<<<<< + * # DES + * 0x0032: (InvalidInputLengthError, "the data input has an invalid length"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Base64Error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_invalid_character_in_input); + __Pyx_GIVEREF(__pyx_kp_s_invalid_character_in_input); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_invalid_character_in_input); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_44, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":80 + * 0x002c: (Base64Error, "invalid character in input"), + * # DES + * 0x0032: (InvalidInputLengthError, "the data input has an invalid length"), # <<<<<<<<<<<<<< + * # Entropy + * 0x003C: (EntropyError, "critical entropy source failure"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InvalidInputLengthError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_the_data_input_has_an_invalid_le); + __Pyx_GIVEREF(__pyx_kp_s_the_data_input_has_an_invalid_le); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_the_data_input_has_an_invalid_le); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_50, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":82 + * 0x0032: (InvalidInputLengthError, "the data input has an invalid length"), + * # Entropy + * 0x003C: (EntropyError, "critical entropy source failure"), # <<<<<<<<<<<<<< + * 0x003D: (EntropyError, "no strong source have been added to poll"), + * 0x003E: (EntropyError, "no more source can be added"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntropyError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_critical_entropy_source_failure); + __Pyx_GIVEREF(__pyx_kp_s_critical_entropy_source_failure); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_critical_entropy_source_failure); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_60, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":83 + * # Entropy + * 0x003C: (EntropyError, "critical entropy source failure"), + * 0x003D: (EntropyError, "no strong source have been added to poll"), # <<<<<<<<<<<<<< + * 0x003E: (EntropyError, "no more source can be added"), + * 0x003F: (EntropyError, "read/write error in file"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntropyError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_no_strong_source_have_been_added); + __Pyx_GIVEREF(__pyx_kp_s_no_strong_source_have_been_added); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_no_strong_source_have_been_added); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_61, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":84 + * 0x003C: (EntropyError, "critical entropy source failure"), + * 0x003D: (EntropyError, "no strong source have been added to poll"), + * 0x003E: (EntropyError, "no more source can be added"), # <<<<<<<<<<<<<< + * 0x003F: (EntropyError, "read/write error in file"), + * 0x0040: (EntropyError, "no sources have been added to poll"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntropyError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_no_more_source_can_be_added); + __Pyx_GIVEREF(__pyx_kp_s_no_more_source_can_be_added); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_no_more_source_can_be_added); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_62, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":85 + * 0x003D: (EntropyError, "no strong source have been added to poll"), + * 0x003E: (EntropyError, "no more source can be added"), + * 0x003F: (EntropyError, "read/write error in file"), # <<<<<<<<<<<<<< + * 0x0040: (EntropyError, "no sources have been added to poll"), + * # ASN1 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntropyError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_read_write_error_in_file); + __Pyx_GIVEREF(__pyx_kp_s_read_write_error_in_file); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_read_write_error_in_file); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_63, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":86 + * 0x003E: (EntropyError, "no more source can be added"), + * 0x003F: (EntropyError, "read/write error in file"), + * 0x0040: (EntropyError, "no sources have been added to poll"), # <<<<<<<<<<<<<< + * # ASN1 + * 0x0060: (Asn1Error, "out of data when parsing and ASN1 data structure"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntropyError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_no_sources_have_been_added_to_po); + __Pyx_GIVEREF(__pyx_kp_s_no_sources_have_been_added_to_po); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_no_sources_have_been_added_to_po); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":88 + * 0x0040: (EntropyError, "no sources have been added to poll"), + * # ASN1 + * 0x0060: (Asn1Error, "out of data when parsing and ASN1 data structure"), # <<<<<<<<<<<<<< + * 0x0062: (Asn1Error, "ASN.1 tag was of an unexpected value"), + * 0x0064: (Asn1Error, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_out_of_data_when_parsing_and_ASN); + __Pyx_GIVEREF(__pyx_kp_s_out_of_data_when_parsing_and_ASN); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_out_of_data_when_parsing_and_ASN); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_96, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":89 + * # ASN1 + * 0x0060: (Asn1Error, "out of data when parsing and ASN1 data structure"), + * 0x0062: (Asn1Error, "ASN.1 tag was of an unexpected value"), # <<<<<<<<<<<<<< + * 0x0064: (Asn1Error, + * "error when trying to determine the length" + + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_ASN_1_tag_was_of_an_unexpected_v); + __Pyx_GIVEREF(__pyx_kp_s_ASN_1_tag_was_of_an_unexpected_v); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_ASN_1_tag_was_of_an_unexpected_v); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_98, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":90 + * 0x0060: (Asn1Error, "out of data when parsing and ASN1 data structure"), + * 0x0062: (Asn1Error, "ASN.1 tag was of an unexpected value"), + * 0x0064: (Asn1Error, # <<<<<<<<<<<<<< + * "error when trying to determine the length" + + * "or invalid length"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "mbedtls/exceptions.pyx":91 + * 0x0062: (Asn1Error, "ASN.1 tag was of an unexpected value"), + * 0x0064: (Asn1Error, + * "error when trying to determine the length" + # <<<<<<<<<<<<<< + * "or invalid length"), + * 0x0066: (Asn1Error, "actual length differs from expected length"), + */ + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_error_when_trying_to_determine_t, __pyx_kp_s_or_invalid_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":90 + * 0x0060: (Asn1Error, "out of data when parsing and ASN1 data structure"), + * 0x0062: (Asn1Error, "ASN.1 tag was of an unexpected value"), + * 0x0064: (Asn1Error, # <<<<<<<<<<<<<< + * "error when trying to determine the length" + + * "or invalid length"), + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_100, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":93 + * "error when trying to determine the length" + + * "or invalid length"), + * 0x0066: (Asn1Error, "actual length differs from expected length"), # <<<<<<<<<<<<<< + * 0x0068: (Asn1Error, "data is invalid"), + * 0x006A: (Asn1Error, "memory allocation failed"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_actual_length_differs_from_expec); + __Pyx_GIVEREF(__pyx_kp_s_actual_length_differs_from_expec); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_actual_length_differs_from_expec); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_102, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":94 + * "or invalid length"), + * 0x0066: (Asn1Error, "actual length differs from expected length"), + * 0x0068: (Asn1Error, "data is invalid"), # <<<<<<<<<<<<<< + * 0x006A: (Asn1Error, "memory allocation failed"), + * 0x006c: (Asn1Error, "buffer too small when writing ASN.1 data structure"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_data_is_invalid); + __Pyx_GIVEREF(__pyx_kp_s_data_is_invalid); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_data_is_invalid); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_104, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":95 + * 0x0066: (Asn1Error, "actual length differs from expected length"), + * 0x0068: (Asn1Error, "data is invalid"), + * 0x006A: (Asn1Error, "memory allocation failed"), # <<<<<<<<<<<<<< + * 0x006c: (Asn1Error, "buffer too small when writing ASN.1 data structure"), + * # PEM errors + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_memory_allocation_failed); + __Pyx_GIVEREF(__pyx_kp_s_memory_allocation_failed); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_memory_allocation_failed); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_106, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":96 + * 0x0068: (Asn1Error, "data is invalid"), + * 0x006A: (Asn1Error, "memory allocation failed"), + * 0x006c: (Asn1Error, "buffer too small when writing ASN.1 data structure"), # <<<<<<<<<<<<<< + * # PEM errors + * 0x1080: (PemError, "no PEM header or footer found"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asn1Error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_buffer_too_small_when_writing_AS); + __Pyx_GIVEREF(__pyx_kp_s_buffer_too_small_when_writing_AS); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_buffer_too_small_when_writing_AS); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_108, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":98 + * 0x006c: (Asn1Error, "buffer too small when writing ASN.1 data structure"), + * # PEM errors + * 0x1080: (PemError, "no PEM header or footer found"), # <<<<<<<<<<<<<< + * 0x1100: (PemError, "PEM string is not as expected"), + * 0x1180: (PemError, "failed to allocate memory"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_no_PEM_header_or_footer_found); + __Pyx_GIVEREF(__pyx_kp_s_no_PEM_header_or_footer_found); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_no_PEM_header_or_footer_found); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4224, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":99 + * # PEM errors + * 0x1080: (PemError, "no PEM header or footer found"), + * 0x1100: (PemError, "PEM string is not as expected"), # <<<<<<<<<<<<<< + * 0x1180: (PemError, "failed to allocate memory"), + * 0x1200: (PemError, "RSA IV is not in hex-format"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_PEM_string_is_not_as_expected); + __Pyx_GIVEREF(__pyx_kp_s_PEM_string_is_not_as_expected); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_PEM_string_is_not_as_expected); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4352, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":100 + * 0x1080: (PemError, "no PEM header or footer found"), + * 0x1100: (PemError, "PEM string is not as expected"), + * 0x1180: (PemError, "failed to allocate memory"), # <<<<<<<<<<<<<< + * 0x1200: (PemError, "RSA IV is not in hex-format"), + * 0x1280: (PemError, "unsupported key encryption algorithm"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_failed_to_allocate_memory); + __Pyx_GIVEREF(__pyx_kp_s_failed_to_allocate_memory); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_failed_to_allocate_memory); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4480, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":101 + * 0x1100: (PemError, "PEM string is not as expected"), + * 0x1180: (PemError, "failed to allocate memory"), + * 0x1200: (PemError, "RSA IV is not in hex-format"), # <<<<<<<<<<<<<< + * 0x1280: (PemError, "unsupported key encryption algorithm"), + * 0x1300: (PemError, "private key password can't be empty"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_RSA_IV_is_not_in_hex_format); + __Pyx_GIVEREF(__pyx_kp_s_RSA_IV_is_not_in_hex_format); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_RSA_IV_is_not_in_hex_format); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4608, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":102 + * 0x1180: (PemError, "failed to allocate memory"), + * 0x1200: (PemError, "RSA IV is not in hex-format"), + * 0x1280: (PemError, "unsupported key encryption algorithm"), # <<<<<<<<<<<<<< + * 0x1300: (PemError, "private key password can't be empty"), + * 0x1380: (PemError, + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_unsupported_key_encryption_algor); + __Pyx_GIVEREF(__pyx_kp_s_unsupported_key_encryption_algor); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_unsupported_key_encryption_algor); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4736, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":103 + * 0x1200: (PemError, "RSA IV is not in hex-format"), + * 0x1280: (PemError, "unsupported key encryption algorithm"), + * 0x1300: (PemError, "private key password can't be empty"), # <<<<<<<<<<<<<< + * 0x1380: (PemError, + * "given private key password does not allow for" + + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_private_key_password_can_t_be_em); + __Pyx_GIVEREF(__pyx_kp_s_private_key_password_can_t_be_em); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_private_key_password_can_t_be_em); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4864, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":104 + * 0x1280: (PemError, "unsupported key encryption algorithm"), + * 0x1300: (PemError, "private key password can't be empty"), + * 0x1380: (PemError, # <<<<<<<<<<<<<< + * "given private key password does not allow for" + + * "correct decryption"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "mbedtls/exceptions.pyx":105 + * 0x1300: (PemError, "private key password can't be empty"), + * 0x1380: (PemError, + * "given private key password does not allow for" + # <<<<<<<<<<<<<< + * "correct decryption"), + * 0x1400: (PemError, + */ + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_given_private_key_password_does, __pyx_kp_s_correct_decryption); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":104 + * 0x1280: (PemError, "unsupported key encryption algorithm"), + * 0x1300: (PemError, "private key password can't be empty"), + * 0x1380: (PemError, # <<<<<<<<<<<<<< + * "given private key password does not allow for" + + * "correct decryption"), + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_4992, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":107 + * "given private key password does not allow for" + + * "correct decryption"), + * 0x1400: (PemError, # <<<<<<<<<<<<<< + * "unavailable feature, e.g. hashing/decryption combination"), + * 0x1480: (PemError, "bad input parameters to function"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_unavailable_feature_e_g_hashing); + __Pyx_GIVEREF(__pyx_kp_s_unavailable_feature_e_g_hashing); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_unavailable_feature_e_g_hashing); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_5120, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":109 + * 0x1400: (PemError, + * "unavailable feature, e.g. hashing/decryption combination"), + * 0x1480: (PemError, "bad input parameters to function"), # <<<<<<<<<<<<<< + * # PK errors + * 0x3f80: (PkError, "memory allocation failed"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PemError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameters_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameters_to_function); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_bad_input_parameters_to_function); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_5248, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "mbedtls/exceptions.pyx":111 + * 0x1480: (PemError, "bad input parameters to function"), + * # PK errors + * 0x3f80: (PkError, "memory allocation failed"), # <<<<<<<<<<<<<< + * 0x3f00: (PkError, + * "type mismatch, eg attempt to encrypt with an ECDSA key"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_memory_allocation_failed); + __Pyx_GIVEREF(__pyx_kp_s_memory_allocation_failed); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_memory_allocation_failed); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16256, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":112 + * # PK errors + * 0x3f80: (PkError, "memory allocation failed"), + * 0x3f00: (PkError, # <<<<<<<<<<<<<< + * "type mismatch, eg attempt to encrypt with an ECDSA key"), + * 0x3e80: (PkError, "bad input parameters to function"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_type_mismatch_eg_attempt_to_encr); + __Pyx_GIVEREF(__pyx_kp_s_type_mismatch_eg_attempt_to_encr); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_type_mismatch_eg_attempt_to_encr); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16128, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":114 + * 0x3f00: (PkError, + * "type mismatch, eg attempt to encrypt with an ECDSA key"), + * 0x3e80: (PkError, "bad input parameters to function"), # <<<<<<<<<<<<<< + * 0x3e00: (PkError, "read/write of file failed"), + * 0x3d80: (PkError, "unsupported key version"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameters_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameters_to_function); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_bad_input_parameters_to_function); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16000, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":115 + * "type mismatch, eg attempt to encrypt with an ECDSA key"), + * 0x3e80: (PkError, "bad input parameters to function"), + * 0x3e00: (PkError, "read/write of file failed"), # <<<<<<<<<<<<<< + * 0x3d80: (PkError, "unsupported key version"), + * 0x3d00: (PkError, "invalid key tag or value"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_read_write_of_file_failed); + __Pyx_GIVEREF(__pyx_kp_s_read_write_of_file_failed); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_read_write_of_file_failed); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15872, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":116 + * 0x3e80: (PkError, "bad input parameters to function"), + * 0x3e00: (PkError, "read/write of file failed"), + * 0x3d80: (PkError, "unsupported key version"), # <<<<<<<<<<<<<< + * 0x3d00: (PkError, "invalid key tag or value"), + * 0x3c80: (PkError, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_unsupported_key_version); + __Pyx_GIVEREF(__pyx_kp_s_unsupported_key_version); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_unsupported_key_version); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15744, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":117 + * 0x3e00: (PkError, "read/write of file failed"), + * 0x3d80: (PkError, "unsupported key version"), + * 0x3d00: (PkError, "invalid key tag or value"), # <<<<<<<<<<<<<< + * 0x3c80: (PkError, + * "key algorithm is unsupported" + + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_invalid_key_tag_or_value); + __Pyx_GIVEREF(__pyx_kp_s_invalid_key_tag_or_value); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_invalid_key_tag_or_value); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15616, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":118 + * 0x3d80: (PkError, "unsupported key version"), + * 0x3d00: (PkError, "invalid key tag or value"), + * 0x3c80: (PkError, # <<<<<<<<<<<<<< + * "key algorithm is unsupported" + + * "(only RSA and EC are supported)"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "mbedtls/exceptions.pyx":119 + * 0x3d00: (PkError, "invalid key tag or value"), + * 0x3c80: (PkError, + * "key algorithm is unsupported" + # <<<<<<<<<<<<<< + * "(only RSA and EC are supported)"), + * 0x3c00: (PkError, "private key password can't be empty"), + */ + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_key_algorithm_is_unsupported, __pyx_kp_s_only_RSA_and_EC_are_supported); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":118 + * 0x3d80: (PkError, "unsupported key version"), + * 0x3d00: (PkError, "invalid key tag or value"), + * 0x3c80: (PkError, # <<<<<<<<<<<<<< + * "key algorithm is unsupported" + + * "(only RSA and EC are supported)"), + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15488, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":121 + * "key algorithm is unsupported" + + * "(only RSA and EC are supported)"), + * 0x3c00: (PkError, "private key password can't be empty"), # <<<<<<<<<<<<<< + * 0x3b80: (PkError, + * "given private key password does not allow" + + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_private_key_password_can_t_be_em); + __Pyx_GIVEREF(__pyx_kp_s_private_key_password_can_t_be_em); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_private_key_password_can_t_be_em); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15360, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":122 + * "(only RSA and EC are supported)"), + * 0x3c00: (PkError, "private key password can't be empty"), + * 0x3b80: (PkError, # <<<<<<<<<<<<<< + * "given private key password does not allow" + + * "for correct decryption"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":123 + * 0x3c00: (PkError, "private key password can't be empty"), + * 0x3b80: (PkError, + * "given private key password does not allow" + # <<<<<<<<<<<<<< + * "for correct decryption"), + * 0x3b00: (PkError, + */ + __pyx_t_5 = PyNumber_Add(__pyx_kp_s_given_private_key_password_does_2, __pyx_kp_s_for_correct_decryption); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "mbedtls/exceptions.pyx":122 + * "(only RSA and EC are supported)"), + * 0x3c00: (PkError, "private key password can't be empty"), + * 0x3b80: (PkError, # <<<<<<<<<<<<<< + * "given private key password does not allow" + + * "for correct decryption"), + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15232, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":125 + * "given private key password does not allow" + + * "for correct decryption"), + * 0x3b00: (PkError, # <<<<<<<<<<<<<< + * "the pubkey tag or value is invalid" + + * "(only RSA and EC are supported)"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "mbedtls/exceptions.pyx":126 + * "for correct decryption"), + * 0x3b00: (PkError, + * "the pubkey tag or value is invalid" + # <<<<<<<<<<<<<< + * "(only RSA and EC are supported)"), + * 0x3a80: (PkError, "the algorithm tag or value is invalid"), + */ + __pyx_t_5 = PyNumber_Add(__pyx_kp_s_the_pubkey_tag_or_value_is_inval, __pyx_kp_s_only_RSA_and_EC_are_supported); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "mbedtls/exceptions.pyx":125 + * "given private key password does not allow" + + * "for correct decryption"), + * 0x3b00: (PkError, # <<<<<<<<<<<<<< + * "the pubkey tag or value is invalid" + + * "(only RSA and EC are supported)"), + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_15104, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":128 + * "the pubkey tag or value is invalid" + + * "(only RSA and EC are supported)"), + * 0x3a80: (PkError, "the algorithm tag or value is invalid"), # <<<<<<<<<<<<<< + * 0x3a00: (PkError, + * "elliptic curve is unsupported" + + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_the_algorithm_tag_or_value_is_in); + __Pyx_GIVEREF(__pyx_kp_s_the_algorithm_tag_or_value_is_in); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_the_algorithm_tag_or_value_is_in); + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_14976, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":129 + * "(only RSA and EC are supported)"), + * 0x3a80: (PkError, "the algorithm tag or value is invalid"), + * 0x3a00: (PkError, # <<<<<<<<<<<<<< + * "elliptic curve is unsupported" + + * "(only NIST curves are supported)"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "mbedtls/exceptions.pyx":130 + * 0x3a80: (PkError, "the algorithm tag or value is invalid"), + * 0x3a00: (PkError, + * "elliptic curve is unsupported" + # <<<<<<<<<<<<<< + * "(only NIST curves are supported)"), + * 0x3980: (PkError, + */ + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_elliptic_curve_is_unsupported, __pyx_kp_s_only_NIST_curves_are_supported); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":129 + * "(only RSA and EC are supported)"), + * 0x3a80: (PkError, "the algorithm tag or value is invalid"), + * 0x3a00: (PkError, # <<<<<<<<<<<<<< + * "elliptic curve is unsupported" + + * "(only NIST curves are supported)"), + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_14848, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":132 + * "elliptic curve is unsupported" + + * "(only NIST curves are supported)"), + * 0x3980: (PkError, # <<<<<<<<<<<<<< + * "unavailable feature, eg RSA disabled for RSA key"), + * 0x3900: (PkError, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_unavailable_feature_eg_RSA_disab); + __Pyx_GIVEREF(__pyx_kp_s_unavailable_feature_eg_RSA_disab); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_unavailable_feature_eg_RSA_disab); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_14720, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mbedtls/exceptions.pyx":134 + * 0x3980: (PkError, + * "unavailable feature, eg RSA disabled for RSA key"), + * 0x3900: (PkError, # <<<<<<<<<<<<<< + * "the signature is valid but its length" + + * "is less than expected"), + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PkError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "mbedtls/exceptions.pyx":135 + * "unavailable feature, eg RSA disabled for RSA key"), + * 0x3900: (PkError, + * "the signature is valid but its length" + # <<<<<<<<<<<<<< + * "is less than expected"), + * # RSA errors + */ + __pyx_t_1 = PyNumber_Add(__pyx_kp_s_the_signature_is_valid_but_its_l, __pyx_kp_s_is_less_than_expected); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "mbedtls/exceptions.pyx":134 + * 0x3980: (PkError, + * "unavailable feature, eg RSA disabled for RSA key"), + * 0x3900: (PkError, # <<<<<<<<<<<<<< + * "the signature is valid but its length" + + * "is less than expected"), + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_14592, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":138 + * "is less than expected"), + * # RSA errors + * 0x4080: (RsaError, "bad input parameters to function"), # <<<<<<<<<<<<<< + * 0x4100: (RsaError, "input data contains invalid padding and is rejected"), + * 0x4180: (RsaError, "something failed during generation of a key"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameters_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameters_to_function); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_bad_input_parameters_to_function); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16512, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":139 + * # RSA errors + * 0x4080: (RsaError, "bad input parameters to function"), + * 0x4100: (RsaError, "input data contains invalid padding and is rejected"), # <<<<<<<<<<<<<< + * 0x4180: (RsaError, "something failed during generation of a key"), + * 0x4200: (RsaError, "key failed to pass the library's validity check"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_input_data_contains_invalid_padd); + __Pyx_GIVEREF(__pyx_kp_s_input_data_contains_invalid_padd); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_input_data_contains_invalid_padd); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16640, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":140 + * 0x4080: (RsaError, "bad input parameters to function"), + * 0x4100: (RsaError, "input data contains invalid padding and is rejected"), + * 0x4180: (RsaError, "something failed during generation of a key"), # <<<<<<<<<<<<<< + * 0x4200: (RsaError, "key failed to pass the library's validity check"), + * 0x4280: (RsaError, "the public key operation failed"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_something_failed_during_generati); + __Pyx_GIVEREF(__pyx_kp_s_something_failed_during_generati); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_something_failed_during_generati); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16768, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":141 + * 0x4100: (RsaError, "input data contains invalid padding and is rejected"), + * 0x4180: (RsaError, "something failed during generation of a key"), + * 0x4200: (RsaError, "key failed to pass the library's validity check"), # <<<<<<<<<<<<<< + * 0x4280: (RsaError, "the public key operation failed"), + * 0x4300: (RsaError, "the private key operation failed"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_key_failed_to_pass_the_library_s); + __Pyx_GIVEREF(__pyx_kp_s_key_failed_to_pass_the_library_s); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_key_failed_to_pass_the_library_s); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_16896, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":142 + * 0x4180: (RsaError, "something failed during generation of a key"), + * 0x4200: (RsaError, "key failed to pass the library's validity check"), + * 0x4280: (RsaError, "the public key operation failed"), # <<<<<<<<<<<<<< + * 0x4300: (RsaError, "the private key operation failed"), + * 0x4380: (RsaError, "the PKCS#1 verification failed"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_the_public_key_operation_failed); + __Pyx_GIVEREF(__pyx_kp_s_the_public_key_operation_failed); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_the_public_key_operation_failed); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_17024, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":143 + * 0x4200: (RsaError, "key failed to pass the library's validity check"), + * 0x4280: (RsaError, "the public key operation failed"), + * 0x4300: (RsaError, "the private key operation failed"), # <<<<<<<<<<<<<< + * 0x4380: (RsaError, "the PKCS#1 verification failed"), + * 0x4400: (RsaError, + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_the_private_key_operation_failed); + __Pyx_GIVEREF(__pyx_kp_s_the_private_key_operation_failed); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_the_private_key_operation_failed); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_17152, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":144 + * 0x4280: (RsaError, "the public key operation failed"), + * 0x4300: (RsaError, "the private key operation failed"), + * 0x4380: (RsaError, "the PKCS#1 verification failed"), # <<<<<<<<<<<<<< + * 0x4400: (RsaError, + * "the output buffer for decryption is not large enough"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_the_PKCS_1_verification_failed); + __Pyx_GIVEREF(__pyx_kp_s_the_PKCS_1_verification_failed); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_the_PKCS_1_verification_failed); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_17280, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":145 + * 0x4300: (RsaError, "the private key operation failed"), + * 0x4380: (RsaError, "the PKCS#1 verification failed"), + * 0x4400: (RsaError, # <<<<<<<<<<<<<< + * "the output buffer for decryption is not large enough"), + * 0x4480: (RsaError, "the random generator failed to generate non-zeros"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_the_output_buffer_for_decryption); + __Pyx_GIVEREF(__pyx_kp_s_the_output_buffer_for_decryption); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_the_output_buffer_for_decryption); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_17408, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":147 + * 0x4400: (RsaError, + * "the output buffer for decryption is not large enough"), + * 0x4480: (RsaError, "the random generator failed to generate non-zeros"), # <<<<<<<<<<<<<< + * # ECP errors + * 0x4f80: (EcError, "bad input parameters to function"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_RsaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_the_random_generator_failed_to_g); + __Pyx_GIVEREF(__pyx_kp_s_the_random_generator_failed_to_g); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_the_random_generator_failed_to_g); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_17536, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":149 + * 0x4480: (RsaError, "the random generator failed to generate non-zeros"), + * # ECP errors + * 0x4f80: (EcError, "bad input parameters to function"), # <<<<<<<<<<<<<< + * 0x4f00: (EcError, "the buffer is too small to write to"), + * 0x4e80: (EcError, "requested curve not available"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameters_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameters_to_function); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_bad_input_parameters_to_function); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20352, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":150 + * # ECP errors + * 0x4f80: (EcError, "bad input parameters to function"), + * 0x4f00: (EcError, "the buffer is too small to write to"), # <<<<<<<<<<<<<< + * 0x4e80: (EcError, "requested curve not available"), + * 0x4e00: (EcError, "the signature is not valid"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_the_buffer_is_too_small_to_write); + __Pyx_GIVEREF(__pyx_kp_s_the_buffer_is_too_small_to_write); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_the_buffer_is_too_small_to_write); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20224, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":151 + * 0x4f80: (EcError, "bad input parameters to function"), + * 0x4f00: (EcError, "the buffer is too small to write to"), + * 0x4e80: (EcError, "requested curve not available"), # <<<<<<<<<<<<<< + * 0x4e00: (EcError, "the signature is not valid"), + * 0x4d80: (EcError, "memory allocation failed"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_requested_curve_not_available); + __Pyx_GIVEREF(__pyx_kp_s_requested_curve_not_available); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_requested_curve_not_available); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20096, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":152 + * 0x4f00: (EcError, "the buffer is too small to write to"), + * 0x4e80: (EcError, "requested curve not available"), + * 0x4e00: (EcError, "the signature is not valid"), # <<<<<<<<<<<<<< + * 0x4d80: (EcError, "memory allocation failed"), + * 0x4d00: (EcError, + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_the_signature_is_not_valid); + __Pyx_GIVEREF(__pyx_kp_s_the_signature_is_not_valid); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_the_signature_is_not_valid); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_19968, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":153 + * 0x4e80: (EcError, "requested curve not available"), + * 0x4e00: (EcError, "the signature is not valid"), + * 0x4d80: (EcError, "memory allocation failed"), # <<<<<<<<<<<<<< + * 0x4d00: (EcError, + * "generation of random value, such as (ephemeral) key, failed"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_memory_allocation_failed); + __Pyx_GIVEREF(__pyx_kp_s_memory_allocation_failed); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_memory_allocation_failed); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_19840, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":154 + * 0x4e00: (EcError, "the signature is not valid"), + * 0x4d80: (EcError, "memory allocation failed"), + * 0x4d00: (EcError, # <<<<<<<<<<<<<< + * "generation of random value, such as (ephemeral) key, failed"), + * 0x4c80: (EcError, "invalid private or public key"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_generation_of_random_value_such); + __Pyx_GIVEREF(__pyx_kp_s_generation_of_random_value_such); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_generation_of_random_value_such); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_19712, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":156 + * 0x4d00: (EcError, + * "generation of random value, such as (ephemeral) key, failed"), + * 0x4c80: (EcError, "invalid private or public key"), # <<<<<<<<<<<<<< + * 0x4c00: (EcError, + * "signature is valid but shorter than the user-specified length"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_invalid_private_or_public_key); + __Pyx_GIVEREF(__pyx_kp_s_invalid_private_or_public_key); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_invalid_private_or_public_key); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_19584, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":157 + * "generation of random value, such as (ephemeral) key, failed"), + * 0x4c80: (EcError, "invalid private or public key"), + * 0x4c00: (EcError, # <<<<<<<<<<<<<< + * "signature is valid but shorter than the user-specified length"), + * # MD errors + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EcError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_signature_is_valid_but_shorter_t); + __Pyx_GIVEREF(__pyx_kp_s_signature_is_valid_but_shorter_t); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_signature_is_valid_but_shorter_t); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_19456, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":160 + * "signature is valid but shorter than the user-specified length"), + * # MD errors + * 0x5080: (MessageDigestError, "the selected feature is not available"), # <<<<<<<<<<<<<< + * 0x5100: (MessageDigestError, "bad input parameter to function"), + * 0x5180: (MessageDigestError, "failed to allocate memory"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MessageDigestError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_the_selected_feature_is_not_avai); + __Pyx_GIVEREF(__pyx_kp_s_the_selected_feature_is_not_avai); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_the_selected_feature_is_not_avai); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20608, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":161 + * # MD errors + * 0x5080: (MessageDigestError, "the selected feature is not available"), + * 0x5100: (MessageDigestError, "bad input parameter to function"), # <<<<<<<<<<<<<< + * 0x5180: (MessageDigestError, "failed to allocate memory"), + * 0x5200: (MessageDigestError, "opening or reading of file failed"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_MessageDigestError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameter_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameter_to_function); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_bad_input_parameter_to_function); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20736, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":162 + * 0x5080: (MessageDigestError, "the selected feature is not available"), + * 0x5100: (MessageDigestError, "bad input parameter to function"), + * 0x5180: (MessageDigestError, "failed to allocate memory"), # <<<<<<<<<<<<<< + * 0x5200: (MessageDigestError, "opening or reading of file failed"), + * # Cipher errors + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MessageDigestError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_failed_to_allocate_memory); + __Pyx_GIVEREF(__pyx_kp_s_failed_to_allocate_memory); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_failed_to_allocate_memory); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20864, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":163 + * 0x5100: (MessageDigestError, "bad input parameter to function"), + * 0x5180: (MessageDigestError, "failed to allocate memory"), + * 0x5200: (MessageDigestError, "opening or reading of file failed"), # <<<<<<<<<<<<<< + * # Cipher errors + * 0x6080: (CipherError, "the selected feature is not available"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_MessageDigestError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_opening_or_reading_of_file_faile); + __Pyx_GIVEREF(__pyx_kp_s_opening_or_reading_of_file_faile); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_opening_or_reading_of_file_faile); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_20992, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":165 + * 0x5200: (MessageDigestError, "opening or reading of file failed"), + * # Cipher errors + * 0x6080: (CipherError, "the selected feature is not available"), # <<<<<<<<<<<<<< + * 0x6100: (CipherError, "bad input parameter to function"), + * 0x6180: (CipherError, "failed to allocate memory"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_the_selected_feature_is_not_avai); + __Pyx_GIVEREF(__pyx_kp_s_the_selected_feature_is_not_avai); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_the_selected_feature_is_not_avai); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_24704, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":166 + * # Cipher errors + * 0x6080: (CipherError, "the selected feature is not available"), + * 0x6100: (CipherError, "bad input parameter to function"), # <<<<<<<<<<<<<< + * 0x6180: (CipherError, "failed to allocate memory"), + * 0x6200: (CipherError, "input contains invalid padding and is rejected"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_bad_input_parameter_to_function); + __Pyx_GIVEREF(__pyx_kp_s_bad_input_parameter_to_function); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_bad_input_parameter_to_function); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_24832, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":167 + * 0x6080: (CipherError, "the selected feature is not available"), + * 0x6100: (CipherError, "bad input parameter to function"), + * 0x6180: (CipherError, "failed to allocate memory"), # <<<<<<<<<<<<<< + * 0x6200: (CipherError, "input contains invalid padding and is rejected"), + * 0x6280: (CipherError, "decryption of block requires a full block"), + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_failed_to_allocate_memory); + __Pyx_GIVEREF(__pyx_kp_s_failed_to_allocate_memory); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_failed_to_allocate_memory); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_24960, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":168 + * 0x6100: (CipherError, "bad input parameter to function"), + * 0x6180: (CipherError, "failed to allocate memory"), + * 0x6200: (CipherError, "input contains invalid padding and is rejected"), # <<<<<<<<<<<<<< + * 0x6280: (CipherError, "decryption of block requires a full block"), + * 0x6300: (CipherError, "authentication failed (for AEAD modes)"), + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_input_contains_invalid_padding_a); + __Pyx_GIVEREF(__pyx_kp_s_input_contains_invalid_padding_a); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_input_contains_invalid_padding_a); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_25088, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mbedtls/exceptions.pyx":169 + * 0x6180: (CipherError, "failed to allocate memory"), + * 0x6200: (CipherError, "input contains invalid padding and is rejected"), + * 0x6280: (CipherError, "decryption of block requires a full block"), # <<<<<<<<<<<<<< + * 0x6300: (CipherError, "authentication failed (for AEAD modes)"), + * } + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_kp_s_decryption_of_block_requires_a_f); + __Pyx_GIVEREF(__pyx_kp_s_decryption_of_block_requires_a_f); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_s_decryption_of_block_requires_a_f); + __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_25216, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "mbedtls/exceptions.pyx":170 + * 0x6200: (CipherError, "input contains invalid padding and is rejected"), + * 0x6280: (CipherError, "decryption of block requires a full block"), + * 0x6300: (CipherError, "authentication failed (for AEAD modes)"), # <<<<<<<<<<<<<< + * } + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_CipherError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_authentication_failed_for_AEAD_m); + __Pyx_GIVEREF(__pyx_kp_s_authentication_failed_for_AEAD_m); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_authentication_failed_for_AEAD_m); + __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_int_25344, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mbedtls/exceptions.pyx":1 + * """This module defines exceptions and errors.""" # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*--- Wrapped vars code ---*/ goto __pyx_L0; @@ -1550,6 +3800,7 @@ PyMODINIT_FUNC PyInit_exceptions(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init mbedtls.exceptions", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -1597,48 +3848,143 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { - PyObject* value; -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - value = default_value; - } - Py_INCREF(value); -#else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - value = default_value; +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; } - Py_INCREF(value); - } else { - if (default_value == Py_None) - default_value = NULL; - value = PyObject_CallMethodObjArgs( - d, __pyx_n_s_get, key, default_value, NULL); } -#endif - return value; + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; } -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); + num_expected = num_max; + more_or_less = "at most"; } - return result; + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } #if CYTHON_COMPILING_IN_CPYTHON @@ -1660,73 +4006,78 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); } return result; } -#endif -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); } -#endif +static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; #else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; } } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} + return 0; #endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON @@ -1957,6 +4308,610 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return (PyObject*) metaclass; } +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_COMPILING_IN_CPYTHON + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + PyObject *self = f->m_self; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0 = PySequence_ITEM(arg, 0); + if (unlikely(!arg0)) return NULL; + result = (*meth)(self, arg0); + Py_DECREF(arg0); + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_Call, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; @@ -2182,6 +5137,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, Py_XDECREF(py_frame); } +static CYTHON_INLINE int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { + Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); + for (i = 0; i < count; i++) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) +#if CYTHON_COMPILING_IN_CPYTHON + PyList_GET_ITEM(cyfunctions, i); +#else + PySequence_ITEM(cyfunctions, i); + if (unlikely(!m)) + return -1; +#endif + Py_INCREF(classobj); + m->func_classobj = classobj; +#if !CYTHON_COMPILING_IN_CPYTHON + Py_DECREF((PyObject*)m); +#endif + } + return 0; +} + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ diff --git a/mbedtls/hash.c b/mbedtls/hash.c index 496b4a8a..69396119 100644 --- a/mbedtls/hash.c +++ b/mbedtls/hash.c @@ -715,10 +715,10 @@ static char __pyx_k_license[] = "__license__"; static char __pyx_k_copyright[] = "__copyright__"; static char __pyx_k_ripemd160[] = "ripemd160"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_check_error[] = "check_error"; static char __pyx_k_mbedtls_hash[] = "mbedtls.hash"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_algorithms_available[] = "algorithms_available"; static char __pyx_k_algorithms_guaranteed[] = "algorithms_guaranteed"; @@ -726,8 +726,8 @@ static char __pyx_k_home_laurin_src_python_mbedtls[] = "/home/laurin/src/python- static char __pyx_k_Copyright_2015_Elaborated_Networ[] = "Copyright 2015, Elaborated Networks GmbH"; static char __pyx_k_Generic_message_digest_wrapper_h[] = "Generic message digest wrapper (hash algorithm)."; static PyObject *__pyx_n_s_; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Copyright_2015_Elaborated_Networ; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; static PyObject *__pyx_n_s_algorithms_available; static PyObject *__pyx_n_s_algorithms_guaranteed; @@ -2867,8 +2867,8 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2015_Elaborated_Networ, __pyx_k_Copyright_2015_Elaborated_Networ, sizeof(__pyx_k_Copyright_2015_Elaborated_Networ), 0, 0, 1, 0}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, {&__pyx_n_s_algorithms_available, __pyx_k_algorithms_available, sizeof(__pyx_k_algorithms_available), 0, 0, 1, 1}, {&__pyx_n_s_algorithms_guaranteed, __pyx_k_algorithms_guaranteed, sizeof(__pyx_k_algorithms_guaranteed), 0, 0, 1, 1}, @@ -3159,7 +3159,7 @@ PyMODINIT_FUNC PyInit_hash(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3167,7 +3167,7 @@ PyMODINIT_FUNC PyInit_hash(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3175,11 +3175,11 @@ PyMODINIT_FUNC PyInit_hash(void) /* "mbedtls/hash.pyx":5 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/hash.pyx":10 * from libc.stdlib cimport malloc, free diff --git a/mbedtls/hmac.c b/mbedtls/hmac.c index da1dc44e..4410ccd9 100644 --- a/mbedtls/hmac.c +++ b/mbedtls/hmac.c @@ -1203,7 +1203,6 @@ static char __pyx_k_md4[] = "md4"; static char __pyx_k_md5[] = "md5"; static char __pyx_k_new[] = "new"; static char __pyx_k_obj[] = "obj"; -static char __pyx_k_Hash[] = "Hash"; static char __pyx_k_base[] = "base"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_init[] = "__init__"; @@ -1250,6 +1249,7 @@ static char __pyx_k_ripemd160[] = "ripemd160"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static char __pyx_k_MIT_License[] = "MIT License"; static char __pyx_k_MemoryError[] = "MemoryError"; static char __pyx_k_check_error[] = "check_error"; static char __pyx_k_mbedtls_hmac[] = "mbedtls.hmac"; @@ -1257,7 +1257,6 @@ static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; static char __pyx_k_Mathias_Laurin[] = "Mathias Laurin"; static char __pyx_k_allocate_buffer[] = "allocate_buffer"; static char __pyx_k_dtype_is_object[] = "dtype_is_object"; -static char __pyx_k_Apache_License_2_0[] = "Apache License 2.0"; static char __pyx_k_mbedtls_exceptions[] = "mbedtls.exceptions"; static char __pyx_k_strided_and_direct[] = ""; static char __pyx_k_NotImplementedError[] = "NotImplementedError"; @@ -1292,18 +1291,17 @@ static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; static PyObject *__pyx_n_s_ASCII; -static PyObject *__pyx_kp_s_Apache_License_2_0; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_kp_s_Copyright_2015_Elaborated_Networ; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; -static PyObject *__pyx_n_s_Hash; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_kp_s_MIT_License; static PyObject *__pyx_kp_s_Mathias_Laurin; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; @@ -1476,7 +1474,7 @@ static PyObject *__pyx_codeobj__30; static PyObject *__pyx_codeobj__32; static PyObject *__pyx_codeobj__34; -/* "mbedtls/hmac.pyx":36 +/* "mbedtls/hmac.pyx":40 * * """ * def __init__(self, key, name, buffer=None): # <<<<<<<<<<<<<< @@ -1518,7 +1516,7 @@ static int __pyx_pw_7mbedtls_4hmac_4Hmac_1__init__(PyObject *__pyx_v_self, PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -1527,7 +1525,7 @@ static int __pyx_pw_7mbedtls_4hmac_4Hmac_1__init__(PyObject *__pyx_v_self, PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1544,7 +1542,7 @@ static int __pyx_pw_7mbedtls_4hmac_4Hmac_1__init__(PyObject *__pyx_v_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.Hmac.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1575,14 +1573,14 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "mbedtls/hmac.pyx":37 + /* "mbedtls/hmac.pyx":41 * """ * def __init__(self, key, name, buffer=None): * super().__init__(name, buffer, 1) # <<<<<<<<<<<<<< * cdef unsigned char[:] c_key = bytearray(key) * check_error(_md.mbedtls_md_hmac_starts( */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac)); @@ -1590,10 +1588,10 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -1608,7 +1606,7 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma __pyx_t_4 = 1; } } - __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -1622,45 +1620,45 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_int_1); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "mbedtls/hmac.pyx":38 + /* "mbedtls/hmac.pyx":42 * def __init__(self, key, name, buffer=None): * super().__init__(name, buffer, 1) * cdef unsigned char[:] c_key = bytearray(key) # <<<<<<<<<<<<<< * check_error(_md.mbedtls_md_hmac_starts( * &self._ctx, &c_key[0], c_key.shape[0])) */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_2); - if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_c_key = __pyx_t_6; __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; - /* "mbedtls/hmac.pyx":39 + /* "mbedtls/hmac.pyx":43 * super().__init__(name, buffer, 1) * cdef unsigned char[:] c_key = bytearray(key) * check_error(_md.mbedtls_md_hmac_starts( # <<<<<<<<<<<<<< * &self._ctx, &c_key[0], c_key.shape[0])) * self.update(buffer) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "mbedtls/hmac.pyx":40 + /* "mbedtls/hmac.pyx":44 * cdef unsigned char[:] c_key = bytearray(key) * check_error(_md.mbedtls_md_hmac_starts( * &self._ctx, &c_key[0], c_key.shape[0])) # <<<<<<<<<<<<<< @@ -1675,17 +1673,17 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma } else if (unlikely(__pyx_t_7 >= __pyx_v_c_key.shape[0])) __pyx_t_8 = 0; if (unlikely(__pyx_t_8 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_8); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "mbedtls/hmac.pyx":39 + /* "mbedtls/hmac.pyx":43 * super().__init__(name, buffer, 1) * cdef unsigned char[:] c_key = bytearray(key) * check_error(_md.mbedtls_md_hmac_starts( # <<<<<<<<<<<<<< * &self._ctx, &c_key[0], c_key.shape[0])) * self.update(buffer) */ - __pyx_t_5 = __Pyx_PyInt_From_int(mbedtls_md_hmac_starts((&__pyx_v_self->__pyx_base._ctx), (&(*((unsigned char *) ( /* dim=0 */ (__pyx_v_c_key.data + __pyx_t_7 * __pyx_v_c_key.strides[0]) )))), (__pyx_v_c_key.shape[0]))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(mbedtls_md_hmac_starts((&__pyx_v_self->__pyx_base._ctx), (&(*((unsigned char *) ( /* dim=0 */ (__pyx_v_c_key.data + __pyx_t_7 * __pyx_v_c_key.strides[0]) )))), (__pyx_v_c_key.shape[0]))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -1698,35 +1696,35 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma } } if (!__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":41 + /* "mbedtls/hmac.pyx":45 * check_error(_md.mbedtls_md_hmac_starts( * &self._ctx, &c_key[0], c_key.shape[0])) * self.update(buffer) # <<<<<<<<<<<<<< * * cdef _update(self, const unsigned char *input, size_t ilen): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_7mbedtls_4hmac_Hmac *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.update(((struct __pyx_obj_7mbedtls_3_md_MDBase *)__pyx_v_self), __pyx_v_buffer, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_7mbedtls_4hmac_Hmac *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.update(((struct __pyx_obj_7mbedtls_3_md_MDBase *)__pyx_v_self), __pyx_v_buffer, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":36 + /* "mbedtls/hmac.pyx":40 * * """ * def __init__(self, key, name, buffer=None): # <<<<<<<<<<<<<< @@ -1752,7 +1750,7 @@ static int __pyx_pf_7mbedtls_4hmac_4Hmac___init__(struct __pyx_obj_7mbedtls_4hma return __pyx_r; } -/* "mbedtls/hmac.pyx":43 +/* "mbedtls/hmac.pyx":47 * self.update(buffer) * * cdef _update(self, const unsigned char *input, size_t ilen): # <<<<<<<<<<<<<< @@ -1769,7 +1767,7 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac__update(struct __pyx_obj_7mbedtls_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_update", 0); - /* "mbedtls/hmac.pyx":45 + /* "mbedtls/hmac.pyx":49 * cdef _update(self, const unsigned char *input, size_t ilen): * """Update the HMAC object with `buffer`.""" * return _md.mbedtls_md_hmac_update(&self._ctx, input, ilen) # <<<<<<<<<<<<<< @@ -1777,13 +1775,13 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac__update(struct __pyx_obj_7mbedtls_ * cdef _finish(self, unsigned char *output): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(mbedtls_md_hmac_update((&__pyx_v_self->__pyx_base._ctx), __pyx_v_input, __pyx_v_ilen)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(mbedtls_md_hmac_update((&__pyx_v_self->__pyx_base._ctx), __pyx_v_input, __pyx_v_ilen)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":43 + /* "mbedtls/hmac.pyx":47 * self.update(buffer) * * cdef _update(self, const unsigned char *input, size_t ilen): # <<<<<<<<<<<<<< @@ -1802,48 +1800,92 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac__update(struct __pyx_obj_7mbedtls_ return __pyx_r; } -/* "mbedtls/hmac.pyx":47 +/* "mbedtls/hmac.pyx":51 * return _md.mbedtls_md_hmac_update(&self._ctx, input, ilen) * * cdef _finish(self, unsigned char *output): # <<<<<<<<<<<<<< * """Return the HMAC of key and message.""" - * return _md.mbedtls_md_hmac_finish(&self._ctx, output) + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) */ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac__finish(struct __pyx_obj_7mbedtls_4hmac_Hmac *__pyx_v_self, unsigned char *__pyx_v_output) { + int __pyx_v_ret; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_finish", 0); - /* "mbedtls/hmac.pyx":49 + /* "mbedtls/hmac.pyx":53 * cdef _finish(self, unsigned char *output): * """Return the HMAC of key and message.""" - * return _md.mbedtls_md_hmac_finish(&self._ctx, output) # <<<<<<<<<<<<<< + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) # <<<<<<<<<<<<<< + * if ret != 0: + * return ret + */ + __pyx_v_ret = mbedtls_md_hmac_finish((&__pyx_v_self->__pyx_base._ctx), __pyx_v_output); + + /* "mbedtls/hmac.pyx":54 + * """Return the HMAC of key and message.""" + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) + * if ret != 0: # <<<<<<<<<<<<<< + * return ret + * return _md.mbedtls_md_hmac_reset(&self._ctx) + */ + __pyx_t_1 = ((__pyx_v_ret != 0) != 0); + if (__pyx_t_1) { + + /* "mbedtls/hmac.pyx":55 + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) + * if ret != 0: + * return ret # <<<<<<<<<<<<<< + * return _md.mbedtls_md_hmac_reset(&self._ctx) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mbedtls/hmac.pyx":54 + * """Return the HMAC of key and message.""" + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) + * if ret != 0: # <<<<<<<<<<<<<< + * return ret + * return _md.mbedtls_md_hmac_reset(&self._ctx) + */ + } + + /* "mbedtls/hmac.pyx":56 + * if ret != 0: + * return ret + * return _md.mbedtls_md_hmac_reset(&self._ctx) # <<<<<<<<<<<<<< * * cpdef copy(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(mbedtls_md_hmac_finish((&__pyx_v_self->__pyx_base._ctx), __pyx_v_output)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(mbedtls_md_hmac_reset((&__pyx_v_self->__pyx_base._ctx))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":47 + /* "mbedtls/hmac.pyx":51 * return _md.mbedtls_md_hmac_update(&self._ctx, input, ilen) * * cdef _finish(self, unsigned char *output): # <<<<<<<<<<<<<< * """Return the HMAC of key and message.""" - * return _md.mbedtls_md_hmac_finish(&self._ctx, output) + * ret = _md.mbedtls_md_hmac_finish(&self._ctx, output) */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("mbedtls.hmac.Hmac._finish", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -1852,8 +1894,8 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac__finish(struct __pyx_obj_7mbedtls_ return __pyx_r; } -/* "mbedtls/hmac.pyx":51 - * return _md.mbedtls_md_hmac_finish(&self._ctx, output) +/* "mbedtls/hmac.pyx":58 + * return _md.mbedtls_md_hmac_reset(&self._ctx) * * cpdef copy(self): # <<<<<<<<<<<<<< * """Return a copy ("clone") of the HMAC object. @@ -1876,7 +1918,7 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac_copy(CYTHON_UNUSED struct __pyx_ob if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7mbedtls_4hmac_4Hmac_3copy)) { __Pyx_XDECREF(__pyx_r); @@ -1892,10 +1934,10 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac_copy(CYTHON_UNUSED struct __pyx_ob } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1907,7 +1949,7 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac_copy(CYTHON_UNUSED struct __pyx_ob __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "mbedtls/hmac.pyx":58 + /* "mbedtls/hmac.pyx":65 * * """ * raise NotImplementedError # <<<<<<<<<<<<<< @@ -1915,10 +1957,10 @@ static PyObject *__pyx_f_7mbedtls_4hmac_4Hmac_copy(CYTHON_UNUSED struct __pyx_ob * */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":51 - * return _md.mbedtls_md_hmac_finish(&self._ctx, output) + /* "mbedtls/hmac.pyx":58 + * return _md.mbedtls_md_hmac_reset(&self._ctx) * * cpdef copy(self): # <<<<<<<<<<<<<< * """Return a copy ("clone") of the HMAC object. @@ -1962,7 +2004,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_4Hmac_2copy(struct __pyx_obj_7mbedtls_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_7mbedtls_4hmac_4Hmac_copy(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7mbedtls_4hmac_4Hmac_copy(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1979,7 +2021,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_4Hmac_2copy(struct __pyx_obj_7mbedtls_4 return __pyx_r; } -/* "mbedtls/hmac.pyx":61 +/* "mbedtls/hmac.pyx":68 * * * def new(key, buffer=None, digestmod=None): # <<<<<<<<<<<<<< @@ -2033,7 +2075,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_1new(PyObject *__pyx_self, PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "new") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2050,7 +2092,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_1new(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("new", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("new", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.new", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2076,7 +2118,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_RefNannySetupContext("new", 0); __Pyx_INCREF(__pyx_v_digestmod); - /* "mbedtls/hmac.pyx":66 + /* "mbedtls/hmac.pyx":73 * * """ * if digestmod is None: # <<<<<<<<<<<<<< @@ -2087,7 +2129,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "mbedtls/hmac.pyx":67 + /* "mbedtls/hmac.pyx":74 * """ * if digestmod is None: * digestmod = "md5" # <<<<<<<<<<<<<< @@ -2097,7 +2139,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_n_s_md5); __Pyx_DECREF_SET(__pyx_v_digestmod, __pyx_n_s_md5); - /* "mbedtls/hmac.pyx":66 + /* "mbedtls/hmac.pyx":73 * * """ * if digestmod is None: # <<<<<<<<<<<<<< @@ -2106,7 +2148,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "mbedtls/hmac.pyx":68 + /* "mbedtls/hmac.pyx":75 * if digestmod is None: * digestmod = "md5" * return Hmac(key, digestmod, buffer) # <<<<<<<<<<<<<< @@ -2114,7 +2156,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); @@ -2125,14 +2167,14 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_buffer); - __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":61 + /* "mbedtls/hmac.pyx":68 * * * def new(key, buffer=None, digestmod=None): # <<<<<<<<<<<<<< @@ -2153,12 +2195,12 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_new(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "mbedtls/hmac.pyx":71 +/* "mbedtls/hmac.pyx":78 * * * def md2(key, buffer=None): # <<<<<<<<<<<<<< * """MD2 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md2") + * return Hmac(key, "md2", buffer) */ /* Python wrapper */ @@ -2199,7 +2241,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_3md2(PyObject *__pyx_self, PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2214,7 +2256,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_3md2(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("md2", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("md2", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.md2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2232,57 +2274,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_2md2(CYTHON_UNUSED PyObject *__pyx_self __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("md2", 0); - /* "mbedtls/hmac.pyx":73 + /* "mbedtls/hmac.pyx":80 * def md2(key, buffer=None): * """MD2 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md2") # <<<<<<<<<<<<<< + * return Hmac(key, "md2", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_md2); + __Pyx_GIVEREF(__pyx_n_s_md2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_md2); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_md2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":71 + /* "mbedtls/hmac.pyx":78 * * * def md2(key, buffer=None): # <<<<<<<<<<<<<< * """MD2 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md2") + * return Hmac(key, "md2", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.md2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2291,12 +2325,12 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_2md2(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "mbedtls/hmac.pyx":76 +/* "mbedtls/hmac.pyx":83 * * * def md4(key, buffer=None): # <<<<<<<<<<<<<< * """MD4 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md4") + * return Hmac(key, "md4", buffer) */ /* Python wrapper */ @@ -2337,7 +2371,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_5md4(PyObject *__pyx_self, PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2352,7 +2386,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_5md4(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("md4", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("md4", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.md4", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2370,57 +2404,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_4md4(CYTHON_UNUSED PyObject *__pyx_self __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("md4", 0); - /* "mbedtls/hmac.pyx":78 + /* "mbedtls/hmac.pyx":85 * def md4(key, buffer=None): * """MD4 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md4") # <<<<<<<<<<<<<< + * return Hmac(key, "md4", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_md4); + __Pyx_GIVEREF(__pyx_n_s_md4); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_md4); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_md4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":76 + /* "mbedtls/hmac.pyx":83 * * * def md4(key, buffer=None): # <<<<<<<<<<<<<< * """MD4 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md4") + * return Hmac(key, "md4", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.md4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2429,12 +2455,12 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_4md4(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "mbedtls/hmac.pyx":81 +/* "mbedtls/hmac.pyx":88 * * * def md5(key, buffer=None): # <<<<<<<<<<<<<< * """MD5 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md5") + * return Hmac(key, "md5", buffer) */ /* Python wrapper */ @@ -2475,7 +2501,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_7md5(PyObject *__pyx_self, PyObject *__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md5") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "md5") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2490,7 +2516,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_7md5(PyObject *__pyx_self, PyObject *__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("md5", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("md5", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.md5", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2508,57 +2534,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_6md5(CYTHON_UNUSED PyObject *__pyx_self __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("md5", 0); - /* "mbedtls/hmac.pyx":83 + /* "mbedtls/hmac.pyx":90 * def md5(key, buffer=None): * """MD5 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md5") # <<<<<<<<<<<<<< + * return Hmac(key, "md5", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_md5); + __Pyx_GIVEREF(__pyx_n_s_md5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_md5); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_md5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":81 + /* "mbedtls/hmac.pyx":88 * * * def md5(key, buffer=None): # <<<<<<<<<<<<<< * """MD5 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md5") + * return Hmac(key, "md5", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.md5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2567,17 +2585,17 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_6md5(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "mbedtls/hmac.pyx":86 +/* "mbedtls/hmac.pyx":93 * * * def sha1(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 1 (SHA-1).""" - * return Hash(key, buffer, digestmod="sha1") + * """Secure Hmac Algorithm 1 (SHA-1).""" + * return Hmac(key, "sha1", buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_7mbedtls_4hmac_9sha1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7mbedtls_4hmac_8sha1[] = "Secure Hash Algorithm 1 (SHA-1)."; +static char __pyx_doc_7mbedtls_4hmac_8sha1[] = "Secure Hmac Algorithm 1 (SHA-1)."; static PyMethodDef __pyx_mdef_7mbedtls_4hmac_9sha1 = {"sha1", (PyCFunction)__pyx_pw_7mbedtls_4hmac_9sha1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mbedtls_4hmac_8sha1}; static PyObject *__pyx_pw_7mbedtls_4hmac_9sha1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; @@ -2613,7 +2631,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_9sha1(PyObject *__pyx_self, PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2628,7 +2646,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_9sha1(PyObject *__pyx_self, PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sha1", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sha1", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.sha1", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2646,57 +2664,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_8sha1(CYTHON_UNUSED PyObject *__pyx_sel __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sha1", 0); - /* "mbedtls/hmac.pyx":88 + /* "mbedtls/hmac.pyx":95 * def sha1(key, buffer=None): - * """Secure Hash Algorithm 1 (SHA-1).""" - * return Hash(key, buffer, digestmod="sha1") # <<<<<<<<<<<<<< + * """Secure Hmac Algorithm 1 (SHA-1).""" + * return Hmac(key, "sha1", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_sha1); + __Pyx_GIVEREF(__pyx_n_s_sha1); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sha1); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_sha1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":86 + /* "mbedtls/hmac.pyx":93 * * * def sha1(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 1 (SHA-1).""" - * return Hash(key, buffer, digestmod="sha1") + * """Secure Hmac Algorithm 1 (SHA-1).""" + * return Hmac(key, "sha1", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.sha1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2705,17 +2715,17 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_8sha1(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "mbedtls/hmac.pyx":91 +/* "mbedtls/hmac.pyx":98 * * * def sha224(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value.""" - * return Hash(key, buffer, digestmod="sha224") + * """Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value.""" + * return Hmac(key, "sha224", buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_7mbedtls_4hmac_11sha224(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7mbedtls_4hmac_10sha224[] = "Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value."; +static char __pyx_doc_7mbedtls_4hmac_10sha224[] = "Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value."; static PyMethodDef __pyx_mdef_7mbedtls_4hmac_11sha224 = {"sha224", (PyCFunction)__pyx_pw_7mbedtls_4hmac_11sha224, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mbedtls_4hmac_10sha224}; static PyObject *__pyx_pw_7mbedtls_4hmac_11sha224(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; @@ -2751,7 +2761,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_11sha224(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha224") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha224") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2766,7 +2776,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_11sha224(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sha224", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sha224", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.sha224", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2784,57 +2794,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_10sha224(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sha224", 0); - /* "mbedtls/hmac.pyx":93 + /* "mbedtls/hmac.pyx":100 * def sha224(key, buffer=None): - * """Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value.""" - * return Hash(key, buffer, digestmod="sha224") # <<<<<<<<<<<<<< + * """Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value.""" + * return Hmac(key, "sha224", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_sha224); + __Pyx_GIVEREF(__pyx_n_s_sha224); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sha224); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_sha224) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":91 + /* "mbedtls/hmac.pyx":98 * * * def sha224(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value.""" - * return Hash(key, buffer, digestmod="sha224") + * """Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value.""" + * return Hmac(key, "sha224", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.sha224", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2843,17 +2845,17 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_10sha224(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "mbedtls/hmac.pyx":96 +/* "mbedtls/hmac.pyx":103 * * * def sha256(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value.""" - * return Hash(key, buffer, digestmod="sha256") + * """Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value.""" + * return Hmac(key, "sha256", buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_7mbedtls_4hmac_13sha256(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7mbedtls_4hmac_12sha256[] = "Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value."; +static char __pyx_doc_7mbedtls_4hmac_12sha256[] = "Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value."; static PyMethodDef __pyx_mdef_7mbedtls_4hmac_13sha256 = {"sha256", (PyCFunction)__pyx_pw_7mbedtls_4hmac_13sha256, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mbedtls_4hmac_12sha256}; static PyObject *__pyx_pw_7mbedtls_4hmac_13sha256(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; @@ -2889,7 +2891,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_13sha256(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha256") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha256") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2904,7 +2906,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_13sha256(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sha256", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sha256", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.sha256", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2922,57 +2924,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_12sha256(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sha256", 0); - /* "mbedtls/hmac.pyx":98 + /* "mbedtls/hmac.pyx":105 * def sha256(key, buffer=None): - * """Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value.""" - * return Hash(key, buffer, digestmod="sha256") # <<<<<<<<<<<<<< + * """Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value.""" + * return Hmac(key, "sha256", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_sha256); + __Pyx_GIVEREF(__pyx_n_s_sha256); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sha256); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_sha256) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":96 + /* "mbedtls/hmac.pyx":103 * * * def sha256(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value.""" - * return Hash(key, buffer, digestmod="sha256") + * """Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value.""" + * return Hmac(key, "sha256", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.sha256", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2981,17 +2975,17 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_12sha256(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "mbedtls/hmac.pyx":101 +/* "mbedtls/hmac.pyx":108 * * * def sha384(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value.""" - * return Hash(key, buffer, digestmod="sha384") + * """Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value.""" + * return Hmac(key, "sha384", buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_7mbedtls_4hmac_15sha384(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7mbedtls_4hmac_14sha384[] = "Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value."; +static char __pyx_doc_7mbedtls_4hmac_14sha384[] = "Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value."; static PyMethodDef __pyx_mdef_7mbedtls_4hmac_15sha384 = {"sha384", (PyCFunction)__pyx_pw_7mbedtls_4hmac_15sha384, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mbedtls_4hmac_14sha384}; static PyObject *__pyx_pw_7mbedtls_4hmac_15sha384(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; @@ -3027,7 +3021,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_15sha384(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha384") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha384") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3042,7 +3036,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_15sha384(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sha384", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sha384", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.sha384", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3060,57 +3054,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_14sha384(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sha384", 0); - /* "mbedtls/hmac.pyx":103 + /* "mbedtls/hmac.pyx":110 * def sha384(key, buffer=None): - * """Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value.""" - * return Hash(key, buffer, digestmod="sha384") # <<<<<<<<<<<<<< + * """Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value.""" + * return Hmac(key, "sha384", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_sha384); + __Pyx_GIVEREF(__pyx_n_s_sha384); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sha384); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_sha384) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":101 + /* "mbedtls/hmac.pyx":108 * * * def sha384(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value.""" - * return Hash(key, buffer, digestmod="sha384") + * """Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value.""" + * return Hmac(key, "sha384", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.sha384", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3119,17 +3105,17 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_14sha384(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "mbedtls/hmac.pyx":106 +/* "mbedtls/hmac.pyx":113 * * * def sha512(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value.""" - * return Hash(key, buffer, digestmod="sha512") + * """Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value.""" + * return Hmac(key, "sha512", buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_7mbedtls_4hmac_17sha512(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7mbedtls_4hmac_16sha512[] = "Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value."; +static char __pyx_doc_7mbedtls_4hmac_16sha512[] = "Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value."; static PyMethodDef __pyx_mdef_7mbedtls_4hmac_17sha512 = {"sha512", (PyCFunction)__pyx_pw_7mbedtls_4hmac_17sha512, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7mbedtls_4hmac_16sha512}; static PyObject *__pyx_pw_7mbedtls_4hmac_17sha512(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; @@ -3165,7 +3151,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_17sha512(PyObject *__pyx_self, PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha512") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha512") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3180,7 +3166,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_17sha512(PyObject *__pyx_self, PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sha512", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("sha512", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.sha512", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3198,57 +3184,49 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_16sha512(CYTHON_UNUSED PyObject *__pyx_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sha512", 0); - /* "mbedtls/hmac.pyx":108 + /* "mbedtls/hmac.pyx":115 * def sha512(key, buffer=None): - * """Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value.""" - * return Hash(key, buffer, digestmod="sha512") # <<<<<<<<<<<<<< + * """Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value.""" + * return Hmac(key, "sha512", buffer) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_sha512); + __Pyx_GIVEREF(__pyx_n_s_sha512); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_sha512); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_sha512) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":106 + /* "mbedtls/hmac.pyx":113 * * * def sha512(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value.""" - * return Hash(key, buffer, digestmod="sha512") + * """Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value.""" + * return Hmac(key, "sha512", buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.sha512", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3257,7 +3235,7 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_16sha512(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "mbedtls/hmac.pyx":111 +/* "mbedtls/hmac.pyx":118 * * * def ripemd160(key, buffer=None): # <<<<<<<<<<<<<< @@ -3303,7 +3281,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_19ripemd160(PyObject *__pyx_self, PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ripemd160") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ripemd160") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3318,7 +3296,7 @@ static PyObject *__pyx_pw_7mbedtls_4hmac_19ripemd160(PyObject *__pyx_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ripemd160", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("ripemd160", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("mbedtls.hmac.ripemd160", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3336,42 +3314,36 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_18ripemd160(CYTHON_UNUSED PyObject *__p __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ripemd160", 0); - /* "mbedtls/hmac.pyx":114 + /* "mbedtls/hmac.pyx":121 * """RACE Integrity Primitives Evaluation Message Digest (RIPEMD) with * 160 bits hash value.""" - * return Hash(key, buffer, digestmod="ripemd160") # <<<<<<<<<<<<<< + * return Hmac(key, "ripemd160", buffer) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_n_s_ripemd160); + __Pyx_GIVEREF(__pyx_n_s_ripemd160); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ripemd160); __Pyx_INCREF(__pyx_v_buffer); __Pyx_GIVEREF(__pyx_v_buffer); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_buffer); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_digestmod, __pyx_n_s_ripemd160) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_buffer); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7mbedtls_4hmac_Hmac), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "mbedtls/hmac.pyx":111 + /* "mbedtls/hmac.pyx":118 * * * def ripemd160(key, buffer=None): # <<<<<<<<<<<<<< @@ -3383,8 +3355,6 @@ static PyObject *__pyx_pf_7mbedtls_4hmac_18ripemd160(CYTHON_UNUSED PyObject *__p __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mbedtls.hmac.ripemd160", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -14964,7 +14934,7 @@ static PyTypeObject __pyx_type_7mbedtls_4hmac_Hmac = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Wrap and encapsulate HMAC calculations.\n\n This class is a wrapper for the HMAC calculations in the md module\n of mbed TLS. The interface follows the recommendation from PEP 452\n for keyed hashes.\n\n Parameters:\n key (bytes): The key to use.\n name (bytes): The MD name known to mbed TLS.\n\n Attributes:\n digest_size (int): The size of the message digest, in bytes.\n block_size (int): Not implemented.\n name (bytes): The name of the message digest.\n\n ", /*tp_doc*/ + "Wrap and encapsulate HMAC calculations.\n\n This class is a wrapper for the HMAC calculations in the md module\n of mbed TLS. The interface follows the recommendation from PEP 452\n for keyed hashes.\n\n Parameters:\n key (bytes): The key to use.\n name (bytes): The MD name known to mbed TLS.\n\n Warning:\n The message is cleared after calculation of the digest. Only\n call :meth:`digest` or :meth:`hexdigest` once per message.\n\n Attributes:\n digest_size (int): The size of the message digest, in bytes.\n block_size (int): Not implemented.\n name (bytes): The name of the message digest.\n\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -15700,34 +15670,34 @@ static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) { type_name++; } if (0); - else if (__Pyx_StrEq(name, "contiguous")) { - Py_INCREF(o); - Py_DECREF(contiguous); - contiguous = o; - } else if (__Pyx_StrEq(name, "Py_None")) { PyErr_Format(PyExc_TypeError, "Cannot convert Python object Py_None to PyObject *"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L2_error;} } - else if (__Pyx_StrEq(name, "strided")) { + else if (__Pyx_StrEq(name, "contiguous")) { Py_INCREF(o); - Py_DECREF(strided); - strided = o; + Py_DECREF(contiguous); + contiguous = o; } else if (__Pyx_StrEq(name, "indirect_contiguous")) { Py_INCREF(o); Py_DECREF(indirect_contiguous); indirect_contiguous = o; } + else if (__Pyx_StrEq(name, "indirect")) { + Py_INCREF(o); + Py_DECREF(indirect); + indirect = o; + } else if (__Pyx_StrEq(name, "generic")) { Py_INCREF(o); Py_DECREF(generic); generic = o; } - else if (__Pyx_StrEq(name, "indirect")) { + else if (__Pyx_StrEq(name, "strided")) { Py_INCREF(o); - Py_DECREF(indirect); - indirect = o; + Py_DECREF(strided); + strided = o; } else { if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad; @@ -15993,18 +15963,17 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, - {&__pyx_kp_s_Apache_License_2_0, __pyx_k_Apache_License_2_0, sizeof(__pyx_k_Apache_License_2_0), 0, 0, 1, 0}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_Copyright_2015_Elaborated_Networ, __pyx_k_Copyright_2015_Elaborated_Networ, sizeof(__pyx_k_Copyright_2015_Elaborated_Networ), 0, 0, 1, 0}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, - {&__pyx_n_s_Hash, __pyx_k_Hash, sizeof(__pyx_k_Hash), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_kp_s_MIT_License, __pyx_k_MIT_License, sizeof(__pyx_k_MIT_License), 0, 0, 1, 0}, {&__pyx_kp_s_Mathias_Laurin, __pyx_k_Mathias_Laurin, sizeof(__pyx_k_Mathias_Laurin), 0, 0, 1, 0}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, @@ -16089,8 +16058,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16254,125 +16223,125 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "mbedtls/hmac.pyx":61 + /* "mbedtls/hmac.pyx":68 * * * def new(key, buffer=None, digestmod=None): # <<<<<<<<<<<<<< * """A generic constructor that takes the key algorithm as its first * parameter. */ - __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_buffer, __pyx_n_s_digestmod); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_buffer, __pyx_n_s_digestmod); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_new, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_new, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":71 + /* "mbedtls/hmac.pyx":78 * * * def md2(key, buffer=None): # <<<<<<<<<<<<<< * """MD2 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md2") + * return Hmac(key, "md2", buffer) */ - __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md2, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md2, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":76 + /* "mbedtls/hmac.pyx":83 * * * def md4(key, buffer=None): # <<<<<<<<<<<<<< * """MD4 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md4") + * return Hmac(key, "md4", buffer) */ - __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md4, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md4, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":81 + /* "mbedtls/hmac.pyx":88 * * * def md5(key, buffer=None): # <<<<<<<<<<<<<< * """MD5 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md5") + * return Hmac(key, "md5", buffer) */ - __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md5, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_md5, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":86 + /* "mbedtls/hmac.pyx":93 * * * def sha1(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 1 (SHA-1).""" - * return Hash(key, buffer, digestmod="sha1") + * """Secure Hmac Algorithm 1 (SHA-1).""" + * return Hmac(key, "sha1", buffer) */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha1, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha1, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":91 + /* "mbedtls/hmac.pyx":98 * * * def sha224(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value.""" - * return Hash(key, buffer, digestmod="sha224") + * """Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value.""" + * return Hmac(key, "sha224", buffer) */ - __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha224, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha224, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":96 + /* "mbedtls/hmac.pyx":103 * * * def sha256(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value.""" - * return Hash(key, buffer, digestmod="sha256") + * """Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value.""" + * return Hmac(key, "sha256", buffer) */ - __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha256, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha256, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":101 + /* "mbedtls/hmac.pyx":108 * * * def sha384(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value.""" - * return Hash(key, buffer, digestmod="sha384") + * """Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value.""" + * return Hmac(key, "sha384", buffer) */ - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha384, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha384, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":106 + /* "mbedtls/hmac.pyx":113 * * * def sha512(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value.""" - * return Hash(key, buffer, digestmod="sha512") + * """Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value.""" + * return Hmac(key, "sha512", buffer) */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha512, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_sha512, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "mbedtls/hmac.pyx":111 + /* "mbedtls/hmac.pyx":118 * * * def ripemd160(key, buffer=None): # <<<<<<<<<<<<<< * """RACE Integrity Primitives Evaluation Message Digest (RIPEMD) with * 160 bits hash value.""" */ - __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_ripemd160, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_laurin_src_python_mbedtls, __pyx_n_s_ripemd160, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "View.MemoryView":278 * return self.name @@ -16590,7 +16559,7 @@ PyMODINIT_FUNC PyInit_hmac(void) * * __author__ = "Mathias Laurin" # <<<<<<<<<<<<<< * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Mathias_Laurin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16598,7 +16567,7 @@ PyMODINIT_FUNC PyInit_hmac(void) * * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" # <<<<<<<<<<<<<< - * __license__ = "Apache License 2.0" + * __license__ = "MIT License" * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_Copyright_2015_Elaborated_Networ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16606,11 +16575,11 @@ PyMODINIT_FUNC PyInit_hmac(void) /* "mbedtls/hmac.pyx":5 * __author__ = "Mathias Laurin" * __copyright__ = "Copyright 2015, Elaborated Networks GmbH" - * __license__ = "Apache License 2.0" # <<<<<<<<<<<<<< + * __license__ = "MIT License" # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_Apache_License_2_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_s_MIT_License) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "mbedtls/hmac.pyx":10 * from libc.stdlib cimport malloc, free @@ -16672,124 +16641,124 @@ PyMODINIT_FUNC PyInit_hmac(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_algorithms_available, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":61 + /* "mbedtls/hmac.pyx":68 * * * def new(key, buffer=None, digestmod=None): # <<<<<<<<<<<<<< * """A generic constructor that takes the key algorithm as its first * parameter. */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_1new, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_1new, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":71 + /* "mbedtls/hmac.pyx":78 * * * def md2(key, buffer=None): # <<<<<<<<<<<<<< * """MD2 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md2") + * return Hmac(key, "md2", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_3md2, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_3md2, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_md2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_md2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":76 + /* "mbedtls/hmac.pyx":83 * * * def md4(key, buffer=None): # <<<<<<<<<<<<<< * """MD4 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md4") + * return Hmac(key, "md4", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_5md4, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_5md4, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_md4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_md4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":81 + /* "mbedtls/hmac.pyx":88 * * * def md5(key, buffer=None): # <<<<<<<<<<<<<< * """MD5 message-digest algorithm.""" - * return Hash(key, buffer, digestmod="md5") + * return Hmac(key, "md5", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_7md5, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_7md5, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_md5, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_md5, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":86 + /* "mbedtls/hmac.pyx":93 * * * def sha1(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 1 (SHA-1).""" - * return Hash(key, buffer, digestmod="sha1") + * """Secure Hmac Algorithm 1 (SHA-1).""" + * return Hmac(key, "sha1", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_9sha1, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_9sha1, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":91 + /* "mbedtls/hmac.pyx":98 * * * def sha224(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 224 bits hash value.""" - * return Hash(key, buffer, digestmod="sha224") + * """Secure Hmac Algorithm 2 (SHA-2) with 224 bits hash value.""" + * return Hmac(key, "sha224", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_11sha224, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_11sha224, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha224, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha224, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":96 + /* "mbedtls/hmac.pyx":103 * * * def sha256(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 256 bits hash value.""" - * return Hash(key, buffer, digestmod="sha256") + * """Secure Hmac Algorithm 2 (SHA-2) with 256 bits hash value.""" + * return Hmac(key, "sha256", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_13sha256, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_13sha256, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha256, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha256, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":101 + /* "mbedtls/hmac.pyx":108 * * * def sha384(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 384 bits hash value.""" - * return Hash(key, buffer, digestmod="sha384") + * """Secure Hmac Algorithm 2 (SHA-2) with 384 bits hash value.""" + * return Hmac(key, "sha384", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_15sha384, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_15sha384, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha384, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha384, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":106 + /* "mbedtls/hmac.pyx":113 * * * def sha512(key, buffer=None): # <<<<<<<<<<<<<< - * """Secure Hash Algorithm 2 (SHA-2) with 512 bits hash value.""" - * return Hash(key, buffer, digestmod="sha512") + * """Secure Hmac Algorithm 2 (SHA-2) with 512 bits hash value.""" + * return Hmac(key, "sha512", buffer) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_17sha512, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_17sha512, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha512, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sha512, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "mbedtls/hmac.pyx":111 + /* "mbedtls/hmac.pyx":118 * * * def ripemd160(key, buffer=None): # <<<<<<<<<<<<<< * """RACE Integrity Primitives Evaluation Message Digest (RIPEMD) with * 160 bits hash value.""" */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_19ripemd160, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7mbedtls_4hmac_19ripemd160, NULL, __pyx_n_s_mbedtls_hmac); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ripemd160, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ripemd160, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "mbedtls/hmac.pyx":1 diff --git a/mbedtls/pk/RSA.c b/mbedtls/pk/RSA.c index 44fcc066..532261b6 100644 --- a/mbedtls/pk/RSA.c +++ b/mbedtls/pk/RSA.c @@ -1,19 +1,5 @@ /* Generated by Cython 0.23.4 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "include_dirs": [ - "." - ], - "libraries": [ - "mbedtls" - ] - } -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H diff --git a/mbedtls/pk/__init__.c b/mbedtls/pk/__init__.c index e4ec45ad..855f5aac 100644 --- a/mbedtls/pk/__init__.c +++ b/mbedtls/pk/__init__.c @@ -1,18 +1,5 @@ /* Generated by Cython 0.23.4 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "include_dirs": [ - "." - ], - "libraries": [ - "mbedtls" - ] - } -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H diff --git a/mbedtls/pk/_pk.c b/mbedtls/pk/_pk.c index d1d28e2f..d43526b2 100644 --- a/mbedtls/pk/_pk.c +++ b/mbedtls/pk/_pk.c @@ -1,19 +1,5 @@ /* Generated by Cython 0.23.4 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "include_dirs": [ - "." - ], - "libraries": [ - "mbedtls" - ] - } -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H @@ -3939,12 +3925,12 @@ static PyObject *__pyx_f_7mbedtls_2pk_3_pk_10CipherBase_sign(struct __pyx_obj_7m /*exception exit:*/{ __pyx_L6_error:; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); @@ -4381,12 +4367,12 @@ static PyObject *__pyx_f_7mbedtls_2pk_3_pk_10CipherBase_encrypt(struct __pyx_obj /*exception exit:*/{ __pyx_L5_error:; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); @@ -4767,12 +4753,12 @@ static PyObject *__pyx_f_7mbedtls_2pk_3_pk_10CipherBase_decrypt(struct __pyx_obj /*exception exit:*/{ __pyx_L5_error:; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); diff --git a/mbedtls/random.c b/mbedtls/random.c index 98fa11c9..3a84162f 100644 --- a/mbedtls/random.c +++ b/mbedtls/random.c @@ -1,19 +1,5 @@ /* Generated by Cython 0.23.4 */ -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [], - "include_dirs": [ - "." - ], - "libraries": [ - "mbedtls" - ] - } -} -END: Cython Metadata */ - #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H