nucypher / pyUmbral

NuCypher's reference implementation of Umbral (threshold proxy re-encryption) using OpenSSL and Cryptography.io

Home Page:https://pyumbral.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'lib' has no attribute 'BN_set_flags'

w1397800 opened this issue · comments

https://github.com/nucypher/pyUmbral/blob/master/docs/examples/umbral_simple_api.py

when i run this file ,i got a error.

File "/opt/Python/lib/python3.6/site-packages/_pytest/config.py", line 392, in _importconftest
mod = conftestpath.pyimport()
File "/opt/Python/lib/python3.6/site-packages/py/_path/local.py", line 668, in pyimport
import(modname)
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 656, in _load_unlocked
File "", line 626, in _load_backward_compatible
File "/opt/Python/lib/python3.6/site-packages/pytest/assertion/rewrite.py", line 216, in load_module
py.builtin.exec
(co, mod.dict)
File "/pythonProject/nucypher/pyUmbral/tests/conftest.py", line 10, in
set_default_curve(ec.SECP256K1)
File "/pythonProject/nucypher/pyUmbral/umbral/config.py", line 46, in set_default_curve
return _CONFIG.set_curve(curve)
File "/pythonProject/nucypher/pyUmbral/umbral/config.py", line 42, in set_curve
cls.__params = UmbralParameters(curve)
File "/pythonProject/nucypher/pyUmbral/umbral/params.py", line 16, in init
self.order = openssl._get_ec_order_by_curve_nid(curve_nid)
File "/pythonProject/nucypher/pyUmbral/umbral/openssl.py", line 36, in _get_ec_order_by_curve_nid
ec_order = _get_new_BN()
File "/pythonProject/nucypher/pyUmbral/umbral/openssl.py", line 17, in _get_new_BN
backend._lib.BN_set_flags(new_bn, backend._lib.BN_FLG_CONSTTIME)
AttributeError: module 'lib' has no attribute 'BN_set_flags'
ERROR: could not load /pythonProject/nucypher/pyUmbral/tests/conftest.py

By the way, i use python3.6 and CentOS-6.4-x86_64.

commented

Hi, we use a more updated version of cryptography.io that has these functions added.

Unfortunately, a release hasn't been done yet, but we ship wheels for it. If you run setup.py, it should install this automatically for you.

If not, you can do pip install <path_to_pyUmbral>/wheelhouse/<the_wheel_you_need>. This should install the cryptography.io wheel you need. Then you can run the normal setup.py and it should work.

thank u, the error is sovled. but i have got another error after i installed the cryptography-2.3.dev1-cp36-cp36m-linux_x86_64.whl.

Traceback (most recent call last):
File "umbral_simple_api.py", line 4, in
from umbral import pre, keys, config
File "/opt/Python/lib/python3.6/site-packages/umbral/pre.py", line 4, in
from cryptography.hazmat.backends.openssl import backend
File "/opt/Python/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/init.py", line 7, in
from cryptography.hazmat.backends.openssl.backend import backend
File "/opt/Python/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 53, in
from cryptography.hazmat.bindings.openssl import binding
File "/opt/Python/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/Python/lib/python3.6/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so)

commented

You might need to install the glibc library, have you tried that?

thank u very much, i have run the example successfully. i was asked to get some programs about proxy re-encryption in this week. it's my first time to run python programs.

commented

No problem, glad to assist. 🐧