0
#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

zihao wang
  • 17
  • 2

1 Answers1

0

@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

  • i have configure using './configure --enable-debug --disable-shared CFLAGS="-DWOLFSSL_PUBLIC_MP" && make && sudo make install' according to the example,but it didnot work .could you please go into more detail?thank you very much – zihao wang Mar 01 '23 at 03:45
  • If you build a static lib (`--disable-shared`), then you will need to link the static lib: `gcc -o ecc-params -I/usr/local/include ecc-params.c /usr/local/lib/libwolfssl.a -lm` – Eric Blankenhorn Mar 02 '23 at 14:19