i have configured using commond ./configure --enable-debug --disable-shared CFLAGS="-DWOLFSSL_PUBLIC_MP" && make && sudo make install
referring to enter link description here
1: https://github.com/wolfSSL/wolfssl-examples/blob/master/ecc/ecc-params.c,but it didnot work,maybe is it the problem of my raspberryPi4? this is the test code
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdint.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/sp_int.h>
int test() {
#if defined(HAVAE_ECC)&&defined(WOLFSSL_PUBLIC_MP)
mp_int p;
mp_init(&p);
ecc_key key;
int ret;
WC_RNG rng;
wc_ecc_init(&key);
wc_InitRng(&rng);
int curveId = ECC_SECP521R1;
int keySize = wc_ecc_get_curve_size_from_id(curveId);
ret = wc_ecc_make_key_ex(&rng, keySize, &key, curveId);
if (ret != MP_OKAY) {
// error handling
}
char* str;
int ret1 = mp_toradix(key.k, str, 10);
cout << str << endl;
#endif
}
int main() {
test();
}
i used g++ file.cpp -lwolfssl -o file. it told me that undefined referrence sp_init();