Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with BP_WITH_OPENSSL fails - missing bp.h #43

Open
mouse07410 opened this issue Sep 23, 2020 · 4 comments
Open

Build with BP_WITH_OPENSSL fails - missing bp.h #43

mouse07410 opened this issue Sep 23, 2020 · 4 comments

Comments

@mouse07410
Copy link

mouse07410 commented Sep 23, 2020

OpenSSL-1.1.1 and 3.0 (and 1.0.2 - I checked) do not have bp.h header file.

src/include/openabe/zml/zelement.h tries to include bp.h. which fails:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src
CXX11FLAGS: -std=c++11 -I/Users/ur20980/src/openabe-mouse/deps/root/include -I/Users/ur20980/src/openabe-mouse/src -I/Users/ur20980/src/openabe-mouse/root/include -std=c++11 -I/opt/local/include -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-deprecated -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2  -DSSL_LIB_INIT -DBP_WITH_OPENSSL 
mkdir -p /Users/ur20980/src/openabe-mouse/root/include/openabe
cp -r include/openabe/* /Users/ur20980/src/openabe-mouse/root/include/openabe
clang++ -I/Users/ur20980/src/openabe-mouse/deps/root/include -I/Users/ur20980/src/openabe-mouse/src -I/Users/ur20980/src/openabe-mouse/root/include -std=c++11 -I/opt/local/include -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-deprecated -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2  -DSSL_LIB_INIT -DBP_WITH_OPENSSL -c zobject.cpp
In file included from zobject.cpp:39:
In file included from /Users/ur20980/src/openabe-mouse/root/include/openabe/openabe.h:120:
/Users/ur20980/src/openabe-mouse/root/include/openabe/zml/zelement.h:43:10: fatal error: 'openssl/bp.h' file not found
#include <openssl/bp.h>
         ^~~~~~~~~~~~~~
1 error generated.
make[1]: *** [zobject.o] Error 1

How to trigger this bug:

$ . ./env
$ export ZML_LIB="with_openssl"
$ make
. . . . .
[ observe the above error message ]

Seems the same as #15, only with more details. ;-)

@jakinyele any help here? Is ZML_LIB="with_openssl" deprecated? Because I don't see how this can even compile, and OpenSSL stopped providing openssl/bp.h header file (and the rest of support) way before v1.0.2. So, this must be a really old relict.

@jakinyele
Copy link
Collaborator

Oh, great point Uri @mouse07410! Yeah, you'll have to compile with https://github.com/zeutro/openssl (fork of v1.0.2 I vaguely recall). This fork includes a somewhat slower implementation of BN-254 (compared to RELIC).

@mouse07410
Copy link
Author

Yeah, you'll have to compile with https://github.com/zeutro/openssl (fork of v1.0.2 I vaguely recall)

@jakinyele I see, thank you. In fact, based on deps/openssl/download_openssl.sh, it appears to be OpenSSL-1.1.1:

 # openssl with BP support
if [[ $CMD == "with-bp" ]]; then
   LINK=https://github.com/zeutro/openssl
   VERSION=1.1.1-dev-bp
   echo "Clone github repo @ ${LINK}"
   git clone -b patch ${LINK} openssl-${VERSION}.git
   cd openssl-${VERSION}.git
else
   LINK=https://github.com/openssl/openssl
   VERSION=1.1.1-dev
   echo "Clone github repo @ ${LINK}"
   git clone ${LINK} openssl-${VERSION}.git
   cd openssl-${VERSION}.git
   git reset --hard ${COMMIT}
fi

It would be great if you could update README.md and clarify the build parameters. Especially, what dependencies must be pulled and re-built by openabe, and what could be installed outside of it.

Would you consider "packaging" your BP implementation, so that instead of pulling your entire OpenSSL fork (which I do not want to do), I could just pull the BP stuff and compile it against my already-installed OpenSSL?

@jakinyele
Copy link
Collaborator

jakinyele commented Sep 24, 2020

@mouse07410 right, v1.1.1 and will update the README. I think we could repackage the BP implementation as a source code patch of OpenSSL v1.1.1 so you can recompile against your already-installed OpenSSL version. Will see if this approach could work with other versions as well.

@mouse07410
Copy link
Author

mouse07410 commented Sep 24, 2020

. . . repackage the BP implementation as a source code patch of OpenSSL . . .

Thank you!

Might I suggest that the ideal solution would be repackaging as an add-on rather than a patch that requires OpenSSL source code modification?

Will see if this approach could work with other versions as well

IMHO, the only two versions worth worrying about are the current stable 1.1.1, and the upcoming 3.0.

Update

Clarification: I mean - if I have a binary installation of OpenSSL (say, 1.1.1), I'd like to be able to compile your source BP package against it (linking against libcrypto.so, or libcrypto.dylib), as a part of openabe build. My main point is that I would prefer not to have to deal with or modify OpenSSL sources. Compiling openabe and BP form sources is perfectly OK, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants