<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div>A naïve question.</div><div><br></div><div>OpenSSL RSA engine (RSAX) by Intel wants to call function mod<i>_</i>exp<i>_</i>512() that is defined somewhere else. I checked, and that function is not defined anywhere in the sources of either OpenSSL-1.0.2h-dev, or OpenSSL-1.1.0-pre.</div><div><p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">$ clang -shared -o eng_rsax.so eng_rsax.o -L/opt/local/lib -lcrypto</p>
<p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">Undefined symbols for architecture x86_64:</p>
<p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">  "_mod_exp_512", referenced from:</p>
<p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">      _e_rsax_bn_mod_exp in eng_rsax.o</p>
<p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">ld: symbol(s) not found for architecture x86_64</p>
<p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">clang: error: linker command failed with exit code 1 (use -v to see invocation)</p><p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">$ openssl version</p><p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">OpenSSL 1.0.2h-dev  xx XXX xxxx</p><p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">

</p><p style="margin: 0px; font-size: 16px; font-family: Monaco; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">$</p></div><div><br></div><div>Does it mean that this method has been deprecated and removed? If so, what functions should be used instead?</div><div><br></div><div>Also, this Intel-optimized engine (from 2010) seems to be geared towards RSA-1024, which isn’t considered adequate by now. Does it mean this engine has been deprecated as well, and shouldn’t be used (assuming one can link a valid shared library, resolving that undefined reference)?  Does the current OpenSSL RSA code contains optimizations proposed by that engine?</div><div><br></div><div>Thanks!</div><div><br></div><div>P.S. My OpenSSL-1.0.2h-dev installation was configured for darwin-x86_64-cc, and seems to function correctly. It also passed all the tests.</div><div><div>-- </div><div><div style="font-size: medium;">Regards,</div><div style="font-size: medium;">Uri Blumenthal</div></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> openssl-dev <<a href="mailto:openssl-dev-bounces@openssl.org">openssl-dev-bounces@openssl.org</a>> on behalf of Jeremy Farrell <<a href="mailto:jeremy.farrell@oracle.com">jeremy.farrell@oracle.com</a>><br><span style="font-weight:bold">Organization: </span> Oracle Corporation<br><span style="font-weight:bold">Reply-To: </span> openssl-dev <<a href="mailto:openssl-dev@openssl.org">openssl-dev@openssl.org</a>><br><span style="font-weight:bold">Date: </span> Monday, March 7, 2016 at 13:25 <br><span style="font-weight:bold">To: </span> openssl-dev <<a href="mailto:openssl-dev@openssl.org">openssl-dev@openssl.org</a>><br><span style="font-weight:bold">Subject: </span> Re: [openssl-dev] Errors when loading an OpenSSL RSA Engine<br></div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div bgcolor="#FFFFFF" text="#000099">
On 07/03/2016 17:56, Richard Levitte wrote:<br><blockquote cite="mid:20160307.185630.29267628196195539.levitte@openssl.org" type="cite"><pre wrap="">In message <a class="moz-txt-link-rfc2396E" href="mailto:1457369381041-64385.post@n7.nabble.com"><1457369381041-64385.post@n7.nabble.com></a> on Mon, 7 Mar 2016 09:49:41 -0700 (MST), danigrosu <a class="moz-txt-link-rfc2396E" href="mailto:dni.grosu@gmail.com"><dni.grosu@gmail.com></a> said:

dni.grosu> I want to build an OpenSSL RSA engine, starting from this existing
dni.grosu> source code file
dni.grosu> which is a faster method implemented by Intel. First of all I want to
dni.grosu> build this code so I'm using these commands:
dni.grosu> 
dni.grosu> gcc -fPIC -m64 -o eng_rsax.o -c eng_rsax.c
dni.grosu> gcc -shared -o eng_rsax.so -lcrypto eng_rsax.o

You might want to try this:

    gcc -shared -o eng_rsax.so eng_rsax.o -lcrypto

When linking, order is important.
</pre></blockquote><br>
In the spirit of teaching to fish, this could have been discovered by looking at the makefiles which build the engine. Those aren't always easy to decipher, so an alternative would have been just to build that OpenSSL release and look at all the output lines
 from the build which mention eng_rsax.<br><pre class="moz-signature" cols="72">-- 
J. J. Farrell
</pre></div></div></blockquote></span></body></html>