/* * $Id: rsa_gmp.c,v 1.1 2005/03/21 05:23:44 jerub Exp $ * * This is the server-side RSA math support code that uses the GNU MP * library. Berkeley MP is no longer supported. No crypto code is * contained in this file. * * Originally written by Ray Jones. Updated by Dave Ahn. * */ #include #include "config.h" #include "rsa_gmp.h" /* convert from unsigned char array to GMP form */ void raw_to_num(mpz_t out, const unsigned char *in, const int digits) { int i; mpz_t temp; mpz_t twofiftysix; mpz_t thisval; mpz_init(temp); mpz_init(twofiftysix); mpz_init(thisval); mpz_set_ui(temp, 0); mpz_set_ui(twofiftysix, 256); for (i=0; i