0

I need to generate RSA keys and it seems like openssl is the most common library that supports keys of length 3072. MinGW seems to come with pre-compiled libraries for it, so I tried linking -lcrypto and -lssl. However, when I just try to use

BIGNUM* someBigNum = BN_new();

I got the following error:

undefined reference to `BN_new'
collect2.exe: error: ld returned 1 exit status

What other library do I need to link?

Darth-CodeX
  • 2,166
  • 1
  • 6
  • 23
mingcr
  • 3
  • 6
  • What did you do to find out? Did you at least type the function name into your favorite web search engine? – the busybee Apr 25 '22 at 09:03
  • @the-busybee Typing 'Openssl bignum linking' into google doesn't yield any relevant results and just typing 'openssl linking' yields posts like https://www.unix.com/programming/162567-linking-openssl-libcrypto-statically.html https://help.perforce.com/sourcepro/current/HTML/index.html#page/Rogue_Wave_Component_Builder_(RCB)/rcbbd-securecomm.18.5.html and https://stackoverflow.com/questions/4352573/linking-openssl-libraries-to-a-program all of which only mention lcrypto and lssl regardless of verion or OS – mingcr Apr 25 '22 at 09:20
  • Well, please put these information into your question by [edit]ing, so that we know what we need not to repeat. – the busybee Apr 25 '22 at 10:46

1 Answers1

1

BN_new is part of -lcrypto, but on Windows you may need to use -leay32

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40