<div dir="ltr"><div dir="ltr">I've tested the speed with and without evp. evp is slower because Intel cpus don't have hardware acceleration for sha.</div><div>So it's best to leave it without evp for now. Thanks.<br></div><div dir="ltr">openssl speed sha1<br>openssl speed -evp sha1<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 8, 2019 at 1:06 PM Hans Nilsson R <<a href="mailto:hans.r.nilsson@ericsson.com">hans.r.nilsson@ericsson.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="text-align:left;direction:ltr">
<div>Yes it's possible to use the EVP_* functions. But it is nothing that we plan to do for the moment.</div>
<div><br>
</div>
<div>But pull-requests are always welcome :)</div>
<div><br>
</div>
<div>/Hans</div>
<div><br>
</div>
<div>On Tue, 2019-05-07 at 19:19 +0300, Ben Browitt wrote:</div>
<blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex">
<div dir="ltr">
<div>Profiling my server with eprof show that my app spends most of the time onĀ  crypto:hmac(sha, Key, Data) while crypto:stream_encrypt/2 using aes_ctr is much faster.</div>
<div><br>
</div>
<div>This answer [1] says that HMAC_* routines are software based and don't use hardware. The hmac nif seems to use them [2].
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Is my resolution correct?</div>
<div dir="ltr">Is it possible to use EVP_* functions instead of HMAC_* functions in the nif?</div>
<div dir="ltr"><br>
[1] <a href="https://stackoverflow.com/a/20322002" target="_blank">https://stackoverflow.com/a/20322002</a><br>
[2] <a href="https://protect2.fireeye.com/url?k=ff45ecfa-a3d7e1a6-ff45ac61-0cc47ad93d46-7719c85c2345896d&u=https://github.com/erlang/otp/blob/master/lib/crypto/c_src/hmac.c" target="_blank">
https://github.com/erlang/otp/blob/master/lib/crypto/c_src/hmac.c</a><br>
</div>
</div>
<pre>_______________________________________________</pre>
<pre>erlang-questions mailing list</pre>
<pre><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a></pre>
<pre><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></pre>
<pre><br></pre>
</blockquote>
</div>

</blockquote></div>