rsa.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
4134N/A * Author: Tatu Ylonen <ylo@cs.hut.fi> 4134N/A * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4134N/A * As far as I am concerned, the code I have written for this software 4134N/A * can be used freely for any purpose. Any derived versions of this 4134N/A * software must be clearly marked as such, and if the derived work is 6983N/A * incompatible with the protocol description in the RFC file, it must be 6983N/A * called by a name other than "ssh" or "Secure Shell". 4134N/A * Copyright (c) 1999 Niels Provos. All rights reserved. 6983N/A * Redistribution and use in source and binary forms, with or without 6983N/A * modification, are permitted provided that the following conditions 6983N/A * 1. Redistributions of source code must retain the above copyright 4134N/A * notice, this list of conditions and the following disclaimer. 4134N/A * 2. Redistributions in binary form must reproduce the above copyright 4134N/A * notice, this list of conditions and the following disclaimer in the 4134N/A * documentation and/or other materials provided with the distribution. 4158N/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 6143N/A * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 4134N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 4134N/A * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 4134N/A * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 5726N/A * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5726N/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6143N/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 4926N/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 4134N/A * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4134N/A * Description of the RSA algorithm can be found e.g. from the following 4134N/A * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1994. 4926N/A * Jennifer Seberry and Josed Pieprzyk: Cryptography: An Introduction to 6143N/A * Computer Security. Prentice-Hall, 1989. 5734N/A * Man Young Rhee: Cryptography and Secure Data Communications. McGraw-Hill, 6143N/A * R. Rivest, A. Shamir, and L. M. Adleman: Cryptographic Communications 4609N/A * System and Method. US Patent 4,405,829, 1983. 4134N/A * Hans Riesel: Prime Numbers and Computer Methods for Factorization. 5726N/A * The RSA Frequently Asked Questions document by RSA Data Security, 4134N/A * RSA in 3 lines of perl by Adam Back <aba@atlax.ex.ac.uk>, 1995, as 5734N/A * [gone - had to be deleted - what a pity] 5734N/A#
pragma ident "%Z%%M% %I% %E% SMI" 5734N/A fatal(
"rsa_public_encrypt() exponent too small or not odd");
5734N/A fatal(
"rsa_generate_additional_parameters: BN_new failed");
5734N/A fatal(
"rsa_generate_additional_parameters: BN_CTX_new failed");