gdanezis / petlib Goto Github PK
View Code? Open in Web Editor NEWA python library that implements a number of Privacy Enhancing Technolgies
License: BSD 2-Clause "Simplified" License
A python library that implements a number of Privacy Enhancing Technolgies
License: BSD 2-Clause "Simplified" License
When runnung
pip install petlib
under Windows, installation fails with the following error
OSError: ctypes.util.find_library() did not manage to locate a library called 'crypto'
Error occurs with all available 64bit OpenSSL versions 1.1.1d, 1.10L and 1.0.2t.
Linux installation works fine though!
If you compare Bn to anything that is not a Bn...
Bn(42) == "something"
...petlib falls into a recursive death:
Output:
AttributeError Traceback (most recent call last)
~/Workspace/zkc/venv/lib/python3.6/site-packages/petlib/bn.py in __inner_cmp__(self, other)
283 try:
--> 284 sig = int(_C.BN_cmp(self.bn, other.bn))
285 return sig
AttributeError: 'NotImplementedType' object has no attribute 'bn'
During handling of the above exception, another exception occurred:
RecursionError Traceback (most recent call last)
<ipython-input-2-ea31e540b152> in <module>()
----> 1 Bn(42) == "statast"
~/Workspace/zkc/venv/lib/python3.6/site-packages/petlib/bn.py in __eq__(self, other)
294
295 def __eq__(self, other):
--> 296 return self.__inner_cmp__(other) == 0
297
298 def __ne__(self, other):
~/Workspace/zkc/venv/lib/python3.6/site-packages/petlib/bn.py in __inner_cmp__(self, other)
285 return sig
286 except AttributeError:
--> 287 return self.__inner_cmp__(Bn.from_num(other))
288
289 def __lt__(self, other):
... last 1 frames repeated, from the frame below ...
~/Workspace/zkc/venv/lib/python3.6/site-packages/petlib/bn.py in __inner_cmp__(self, other)
285 return sig
286 except AttributeError:
--> 287 return self.__inner_cmp__(Bn.from_num(other))
288
289 def __lt__(self, other):
RecursionError: maximum recursion depth exceeded while calling a Python object
He,
just installed petlib and now trying to create a new EcGroup instance the following exception occurs.
Any recommendations to make it work?
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import petlib
>>> from petlib.ec import EcGroup
Support not loading the library to build docs without compiling.
>>> G = EcGroup()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sebastian/Developer/.envs/pet/lib/python2.7/site-packages/petlib/ec.py", line 62, in __init__
self.ecg = _C.EC_GROUP_new_by_curve_name(nid)
AttributeError: 'NoneType' object has no attribute 'EC_GROUP_new_by_curve_name'
Which results in Bn.__init__
serving arbitrary objects to abs()
. According to the doc, the following types are acceptable:
"The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned."
You could either make Bn
be an int
or float
, make its constructor explicitely reject wrong input types, or build a copy constructor (is that even a thing in Python!?).
Petlib crashes when installed systewide, because it tries to create cache files in /usr/lib/python3.4/site-packages/petlib/... Please ensure that petlib identifies a read-write area to create cache files into, rather than in its install location which should be treated as read-only.
Suggested locations:
$XDG_CACHE_HOME/petlib
$HOME/.cache/petlib
/tmp/petlib
ubuntu18.04 LTS pip install petlib do not work, no mistake, just stop all the time
Running setup.py develop for petlib
Complete output from command /home/kali/Virtualenvs/petlib/bin/python2 -c "import setuptools, tokenize;__file__='/home/kali/leap/petlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
running develop
running egg_info
writing requirements to petlib.egg-info/requires.txt
writing petlib.egg-info/PKG-INFO
writing top-level names to petlib.egg-info/top_level.txt
writing dependency_links to petlib.egg-info/dependency_links.txt
reading manifest file 'petlib.egg-info/SOURCES.txt'
writing manifest file 'petlib.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/petlib._petlib.c'
creating build
creating build/temp.linux-x86_64-2.7
building 'petlib._petlib' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/petlib._petlib.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/petlib._petlib.o -Wno-deprecated-declarations
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘hmac_ctx_size’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:462:19: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
return sizeof(HMAC_CTX);
^~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
build/temp.linux-x86_64-2.7/petlib._petlib.c:466:41: error: macro "ERR_load_crypto_strings" passed 1 arguments, but takes just 0
extern void ERR_load_crypto_strings(void);
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:468:34: error: macro "ERR_free_strings" passed 1 arguments, but takes just 0
extern void ERR_free_strings(void);
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:535:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
int setup_ssl_threads() {
^~~~~~~~~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:1037:56: error: field ‘y’ has incomplete type
struct _cffi_align_typedef_HMAC_CTX { char x; HMAC_CTX y; };
^
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_BN_init’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:1882:3: warning: implicit declaration of function ‘BN_init’ [-Wimplicit-function-declaration]
BN_init(x0);
^~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_CRYPTO_lock’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:3013:3: warning: implicit declaration of function ‘CRYPTO_lock’ [-Wimplicit-function-declaration]
CRYPTO_lock(x0, x1, x2, x3);
^~~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_HMAC_CTX_cleanup’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7195:3: warning: implicit declaration of function ‘HMAC_CTX_cleanup’ [-Wimplicit-function-declaration]
HMAC_CTX_cleanup(x0);
^~~~~~~~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_d_HMAC_CTX_init’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7231:3: warning: implicit declaration of function ‘HMAC_CTX_init’ [-Wimplicit-function-declaration]
HMAC_CTX_init(x0);
^~~~~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__ECDSA_SIG’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7897:23: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
{ BIGNUM * *tmp = &p->r; (void)tmp; }
^~
build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7900:51: error: field ‘y’ has incomplete type
struct _cffi_align__ECDSA_SIG { char x; ECDSA_SIG y; };
^
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__EVP_CIPHER_CTX’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7907:33: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ EVP_CIPHER const * *tmp = &p->cipher; (void)tmp; }
^~
build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7916:61: error: field ‘y’ has incomplete type
struct _cffi_align__EVP_CIPHER_CTX { char x; EVP_CIPHER_CTX y; };
^
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘_cffi_checkfld__EVP_CIPHER’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7923:12: error: dereferencing pointer to incomplete type ‘EVP_CIPHER {aka struct evp_cipher_st}’
(void)((p->nid) | 0); /* check that 'EVP_CIPHER.nid' is an integer */
^~
build/temp.linux-x86_64-2.7/petlib._petlib.c: At top level:
build/temp.linux-x86_64-2.7/petlib._petlib.c:7929:53: error: field ‘y’ has incomplete type
struct _cffi_align__EVP_CIPHER { char x; EVP_CIPHER y; };
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8090:3: error: invalid use of incomplete typedef ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
{ "r", offsetof(ECDSA_SIG, r),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8093:3: error: invalid use of incomplete typedef ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
{ "s", offsetof(ECDSA_SIG, s),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8096:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "cipher", offsetof(EVP_CIPHER_CTX, cipher),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8099:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "encrypt", offsetof(EVP_CIPHER_CTX, encrypt),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8102:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "buf_len", offsetof(EVP_CIPHER_CTX, buf_len),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8105:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "num", offsetof(EVP_CIPHER_CTX, num),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8108:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "key_len", offsetof(EVP_CIPHER_CTX, key_len),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8111:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "flags", offsetof(EVP_CIPHER_CTX, flags),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8114:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "final_used", offsetof(EVP_CIPHER_CTX, final_used),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8117:3: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
{ "block_mask", offsetof(EVP_CIPHER_CTX, block_mask),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8120:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
{ "nid", offsetof(EVP_CIPHER, nid),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8123:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
{ "block_size", offsetof(EVP_CIPHER, block_size),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8126:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
{ "key_len", offsetof(EVP_CIPHER, key_len),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8129:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
{ "iv_len", offsetof(EVP_CIPHER, iv_len),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8132:3: error: invalid use of incomplete typedef ‘EVP_CIPHER {aka struct evp_cipher_st}’
{ "flags", offsetof(EVP_CIPHER, flags),
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:12: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
^~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:5: error: initializer element is not constant
sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
^~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:5: note: (near initialization for ‘_cffi_struct_unions[9].size’)
In file included from /usr/include/sched.h:28:0,
from /usr/include/pthread.h:23,
from /usr/include/openssl/crypto.h:406,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/err.h:21,
from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:23: error: initializer element is not constant
sizeof(HMAC_CTX), offsetof(struct _cffi_align_typedef_HMAC_CTX, y), 2, 0 },
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8157:23: note: (near initialization for ‘_cffi_struct_unions[9].alignment’)
build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:12: error: invalid application of ‘sizeof’ to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
^~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:5: error: initializer element is not constant
sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
^~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:5: note: (near initialization for ‘_cffi_struct_unions[10].size’)
In file included from /usr/include/sched.h:28:0,
from /usr/include/pthread.h:23,
from /usr/include/openssl/crypto.h:406,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/err.h:21,
from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:24: error: initializer element is not constant
sizeof(ECDSA_SIG), offsetof(struct _cffi_align__ECDSA_SIG, y), 2, 2 },
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8159:24: note: (near initialization for ‘_cffi_struct_unions[10].alignment’)
build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:12: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
^~~~~~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:5: error: initializer element is not constant
sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
^~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:5: note: (near initialization for ‘_cffi_struct_unions[11].size’)
In file included from /usr/include/sched.h:28:0,
from /usr/include/pthread.h:23,
from /usr/include/openssl/crypto.h:406,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/err.h:21,
from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:29: error: initializer element is not constant
sizeof(EVP_CIPHER_CTX), offsetof(struct _cffi_align__EVP_CIPHER_CTX, y), 4, 8 },
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8161:29: note: (near initialization for ‘_cffi_struct_unions[11].alignment’)
build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:12: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER {aka struct evp_cipher_st}’
sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
^~~~~~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:5: error: initializer element is not constant
sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
^~~~~~
build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:5: note: (near initialization for ‘_cffi_struct_unions[12].size’)
In file included from /usr/include/sched.h:28:0,
from /usr/include/pthread.h:23,
from /usr/include/openssl/crypto.h:406,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/err.h:21,
from build/temp.linux-x86_64-2.7/petlib._petlib.c:435:
build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:25: error: initializer element is not constant
sizeof(EVP_CIPHER), offsetof(struct _cffi_align__EVP_CIPHER, y), 12, 5 },
^
build/temp.linux-x86_64-2.7/petlib._petlib.c:8163:25: note: (near initialization for ‘_cffi_struct_unions[12].alignment’)
build/temp.linux-x86_64-2.7/petlib._petlib.c: In function ‘hmac_ctx_size’:
build/temp.linux-x86_64-2.7/petlib._petlib.c:463:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
At top level:
build/temp.linux-x86_64-2.7/petlib._petlib.c:507:13: warning: ‘_ssl_thread_locking_function’ defined but not used [-Wunused-function]
static void _ssl_thread_locking_function(int mode, int n, const char *file,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
I'm stubbing petlib at the moment and noticed that https://github.com/gdanezis/petlib/blob/master/petlib/bn.py#L763 doesn't return a bool. Is that intentional?
When I installing petlib on win,there is an error:
ERROR: Command errored out with exit status 1: command: 'd:\python3\python3.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\12711\\AppData\\Local\\Temp\\pip-install-_5s5ibkx\\petlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\12711\\AppData\\Local\\Temp\\pip-install-_5s5ibkx\\petlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\12711\AppData\Local\Temp\pip-install-_5s5ibkx\petlib\pip-egg-info' cwd: C:\Users\12711\AppData\Local\Temp\pip-install-_5s5ibkx\petlib\ Complete output (27 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\12711\AppData\Local\Temp\pip-install-_5s5ibkx\petlib\setup.py", line 40, in <module> zip_safe=False, File "d:\python3\lib\site-packages\setuptools\__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "d:\python3\lib\distutils\core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "d:\python3\lib\site-packages\setuptools\dist.py", line 448, in __init__ k: v for k, v in attrs.items() File "d:\python3\lib\distutils\dist.py", line 281, in __init__ self.finalize_options() File "d:\python3\lib\site-packages\setuptools\dist.py", line 740, in finalize_options ep.load()(self) File "d:\python3\lib\site-packages\setuptools\dist.py", line 747, in _finalize_setup_keywords ep.load()(self, ep.name, value) File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 211, in cffi_modules add_cffi_module(dist, cffi_module) File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module execfile(build_file_name, mod_vars) File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile exec(code, glob, glob) File "petlib/compile.py", line 34, in <module> openssl_conf = os.environ["OPENSSL_CONF"] File "d:\python3\lib\os.py", line 669, in __getitem__ raise KeyError(key) from None KeyError: 'OPENSSL_CONF' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
When attempting to import petlib.pack I get the following error:
Support not loading the library to build docs without compiling.
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/petlib-0.0.43-py2.7-linux-armv7l.egg/petlib/pack.py", line 32, in
from .ec import EcGroup, EcPt
File "/usr/local/lib/python2.7/dist-packages/petlib-0.0.43-py2.7-linux-armv7l.egg/petlib/ec.py", line 2, in
from .bn import Bn, force_Bn, get_ctx
File "/usr/local/lib/python2.7/dist-packages/petlib-0.0.43-py2.7-linux-armv7l.egg/petlib/bn.py", line 794, in
zero = Bn(0)
File "/usr/local/lib/python2.7/dist-packages/petlib-0.0.43-py2.7-linux-armv7l.egg/petlib/bn.py", line 222, in init
self.bn = _C.BN_new()
AttributeError: 'NoneType' object has no attribute 'BN_new'
I tried following the error put was left puzzled when it came down to /usr/local/lib/python2.7/dist-packages/petlib-0.0.43-py2.7-linux-armv7l.egg/petlib/
Can provide debug information as needed.
Very long error output when I follow the instruction of readme to install petlib(Ubuntu 14.04.6 LTS, python 2.7.6) The end of the error msg is :
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-H3NHgN/petlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-4D7FJ1/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-H3NHgN/petlib/
Any one can help figure it out?
Example (quick_gcm_enc
uses get_tag
and in here tag
is the return value of get_tag
):
>>> from os import urandom
>>> from petlib.cipher import Cipher
>>> message = "hello"
>>> plaintext = message.encode("utf8")
>>> aes = Cipher("aes-128-gcm")
>>> iv = urandom(16)
>>> key = urandom(16)
>>> ciphertext, tag = aes.quick_gcm_enc(key, iv, plaintext)
>>> type(tag)
<type '_cffi_backend.CDataOwn'>
>>> tag is str
False
>>> tag is bytes
False
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.