g++undefinedwolfssl

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 wolfssl document

I didn'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


Solution

  • @zihao wang

    In order to use the MP API directly, you'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