<?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 — 'ecc_mul2add()' cannot be used]]></title>
		<link>https://www.wolfssl.com/forums/topic2002-eccmul2add-cannot-be-used.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2002.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in 'ecc_mul2add()' cannot be used.]]></description>
		<lastBuildDate>Thu, 13 Apr 2023 20:14:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: 'ecc_mul2add()' cannot be used]]></title>
			<link>https://www.wolfssl.com/forums/post7095.html#p7095</link>
			<description><![CDATA[<p>A lot of the math functions your are trying to use are gated because they are not typically used by applications. I can&#039;t really give you a &quot;guide&quot; to exposing these API. You should review the header files, as they are a pretty good indicator if a function is gated.</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Thu, 13 Apr 2023 20:14:14 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7095.html#p7095</guid>
		</item>
		<item>
			<title><![CDATA[Re: 'ecc_mul2add()' cannot be used]]></title>
			<link>https://www.wolfssl.com/forums/post7092.html#p7092</link>
			<description><![CDATA[<p>Hello Eric,<br />&nbsp; &nbsp; It worked, thank you very much for your patient answer, I also want to know which file or document or source code should I check when I encounter the problem of undefined reference to &#039;xxx&#039; to know what content should be added to compile, I&nbsp; saw the ifdef &#039;yyy&#039; in front of the &#039;xxx&#039; function in the source code before, and then I know that &#039;yyy&#039; should be added when compiling, but it seems that this method does not always work, so I want to know if you have any way to know&nbsp; What is added at compile time.</p><p>Thanks again,<br />Wangzihao</p>]]></description>
			<author><![CDATA[null@example.com (wangzihao)]]></author>
			<pubDate>Thu, 13 Apr 2023 01:34:06 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7092.html#p7092</guid>
		</item>
		<item>
			<title><![CDATA[Re: 'ecc_mul2add()' cannot be used]]></title>
			<link>https://www.wolfssl.com/forums/post7091.html#p7091</link>
			<description><![CDATA[<p>Hi wangzihao,</p><p>The --enable-fpecc option enables Fixed Point cache ECC. It is not required to use ecc_mul2add. </p><p>You do need to make the function public by adding -DWOLFSSL_PUBLIC_ECC_ADD_DBL to CFLAGS</p><p>Please keep these questions coming! We are happy to help others learn!</p><p>Thanks,<br />Eric</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Wed, 12 Apr 2023 15:26:00 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7091.html#p7091</guid>
		</item>
		<item>
			<title><![CDATA['ecc_mul2add()' cannot be used]]></title>
			<link>https://www.wolfssl.com/forums/post7090.html#p7090</link>
			<description><![CDATA[<p>I checked the original code and found that FP_ECC needs to be compiled.I have added --enable-ecclshamir and --enable-fpecc when compiling, but it still prompts undefined reference to &#039;ecc_mul2add()&#039; when compiling.And I did not find an example of &#039;ecc_mul2add()&#039; in the test file.I&#039;m so sorry to bother you with this stupid question.Here is my compile command：‘./configure --enable-eccshamir --enable-fpecc --enable-opensslextra --enable-ecc --enable-ecccustcurves CFLAGS=&quot;-DWOLFSSL_TEST_CERT -DWOLFSSL_DER_TO_PEM -DHAVE_ECC_KOBLITZ -DWOLFSSL_PUBLIC_MP -DUSE_ECC_B_PARAM&quot;&amp;&amp;make&amp;&amp;sudo make install’<br /></p><div class="codebox"><pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;unistd.h&gt;
#include &lt;wolfssl/options.h&gt;
#include &lt;wolfssl/wolfcrypt/settings.h&gt;
#include &lt;wolfssl/ssl.h&gt;
#include &lt;wolfssl/wolfcrypt/types.h&gt;
#include &lt;wolfssl/wolfcrypt/random.h&gt;
#include &lt;wolfssl/wolfcrypt/ecc.h&gt;
#include &lt;wolfssl/wolfcrypt/sp_int.h&gt;
#include &lt;wolfssl/wolfcrypt/integer.h&gt;
#include &lt;wolfssl/wolfcrypt/wolfmath.h&gt;
#include &lt;wolfssl/wolfcrypt/sha.h&gt;
#include &lt;wolfssl/wolfcrypt/error-crypt.h&gt;
#include &lt;wolfssl/wolfcrypt/hash.h&gt;
#include &lt;wolfssl/wolfcrypt/asn.h&gt;
#include &lt;wolfssl/wolfcrypt/aes.h&gt;
//#include &lt;wolfssl/wolfcrypt/sp.h&gt;
using namespace std;
int main(){
 
    ecc_key key;
    int ret;
    WC_RNG rng;
    wc_ecc_init(&amp;key);
    wc_InitRng(&amp;rng);
    int curveId = ECC_SECP256R1;
    int keySize = wc_ecc_get_curve_size_from_id(curveId);
    ret = wc_ecc_make_key_ex(&amp;rng, keySize, &amp;key, curveId);
    if (ret != MP_OKAY) {
    // error handling
    }
 
    //ecc_projective_add_point();
    ecc_point *point_a = wc_ecc_new_point();
    ecc_point *point_b = wc_ecc_new_point();
 
    mp_int num1,num2,num3;
    mp_init(&amp;num1);
    mp_init(&amp;num2);
    mp_init(&amp;num3);
    mp_set_int(&amp;num1,23);
    mp_set_int(&amp;num2,45);
    mp_add(&amp;num1,&amp;num2,&amp;num3);
 
    mp_int a,b,prime,order,num;
    mp_init_multi(&amp;a,&amp;b,&amp;prime,&amp;order,&amp;num,NULL);
    ret = mp_read_radix(&amp;a,key.dp-&gt;Af,16);
    cout&lt;&lt;&quot;get mp_int af: &quot;&lt;&lt;ret&lt;&lt;endl;
    ret = mp_read_radix(&amp;b,key.dp-&gt;Bf,16);
    cout&lt;&lt;&quot;get mp_int bf: &quot;&lt;&lt;ret&lt;&lt;endl;
    ret = mp_read_radix(&amp;prime,key.dp-&gt;prime,16);
    cout&lt;&lt;&quot;get mp_int prime: &quot;&lt;&lt;ret&lt;&lt;endl;
    ret = mp_read_radix(&amp;order,key.dp-&gt;order,16);
    cout&lt;&lt;&quot;get mp_int order: &quot;&lt;&lt;ret&lt;&lt;endl;
    ret = wc_ecc_gen_k(&amp;rng,32,&amp;num,&amp;order);
    cout&lt;&lt;&quot;get mp_int num: &quot;&lt;&lt;ret&lt;&lt;endl;
 
    ecc_point* point = wc_ecc_new_point();
    //ecc_point* point_res = wc_ecc_new_point();
    ret = wc_ecc_get_generator(point,wc_ecc_get_curve_idx(ECC_SECP256R1));
    cout&lt;&lt;&quot;get ecc_point point: &quot;&lt;&lt;ret&lt;&lt;endl;
 
    ret = wc_ecc_mulmod(&amp;num1,point,point_a,&amp;a,&amp;prime,1);
    cout&lt;&lt;&quot;num1 * point: &quot;&lt;&lt;ret&lt;&lt;endl;
    ret = wc_ecc_mulmod(&amp;num2,point,point_b,&amp;a,&amp;prime,1);
    cout&lt;&lt;&quot;num2 * point: &quot;&lt;&lt;ret&lt;&lt;endl;
 
    mp_int ka,kb;
    mp_init(&amp;ka);
    mp_init(&amp;kb);
    mp_set_int(&amp;ka,1);
    mp_set_int(&amp;kb,1);
 
    ecc_point* point_c = wc_ecc_new_point();
 
    ret = ecc_mul2add(point_a,&amp;ka,point_b,&amp;kb,point_c,&amp;a,&amp;prime,NULL);
    cout&lt;&lt;&quot;ecc_mul2add: &quot;&lt;&lt;ret&lt;&lt;endl;
 
 
    return 0;
    }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (wangzihao)]]></author>
			<pubDate>Wed, 12 Apr 2023 14:46:51 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7090.html#p7090</guid>
		</item>
	</channel>
</rss>
