blob: e819c5f2390dc24ab16685699624b3adbff1b0f7 [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001/*
Damien Miller4af51302000-04-16 11:18:38 +10002 *
Damien Miller95def091999-11-25 00:26:21 +11003 * rsa.h
Damien Miller4af51302000-04-16 11:18:38 +10004 *
Damien Miller95def091999-11-25 00:26:21 +11005 * Author: Tatu Ylonen <ylo@cs.hut.fi>
Damien Miller4af51302000-04-16 11:18:38 +10006 *
Damien Miller95def091999-11-25 00:26:21 +11007 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
Damien Miller4af51302000-04-16 11:18:38 +10009 *
Damien Miller95def091999-11-25 00:26:21 +110010 * Created: Fri Mar 3 22:01:06 1995 ylo
Damien Miller4af51302000-04-16 11:18:38 +100011 *
Damien Miller95def091999-11-25 00:26:21 +110012 * RSA key generation, encryption and decryption.
Damien Miller4af51302000-04-16 11:18:38 +100013 *
Damien Millerd4a8b7e1999-10-27 13:42:43 +100014*/
15
Damien Miller4af51302000-04-16 11:18:38 +100016/* RCSID("$Id: rsa.h,v 1.8 2000/04/16 01:18:45 damien Exp $"); */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100017
18#ifndef RSA_H
19#define RSA_H
20
Damien Miller95def091999-11-25 00:26:21 +110021#include "config.h"
22
Damien Miller7f6ea021999-10-28 13:25:17 +100023#ifdef HAVE_OPENSSL
Damien Millerd4a8b7e1999-10-27 13:42:43 +100024#include <openssl/bn.h>
25#include <openssl/rsa.h>
Damien Millerf07390e2000-01-29 20:40:22 +110026#include <openssl/rand.h>
Damien Miller7f6ea021999-10-28 13:25:17 +100027#endif
28
29#ifdef HAVE_SSL
30#include <ssl/bn.h>
31#include <ssl/rsa.h>
Damien Millerf07390e2000-01-29 20:40:22 +110032#include <ssl/rand.h>
Damien Miller7f6ea021999-10-28 13:25:17 +100033#endif
Damien Millerd4a8b7e1999-10-27 13:42:43 +100034
35/* Calls SSL RSA_generate_key, only copies to prv and pub */
Damien Miller95def091999-11-25 00:26:21 +110036void rsa_generate_key(RSA * prv, RSA * pub, unsigned int bits);
Damien Millerd4a8b7e1999-10-27 13:42:43 +100037
Damien Miller5428f641999-11-25 11:54:57 +110038/*
39 * Indicates whether the rsa module is permitted to show messages on the
40 * terminal.
41 */
Damien Miller95def091999-11-25 00:26:21 +110042void rsa_set_verbose __P((int verbose));
Damien Millerd4a8b7e1999-10-27 13:42:43 +100043
Damien Miller95def091999-11-25 00:26:21 +110044int rsa_alive __P((void));
Damien Millerd4a8b7e1999-10-27 13:42:43 +100045
Damien Miller95def091999-11-25 00:26:21 +110046void rsa_public_encrypt __P((BIGNUM * out, BIGNUM * in, RSA * prv));
47void rsa_private_decrypt __P((BIGNUM * out, BIGNUM * in, RSA * prv));
Damien Millerd4a8b7e1999-10-27 13:42:43 +100048
Damien Miller95def091999-11-25 00:26:21 +110049#endif /* RSA_H */