miracl / MIRACL

MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).
https://miracl.com
641 stars 241 forks source link

Some issues about the bls.cpp #121

Open Vageous opened 1 year ago

Vageous commented 1 year ago

Hi, I am new to the miracl. When using this library, I meet some issues about the pairing operation. I first compile miracl follow the first.txt and I choose to bash linux64_cpp. However, when I test the bls.cpp, we meet the following problems. The problem looks like the miracl.a has not compiled the pairing_3.h? So, how can use the Elliptic curve in miracle?Do I need to modify the file linux64_cpp? Hope you can help me solve this problem.

/usr/bin/ld: /tmp/ccOjDkJI.o: in function main': bls.cpp:(.text+0x34): undefined reference toPFC::PFC(int, csprng)' /usr/bin/ld: bls.cpp:(.text+0xc4): undefined reference to PFC::random(G2&)' /usr/bin/ld: bls.cpp:(.text+0xdd): undefined reference toPFC::random(Big&)' /usr/bin/ld: bls.cpp:(.text+0x101): undefined reference to PFC::mult(G2 const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x149): undefined reference toPFC::hash_and_map(G1&, char)' /usr/bin/ld: bls.cpp:(.text+0x16d): undefined reference to PFC::mult(G1 const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x294): undefined reference toPFC::hash_and_map(G1&, char*)' /usr/bin/ld: bls.cpp:(.text+0x2ad): undefined reference to PFC::precomp_for_pairing(G2&)' /usr/bin/ld: bls.cpp:(.text+0x328): undefined reference toPFC::multi_pairing(int, G2, G1)' /usr/bin/ld: bls.cpp:(.text+0x428): undefined reference to PFC::~PFC()' /usr/bin/ld: bls.cpp:(.text+0x548): undefined reference toPFC::~PFC()' /usr/bin/ld: /tmp/ccOjDkJI.o: in function G1::operator=(G1 const&)': bls.cpp:(.text._ZN2G1aSERKS_[_ZN2G1aSERKS_]+0x37): undefined reference toread_only_error()' /usr/bin/ld: /tmp/ccOjDkJI.o: in function G2::operator=(G2 const&)': bls.cpp:(.text._ZN2G2aSERKS_[_ZN2G2aSERKS_]+0x44): undefined reference toread_only_error()' collect2: error: ld returned 1 exit status

mcarrickscott commented 1 year ago

Read the comments at the start of bls.cpp

You need to link in the pairing code, e.g.

g++ -O2 bls.cpp bn_pair.cpp zzn12a.cpp ecn2.cpp zzn4.cpp zzn2.cpp big.cpp zzn.cpp ecn.cpp miracl.a -o bls

On Wed, Jun 28, 2023 at 9:51 AM Vageous @.***> wrote:

Hi, I am new to the miracl. When using this library, I meet some issues about the pairing operation. I first compile miracl follow the first.txt and I choose to bash linux64_cpp. However, when I test the bls.cpp, we meet the following problems. The problem looks like the miracl.a has not compiled the pairing_3.h? So, how can use the Elliptic curve in miracle?Do I need to modify the file linux64_cpp? Hope you can help me solve this problem.

/usr/bin/ld: /tmp/ccOjDkJI.o: in function main': bls.cpp:(.text+0x34): undefined reference to PFC::PFC(int, csprng)' /usr/bin/ld: bls.cpp:(.text+0xc4): undefined reference to PFC::random(G2&)' /usr/bin/ld: bls.cpp:(.text+0xdd): undefined reference to PFC::random(Big&)' /usr/bin/ld: bls.cpp:(.text+0x101): undefined reference to PFC::mult(G2 const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x149): undefined reference to PFC::hash_and_map(G1&, char)' /usr/bin/ld: bls.cpp:(.text+0x16d): undefined reference to PFC::mult(G1 const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x294): undefined reference to PFC::hash_and_map(G1&, char*)' /usr/bin/ld: bls.cpp:(.text+0x2ad): undefined reference to PFC::precomp_for_pairing(G2&)' /usr/bin/ld: bls.cpp:(.text+0x328): undefined reference to PFC::multi_pairing(int, G2, G1)' /usr/bin/ld: bls.cpp:(.text+0x428): undefined reference to PFC::~PFC()' /usr/bin/ld: bls.cpp:(.text+0x548): undefined reference to PFC::~PFC()' /usr/bin/ld: /tmp/ccOjDkJI.o: in function G1::operator=(G1 const&)': bls.cpp:(.text.ZN2G1aSERKS[ZN2G1aSERKS]+0x37): undefined reference to read_only_error()' /usr/bin/ld: /tmp/ccOjDkJI.o: in function G2::operator=(G2 const&)': bls.cpp:(.text.ZN2G2aSERKS[ZN2G2aSERKS]+0x44): undefined reference to read_only_error()' collect2: error: ld returned 1 exit status

— Reply to this email directly, view it on GitHub https://github.com/miracl/MIRACL/issues/121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU3ZDXF3P3ACZ7H3SX7P2LXNPWBNANCNFSM6AAAAAAZWWT7HA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Vageous commented 1 year ago

I got it. Thanks for your help!


---- Replied Message ----
From Michael ***@***.***>
Date 06/28/2023 17:16
To ***@***.***>
Cc ***@***.***>***@***.***>
Subject Re: [miracl/MIRACL] Some issues about the bls.cpp (Issue #121)

Read the comments at the start of bls.cpp

You need to link in the pairing code, e.g.

g++ -O2 bls.cpp* bn_pair.cpp* zzn12a.cpp ecn2.cpp zzn4.cpp zzn2.cpp big.cpp
zzn.cpp ecn.cpp miracl.a -o bls

On Wed, Jun 28, 2023 at 9:51 AM Vageous ***@***.***> wrote:

> Hi, I am new to the miracl. When using this library, I meet some issues
> about the pairing operation. I first compile miracl follow the first.txt
> and I choose to bash linux64_cpp. However, when I test the bls.cpp, we meet
> the following problems.
> The problem looks like the miracl.a has not compiled the pairing_3.h? So,
> how can use the Elliptic curve in miracle?Do I need to modify the file
> linux64_cpp? Hope you can help me solve this problem.
>
> /usr/bin/ld: /tmp/ccOjDkJI.o: in function main': bls.cpp:(.text+0x34):
> undefined reference to PFC::PFC(int, csprng*)'
> /usr/bin/ld: bls.cpp:(.text+0xc4): undefined reference to PFC::random(G2&)'
> /usr/bin/ld: bls.cpp:(.text+0xdd): undefined reference to
> PFC::random(Big&)'
> /usr/bin/ld: bls.cpp:(.text+0x101): undefined reference to PFC::mult(G2
> const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x149): undefined
> reference to PFC::hash_and_map(G1&, char*)'
> /usr/bin/ld: bls.cpp:(.text+0x16d): undefined reference to PFC::mult(G1
> const&, Big const&)' /usr/bin/ld: bls.cpp:(.text+0x294): undefined
> reference to PFC::hash_and_map(G1&, char*)'
> /usr/bin/ld: bls.cpp:(.text+0x2ad): undefined reference to PFC::precomp_for_pairing(G2&)'
> /usr/bin/ld: bls.cpp:(.text+0x328): undefined reference to PFC::multi_pairing(int,
> G2**, G1**)'
> /usr/bin/ld: bls.cpp:(.text+0x428): undefined reference to PFC::~PFC()'
> /usr/bin/ld: bls.cpp:(.text+0x548): undefined reference to PFC::~PFC()'
> /usr/bin/ld: /tmp/ccOjDkJI.o: in function G1::operator=(G1 const&)':
> bls.cpp:(.text._ZN2G1aSERKS_[_ZN2G1aSERKS_]+0x37): undefined reference to
> read_only_error()'
> /usr/bin/ld: /tmp/ccOjDkJI.o: in function G2::operator=(G2 const&)':
> bls.cpp:(.text._ZN2G2aSERKS_[_ZN2G2aSERKS_]+0x44): undefined reference to
> read_only_error()'
> collect2: error: ld returned 1 exit status
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/miracl/MIRACL/issues/121>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAU3ZDXF3P3ACZ7H3SX7P2LXNPWBNANCNFSM6AAAAAAZWWT7HA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: <miracl/MIRACL/issues/121/1611057645@github.com>