• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/openssl-1.0.2h/demos/engines/rsaref/

Lines Matching refs:to

2  * Demo of how to construct your own engine and using it.  The basis of this
34 * Functions to handle the engine
54 unsigned char *to, RSA *rsa, int padding);
56 unsigned char *to, RSA *rsa, int padding);
58 unsigned char *to, RSA *rsa, int padding);
60 unsigned char *to, RSA *rsa, int padding);
212 * Functions to handle the engine
274 /* Initiator which is only present to make sure this engine looks available */
280 /* Finisher which is only present to make sure this engine looks available */
310 /* unsigned char *to: [max] */
311 static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max)
321 memset(to, 0, (unsigned int)max);
322 if (!BN_bn2bin(from, &(to[max - i])))
329 static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max)
338 ret = BN_bin2bn(&(from[i]), max - i, to);
342 static int RSAref_Public_ref2eay(RSArefPublicKey * from, RSA *to)
344 to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN);
345 to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN);
346 if ((to->n == NULL) || (to->e == NULL))
352 static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY * to)
354 to->bits = BN_num_bits(from->n);
355 if (!RSAref_bn2bin(from->n, to->modulus, MAX_RSA_MODULUS_LEN))
357 if (!RSAref_bn2bin(from->e, to->exponent, MAX_RSA_MODULUS_LEN))
363 static int RSAref_Private_ref2eay(RSArefPrivateKey * from, RSA *to)
365 if ((to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN)) == NULL)
367 if ((to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN)) == NULL)
369 if ((to->d = RSAref_bin2bn(from->d, NULL, RSAref_MAX_LEN)) == NULL)
371 if ((to->p =
374 if ((to->q =
377 if ((to->dmp1 = RSAref_bin2bn(from->pexp[0], NULL, RSAref_MAX_PLEN))
380 if ((to->dmq1 = RSAref_bin2bn(from->pexp[1], NULL, RSAref_MAX_PLEN))
383 if ((to->iqmp = RSAref_bin2bn(from->coef, NULL, RSAref_MAX_PLEN)) == NULL)
389 static int RSAref_Private_eay2ref(RSA *from, R_RSA_PRIVATE_KEY * to)
391 to->bits = BN_num_bits(from->n);
392 if (!RSAref_bn2bin(from->n, to->modulus, MAX_RSA_MODULUS_LEN))
394 if (!RSAref_bn2bin(from->e, to->publicExponent, MAX_RSA_MODULUS_LEN))
396 if (!RSAref_bn2bin(from->d, to->exponent, MAX_RSA_MODULUS_LEN))
398 if (!RSAref_bn2bin(from->p, to->prime[0], MAX_RSA_PRIME_LEN))
400 if (!RSAref_bn2bin(from->q, to->prime[1], MAX_RSA_PRIME_LEN))
402 if (!RSAref_bn2bin(from->dmp1, to->primeExponent[0], MAX_RSA_PRIME_LEN))
404 if (!RSAref_bn2bin(from->dmq1, to->primeExponent[1], MAX_RSA_PRIME_LEN))
406 if (!RSAref_bn2bin(from->iqmp, to->coefficient, MAX_RSA_PRIME_LEN))
412 unsigned char *to, RSA *rsa, int padding)
420 RSAPrivateDecrypt(to, (unsigned int *)&outlen, (unsigned char *)from,
431 unsigned char *to, RSA *rsa, int padding)
444 RSAPrivateEncrypt(to, (unsigned int *)&outlen, (unsigned char *)from,
455 unsigned char *to, RSA *rsa, int padding)
463 RSAPublicDecrypt(to, (unsigned int *)&outlen, (unsigned char *)from,
474 unsigned char *to, RSA *rsa, int padding)
499 RSAPublicEncrypt(to, (unsigned int *)&outlen, (unsigned char *)from,