-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Missing docs for c++ interface? #72
Comments
I'm sorry for the inadequate documents. I have little time to write it, but I'll do little by little.
What curve parameters do you want to use? Could you tell me what you want? The current version does not support multi parameters.
The direct function is not provided. Call mcl::gmp::getBitSize() after converting to mpz_class. The generator of G1/G2 is not unique, so the api is not provided.
|
Thank you so much! We are attempting to use this lib (it is faster than most others) for a searchable threshold encryption system.
|
Things I learned:
|
I tried to make a very dirty hack of bn.hpp. Fr, G1, et al. are plain object data, then you can use them in a union if you call the correct method of each content.
|
I've seen the error. And could you build the wrong binary with debug mode (-Og -g3) and
Then I can know the position of the exception. |
Sorry, the getG1basePoint is NOT for pairing curves. If you need the ETH base point for BLS12_381, then see Set String. For BN254, please select any generator that you want. |
Please see Serialization format of mcl. mcl does not support output 0x02 and 0x03. mcl supports only the compression serialization of ETH. |
yes, bn_test.exe works well, i only have problems when including CMakeLists as a subproject. make:
vs cmake:
maybe it's the O3 vs Ofast? or the -m64 ... not sure. i am trying to make them the same, switched from clang to g++ to be sure. this fails at the very beginning The same error occurs with BLS12_381. Haven't figured it out yet. |
I want to know the following information:
Does the following command run well? It runs well on Ubuntu 18.04.4 + Core i7-7700 + gcc 7.4(and clang 8.0.1)
|
OS: ubuntu I found the problem! The issue was that I was calling initPairing during static initialization. This worked for Important when using mcl/c++: be sure to call initPairing from "main", or your regular entry point... not in static initialization. I think everything works now...we are doing a searchable encryption system using pairings where you can search and never decrypt. |
Windows 64-bit compile I get "divUnit for uint64_t is not supported". |
I will write a up small help file explaing how to use in C++ (vs api.md which is for c). Added a pull req to make the windows runtime lib choice optional in the CMakeFile (when using mcl as a cmake component, this was helpful) |
I fixed it and use _udiv128 if possible at a53b6b7 |
the _udiv128 commit works well on 64-bit windows, i removed the portable flag, no longer needed |
There are only docs for the C interface. Is that what I should use in a C++ project?
How can I get the bit size for Fr? Is this the right way to create an Fr?
mcl::FpT<mcl::ZnTag, 256> Fr;
Which of these should I use for initializing:
This (seems ok):
Or (seems unsafe, cannot use more than 1 curve in an application)
How do i get the order and bit-size of Fr/Fp for G1, and G2?
Can I switch between curves in one app? Or is this a big performance hit.
How do i get a 'generator' for G1, and G2?
mapToG1(g1, 1)
seems ok.I got everything to work with BLS12_381 (I still thing I am doing some things wrong, lookoing at the
getOp().mp
instead of higher level stuff to get curve order... but when I use BN254, I get "bad size of register"The text was updated successfully, but these errors were encountered: