<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Time differences against benchmark [Cortex-M4] and USE_FAST_MATH]]></title>
		<link>https://www.wolfssl.com/forums/topic744-time-differences-against-benchmark-cortexm4-and-usefastmath.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic744.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Time differences against benchmark [Cortex-M4] and USE_FAST_MATH.]]></description>
		<lastBuildDate>Sun, 22 Nov 2015 14:31:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Time differences against benchmark [Cortex-M4] and USE_FAST_MATH]]></title>
			<link>https://www.wolfssl.com/forums/post2341.html#p2341</link>
			<description><![CDATA[<div class="quotebox"><cite>chrisc wrote:</cite><blockquote><p>Hi jurkovi,</p><p>What Cortex-M4 processor are you using for your benchmarks?&nbsp; And what public key size are you using (1024, 2048, 4096, ...)?</p><p>Are you using the wolfCrypt benchmark application to run the benchmarks?</p><p>Thanks,<br />Chris</p></blockquote></div><p>Hi Chris,<br />sorry for not including the specifications:<br />I use TM4C123GH6PMI Cortex-M4 80 Mhz.</p><p>This is the first time I am working with a microcontroller, so I might have made a mistake somewhere. <br />The times on web are for 120 Mhz, but these are longer times, encrypting in order of magnitude, and decrypting 4x-longer. </p><br /><p>When I used the same commands, I got <br />RSA 2048 encrypting: 620 ms<br />RSA 2048 decrypting: 5510 ms</p><p>Commands:<br />1191-byte DER-key inicialized in code (copied from benchmark.c)</p><p>&nbsp; &nbsp; </p><div class="codebox"><pre><code>// RSA crypting:

    int derSz = 1191;
    word32 idx = 0;    
    byte      message [] = &quot;Everyone gets Friday off.&quot;;
    const int len = (int)strlen((char*)message);
    byte      enc[256];
    RNG rng; wc_InitRng(&amp;rng);    
    wc_InitRsaKey(&amp;rsaKey, NULL);     
    ret = wc_RsaPrivateKeyDecode(DERarray, &amp;idx, &amp;rsaKey, derSz);       
    word32 ciphreLen = wc_RsaPublicEncrypt(message, len, enc, sizeof(enc), &amp;rsaKey, &amp;rng);        

// RSA decrypting:
    
    byte  out[256];    
    wc_RsaPrivateDecrypt(enc, ciphreLen, out, sizeof(out), &amp;rsaKey);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (jurkovi)]]></author>
			<pubDate>Sun, 22 Nov 2015 14:31:17 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2341.html#p2341</guid>
		</item>
		<item>
			<title><![CDATA[Re: Time differences against benchmark [Cortex-M4] and USE_FAST_MATH]]></title>
			<link>https://www.wolfssl.com/forums/post2336.html#p2336</link>
			<description><![CDATA[<p>Hi jurkovi,</p><p>What Cortex-M4 processor are you using for your benchmarks?&nbsp; And what public key size are you using (1024, 2048, 4096, ...)?</p><p>Are you using the wolfCrypt benchmark application to run the benchmarks?</p><p>Thanks,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Thu, 19 Nov 2015 23:55:30 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2336.html#p2336</guid>
		</item>
		<item>
			<title><![CDATA[Time differences against benchmark [Cortex-M4] and USE_FAST_MATH]]></title>
			<link>https://www.wolfssl.com/forums/post2335.html#p2335</link>
			<description><![CDATA[<p><strong>Hi there,</strong></p><p>I&#039;m trying to test how time-demanding is RSA de/crypting and DSA signing and verifying on Cortex-M4 ARM microcontroller.<br />Now at least 2 things are unclear to me:</p><ul><li><p>According the <a href="https://www.wolfssl.com/wolfSSL/benchmarks-wolfssl.html#id41">benchmark</a> the RSA crypting should take 88 ms and decrypting 1456.000 ms. My times are 630ms resp. 5570 ms. What can make the difference?</p></li><li><p>According the documentation &quot;fastmath will speed up public key operations like RSA, DH, and DSA&quot;. <br />So I tried the USE_FAST_MATH directive, but the times were 500 ms rsp. 8200 ms. </p></li></ul><p>Does anybody have the similar experience, or know where do I make a mistake?</p><p>I use VisualGDB plugin for Visual Studio. These are directives (the first two commented for non-USE_FAST_MATH setup):</p><p>//#define USE_FAST_MATH<br />//#define TFM_TIMING_RESISTANT </p><p>#define WOLFCRYPT_ONLY<br />#define NO_DEV_RANDOM<br />#define NO_WRITEV<br />#define SINGLE_THREADED<br />#define NO_FILESYSTEM<br />#define NO_WRITEV<br />#define NO_TLS<br />#define NO_DH<br />#define WOLFSSL_USER_IO</p><br /><p>Thanks to anybody who could help.</p>]]></description>
			<author><![CDATA[null@example.com (jurkovi)]]></author>
			<pubDate>Thu, 19 Nov 2015 17:57:53 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2335.html#p2335</guid>
		</item>
	</channel>
</rss>
