Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 1 | /* |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 2 | * |
| 3 | * rsa.h |
| 4 | * |
| 5 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
| 6 | * |
| 7 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 8 | * All rights reserved |
| 9 | * |
| 10 | * Created: Fri Mar 3 22:01:06 1995 ylo |
| 11 | * |
| 12 | * RSA key generation, encryption and decryption. |
| 13 | * |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 14 | */ |
| 15 | |
Damien Miller | f07390e | 2000-01-29 20:40:22 +1100 | [diff] [blame^] | 16 | /* RCSID("$Id: rsa.h,v 1.6 2000/01/29 09:40:22 damien Exp $"); */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 17 | |
| 18 | #ifndef RSA_H |
| 19 | #define RSA_H |
| 20 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 21 | #include "config.h" |
| 22 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 23 | #ifdef HAVE_OPENSSL |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 24 | #include <openssl/bn.h> |
| 25 | #include <openssl/rsa.h> |
Damien Miller | f07390e | 2000-01-29 20:40:22 +1100 | [diff] [blame^] | 26 | #include <openssl/rand.h> |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 27 | #endif |
| 28 | |
| 29 | #ifdef HAVE_SSL |
| 30 | #include <ssl/bn.h> |
| 31 | #include <ssl/rsa.h> |
Damien Miller | f07390e | 2000-01-29 20:40:22 +1100 | [diff] [blame^] | 32 | #include <ssl/rand.h> |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 33 | #endif |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 34 | |
| 35 | /* Calls SSL RSA_generate_key, only copies to prv and pub */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 36 | void rsa_generate_key(RSA * prv, RSA * pub, unsigned int bits); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 37 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 38 | /* |
| 39 | * Indicates whether the rsa module is permitted to show messages on the |
| 40 | * terminal. |
| 41 | */ |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 42 | void rsa_set_verbose __P((int verbose)); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 43 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 44 | int rsa_alive __P((void)); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 45 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 46 | void rsa_public_encrypt __P((BIGNUM * out, BIGNUM * in, RSA * prv)); |
| 47 | void rsa_private_decrypt __P((BIGNUM * out, BIGNUM * in, RSA * prv)); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 48 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 49 | #endif /* RSA_H */ |