diff options
Diffstat (limited to 'demos/engines/rsaref')
-rw-r--r-- | demos/engines/rsaref/rsaref.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/demos/engines/rsaref/rsaref.c b/demos/engines/rsaref/rsaref.c index 498cc7098f..b6429de1a7 100644 --- a/demos/engines/rsaref/rsaref.c +++ b/demos/engines/rsaref/rsaref.c @@ -324,31 +324,6 @@ static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max) return (1); } -#ifdef undef -/* unsigned char *from: [max] */ -static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max) -{ - int i; - BIGNUM *ret; - - for (i = 0; i < max; i++) - if (from[i]) - break; - - ret = BN_bin2bn(&(from[i]), max - i, to); - return (ret); -} - -static int RSAref_Public_ref2eay(RSArefPublicKey * from, RSA *to) -{ - to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN); - to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN); - if ((to->n == NULL) || (to->e == NULL)) - return (0); - return (1); -} -#endif - static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY * to) { to->bits = BN_num_bits(from->n); @@ -359,33 +334,6 @@ static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY * to) return (1); } -#ifdef undef -static int RSAref_Private_ref2eay(RSArefPrivateKey * from, RSA *to) -{ - if ((to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN)) == NULL) - return (0); - if ((to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN)) == NULL) - return (0); - if ((to->d = RSAref_bin2bn(from->d, NULL, RSAref_MAX_LEN)) == NULL) - return (0); - if ((to->p = - RSAref_bin2bn(from->prime[0], NULL, RSAref_MAX_PLEN)) == NULL) - return (0); - if ((to->q = - RSAref_bin2bn(from->prime[1], NULL, RSAref_MAX_PLEN)) == NULL) - return (0); - if ((to->dmp1 = RSAref_bin2bn(from->pexp[0], NULL, RSAref_MAX_PLEN)) - == NULL) - return (0); - if ((to->dmq1 = RSAref_bin2bn(from->pexp[1], NULL, RSAref_MAX_PLEN)) - == NULL) - return (0); - if ((to->iqmp = RSAref_bin2bn(from->coef, NULL, RSAref_MAX_PLEN)) == NULL) - return (0); - return (1); -} -#endif - static int RSAref_Private_eay2ref(RSA *from, R_RSA_PRIVATE_KEY * to) { to->bits = BN_num_bits(from->n); |