Calling the following method produces a segmentation fault on the BN_bin2bn
call:
#include <openssl/ec.h>
#define ECIES_PUBLIC_KEY_SIZE 32
static int doBin2Bn(const uint8_t* someValue)
{
BIGNUM *bn = NULL;
bn = BN_new();
BN_bin2bn(someValue, ECIES_PUBLIC_KEY_SIZE, bn);
}
The value of someValue
in %02x
format is 33313338
.
Why would this cause a seg fault?