using wolfssl mp_init() ,undefined reference to ‘sp_init’

huangapple go评论56阅读模式
英文:

using wolfssl mp_init() ,undefined reference to 'sp_init'

问题

#include <stdlib.h>
#include <unistd.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/sp.h>//cannot to include,why?
#include <wolfssl/wolfcrypt/sp_int.h>
using namespace std;
int main(int argc, char* arfv[]) {
    mp_int k;
    mp_init(&k);
    return 0;
}

I have configured the environment. Without mp_init(&k), it can be compiled. I didn't find how to use mp_int in the WolfSSL document.

I didn't find how to use mp_int in the WolfSSL document. I want to know how to use mp_init and mp_int to calculate in WolfSSL.


<details>
<summary>英文:</summary>

#include <stdlib.h>
#include <unistd.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/sp.h>//cannot to include,why?
#include <wolfssl/wolfcrypt/sp_int.h>
using namespace std;
int main(int argc, char* arfv[]) {
mp_int k;
mp_init(&k);
return 0;
}

I have configured the environment.without `mp_init(&amp;k)`, it can be compiled. I didn&#39;t find how to use mp_int in wolfssl document


I didn&#39;t find how to use mp_int in wolfssl document.i want to know how to use mp_init and mp_int to calculate in wolfssl

</details>


# 答案1
**得分**: 0

为了直接使用MP API,您需要配置库以使用配置定义`WOLFSSL_PUBLIC_MP`将它们公开。

以下是示例链接:
https://github.com/wolfSSL/wolfssl-examples/blob/master/ecc/ecc-params.c

<details>
<summary>英文:</summary>

@zihao wang

In order to use the MP API directly, you&#39;ll need to configure the library to expose them as public using the configuration define `WOLFSSL_PUBLIC_MP`

Here is an example:
https://github.com/wolfSSL/wolfssl-examples/blob/master/ecc/ecc-params.c

</details>



huangapple
  • 本文由 发表于 2023年2月27日 15:01:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75577539.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定