65 #ifndef OPENSSL_NO_RSA
68 #ifndef OPENSSL_NO_DSA
77 #ifndef OPENSSL_NO_HW_NURON
79 #define NURON_LIB_NAME "nuron engine"
82 static const char *NURON_LIBNAME = NULL;
83 static const char *get_NURON_LIBNAME(
void)
89 static void free_NURON_LIBNAME(
void)
95 static long set_NURON_LIBNAME(
const char *name)
98 return (((NURON_LIBNAME =
BUF_strdup(name)) != NULL) ? 1 : 0);
100 static const char *NURON_F1 =
"nuron_mod_exp";
103 #define NURON_CMD_SO_PATH ENGINE_CMD_BASE
107 "Specifies the path to the 'nuronssl' shared library",
115 static DSO *pvDSOHandle = NULL;
117 static int nuron_destroy(
ENGINE *
e)
119 free_NURON_LIBNAME();
120 ERR_unload_NURON_strings();
124 static int nuron_init(
ENGINE *
e)
126 if(pvDSOHandle != NULL)
132 pvDSOHandle =
DSO_load(NULL, get_NURON_LIBNAME(), NULL,
150 static int nuron_finish(
ENGINE *e)
152 free_NURON_LIBNAME();
153 if(pvDSOHandle == NULL)
168 static int nuron_ctrl(
ENGINE *e,
int cmd,
long i,
void *
p,
void (*
f)(
void))
170 int initialised = ((pvDSOHandle == NULL) ? 0 : 1);
184 return set_NURON_LIBNAME((
const char *)p);
200 return pfnModExp(r,a,p,m);
203 #ifndef OPENSSL_NO_RSA
206 return nuron_mod_exp(r0,I,rsa->
d,rsa->
n,ctx);
210 #ifndef OPENSSL_NO_DSA
227 if (!nuron_mod_exp(rr,a1,p1,m,ctx))
230 if (!nuron_mod_exp(&t,a2,p2,m,ctx))
246 return nuron_mod_exp(r, a, p, m, ctx);
251 #ifndef OPENSSL_NO_RSA
255 return nuron_mod_exp(r, a, p, m, ctx);
259 #ifndef OPENSSL_NO_DH
261 static int nuron_mod_exp_dh(
const DH *dh,
BIGNUM *r,
265 return nuron_mod_exp(r, a, p, m, ctx);
269 #ifndef OPENSSL_NO_RSA
289 #ifndef OPENSSL_NO_DSA
307 #ifndef OPENSSL_NO_DH
323 static const char *engine_nuron_id =
"nuron";
324 static const char *engine_nuron_name =
"Nuron hardware engine support";
328 static int bind_helper(
ENGINE *e)
330 #ifndef OPENSSL_NO_RSA
333 #ifndef OPENSSL_NO_DSA
336 #ifndef OPENSSL_NO_DH
341 #ifndef OPENSSL_NO_RSA
344 #ifndef OPENSSL_NO_DSA
347 #ifndef OPENSSL_NO_DH
357 #ifndef OPENSSL_NO_RSA
372 #ifndef OPENSSL_NO_DSA
381 #ifndef OPENSSL_NO_DH
389 ERR_load_NURON_strings();
393 #ifdef OPENSSL_NO_DYNAMIC_ENGINE
394 static ENGINE *engine_nuron(
void)
399 if(!bind_helper(ret))
410 ENGINE *toadd = engine_nuron();
420 #ifndef OPENSSL_NO_DYNAMIC_ENGINE
421 static int bind_fn(
ENGINE *e,
const char *
id)
423 if(
id && (strcmp(
id, engine_nuron_id) != 0))