/*===========================================================================*/
/*   (Unsafe/rsa.scm)                                                        */
/*   Bigloo (4.5b)                                                           */
/*   Inria -- Sophia Antipolis (c)       Fri Dec 22 05:17:06 PM CET 2023     */
/*===========================================================================*/
/* COMPILATION: (/home/serrano/prgm/project/bigloo/bigloo/bin/bigloo -ldopt -L/home/serrano/prgm/project/bigloo/bigloo/libbacktrace/home/serrano/prgm/project/bigloo/bigloo/lib/bigloo/4.5b  -srfi enable-gmp -srfi bigloo-unsafe -O3 -fcfa-arithmetic -q -lib-dir /home/serrano/prgm/project/bigloo/bigloo/lib/bigloo/4.5b -rm -copt -w -lib-dir /home/serrano/prgm/project/bigloo/bigloo/lib/bigloo/4.5b -mklib -cc gcc -fsharing -q -no-hello -unsafe -safee -O4 -stdc -c Unsafe/rsa.scm -indent -o objs/obj_u/Unsafe/rsa.c) */
/* GC selection */
#define THE_GC BOEHM_GC

/* unsafe mode */
#define BIGLOO_UNSAFE 1

/* traces mode */
#define BIGLOO_TRACE 0

/* standard Bigloo include */
#include <bigloo.h>

#ifdef __cplusplus
extern "C"
{
#endif
#ifndef BGL_MODULE_TYPE_DEFINITIONS
#define BGL_MODULE_TYPE_DEFINITIONS
#ifndef BGL___RSA_TYPE_DEFINITIONS
#define BGL___RSA_TYPE_DEFINITIONS
#endif													// BGL___RSA_TYPE_DEFINITIONS
#endif													// BGL_MODULE_TYPE_DEFINITIONS

	static obj_t BGl_symbol2004z00zz__rsaz00 = BUNSPEC;
	extern obj_t BGl_u8vectorzd2ze3listz31zz__srfi4z00(obj_t);
	extern obj_t BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00(obj_t);
	static obj_t BGl_modzd2inversezd2zz__rsaz00(obj_t, obj_t);
	extern obj_t BGl_makezd2u8vectorzd2zz__srfi4z00(long, uint8_t);
	extern long BGl_modulofxz00zz__r4_numbers_6_5_fixnumz00(long, long);
	BGL_EXPORTED_DECL obj_t BGl_rsazd2encryptzd2stringz00zz__rsaz00(obj_t, obj_t);
	static obj_t BGl_z62PKCS1zd2padzb0zz__rsaz00(obj_t, obj_t, obj_t);
	static obj_t BGl_u8vectorzd2ze3bignumz31zz__rsaz00(obj_t);
	static obj_t BGl_requirezd2initializa7ationz75zz__rsaz00 = BUNSPEC;
	extern obj_t bgl_bignum_quotient(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_makezd2rsazd2keyzd2pairzd2zz__rsaz00(obj_t,
		obj_t);
	static obj_t BGl_u8vectorzd2appendzd2zz__rsaz00(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_PKCS1zd2unpadzd2zz__rsaz00(obj_t);
	static obj_t BGl_gcdzd2extzd2zz__rsaz00(obj_t, obj_t);
	static obj_t BGl_z62publiczd2rsazd2keyz62zz__rsaz00(obj_t, obj_t);
	extern obj_t BGl_typezd2errorzd2zz__errorz00(obj_t, obj_t, obj_t, obj_t,
		obj_t);
	BGL_EXPORTED_DECL obj_t BGl_modulezd2initializa7ationz75zz__rsaz00(long,
		char *);
	static obj_t BGl_keyword1987z00zz__rsaz00 = BUNSPEC;
	static obj_t BGl_keyword1989z00zz__rsaz00 = BUNSPEC;
	static obj_t BGl_list2003z00zz__rsaz00 = BUNSPEC;
	static obj_t BGl_z62rsazd2encryptzd2stringz62zz__rsaz00(obj_t, obj_t, obj_t);
	static obj_t BGl_subu8vectorz00zz__rsaz00(obj_t, long, long);
	extern obj_t BGl_listzd2ze3u8vectorz31zz__srfi4z00(obj_t);
	static obj_t BGl_toplevelzd2initzd2zz__rsaz00(void);
	BGL_EXPORTED_DECL obj_t BGl_rsazd2keyzd3z01zz__rsaz00(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_PKCS1zd2padzd2zz__rsaz00(obj_t, obj_t);
	extern obj_t create_struct(obj_t, int);
	static obj_t BGl_randomzd2primezd2zz__rsaz00(obj_t, obj_t, obj_t);
	static obj_t BGl_cnstzd2initzd2zz__rsaz00(void);
	static obj_t BGl_exptzd2modze70z35zz__rsaz00(obj_t, obj_t, obj_t);
	static obj_t BGl_genericzd2initzd2zz__rsaz00(void);
	extern long bgl_bignum_to_long(obj_t);
	static obj_t BGl_gczd2rootszd2initz00zz__rsaz00(void);
	extern obj_t bgl_bignum_remainder(obj_t, obj_t);
	static obj_t BGl_objectzd2initzd2zz__rsaz00(void);
	extern obj_t BGl_listzd2ze3stringz31zz__r4_strings_6_7z00(obj_t);
	extern obj_t BGl_2zd2zd2zz__r4_numbers_6_5z00(obj_t, obj_t);
	extern obj_t bgl_bignum_mul(obj_t, obj_t);
	static obj_t BGl_symbol1983z00zz__rsaz00 = BUNSPEC;
	extern bool_t BGl_2zc3zc3zz__r4_numbers_6_5z00(obj_t, obj_t);
	extern obj_t BGl_memqz00zz__r4_pairs_and_lists_6_3z00(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_rsazd2decryptzd2stringz00zz__rsaz00(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_publiczd2rsazd2keyz00zz__rsaz00(obj_t);
	static obj_t BGl_symbol1991z00zz__rsaz00 = BUNSPEC;
	static obj_t BGl_z62rsazd2encryptzd2u8vectorz62zz__rsaz00(obj_t, obj_t, obj_t,
		obj_t);
	static obj_t BGl_symbol1998z00zz__rsaz00 = BUNSPEC;
	static obj_t BGl__makezd2rsazd2keyzd2pairzd2zz__rsaz00(obj_t, obj_t);
	extern obj_t bgl_bignum_add(obj_t, obj_t);
	extern obj_t bstring_to_symbol(obj_t);
	extern bool_t bgl_bignum_even(obj_t);
	extern bool_t bgl_bignum_odd(obj_t);
	static obj_t BGl_z62rsazd2decryptzd2stringz62zz__rsaz00(obj_t, obj_t, obj_t);
	extern obj_t bgl_rand_bignum(obj_t);
	BGL_EXPORTED_DECL obj_t BGl_rsazd2encryptzd2u8vectorz00zz__rsaz00(obj_t,
		obj_t, obj_t);
	static obj_t BGl_z62PKCS1zd2unpadzb0zz__rsaz00(obj_t, obj_t);
	static obj_t BGl_list1986z00zz__rsaz00 = BUNSPEC;
	extern obj_t BGl_stringzd2ze3listz31zz__r4_strings_6_7z00(obj_t);
	static obj_t BGl_z62rsazd2keyzd3z63zz__rsaz00(obj_t, obj_t, obj_t);
	static obj_t BGl_z62rsazd2decryptzd2u8vectorz62zz__rsaz00(obj_t, obj_t,
		obj_t);
	static obj_t BGl_methodzd2initzd2zz__rsaz00(void);
	static obj_t BGl_bignumzd2ze3u8vectorz31zz__rsaz00(obj_t);
	extern obj_t bgl_bignum_expt(obj_t, obj_t);
	BGL_EXPORTED_DECL obj_t BGl_privatezd2rsazd2keyz00zz__rsaz00(obj_t);
	static obj_t BGl_z62privatezd2rsazd2keyz62zz__rsaz00(obj_t, obj_t);
	extern obj_t BGl_modulobxz00zz__r4_numbers_6_5_fixnumz00(obj_t, obj_t);
	extern obj_t bstring_to_keyword(obj_t);
	BGL_EXPORTED_DECL obj_t BGl_rsazd2decryptzd2u8vectorz00zz__rsaz00(obj_t,
		obj_t);
	extern obj_t bgl_bignum_sub(obj_t, obj_t);
	extern int bgl_bignum_cmp(obj_t, obj_t);
	extern obj_t bgl_long_to_bignum(long);
	extern obj_t BGl_errorz00zz__errorz00(obj_t, obj_t, obj_t);
	static obj_t BGl_symbol2000z00zz__rsaz00 = BUNSPEC;
	static obj_t *__cnst;


	   
		 
		DEFINE_EXPORT_BGL_PROCEDURE(BGl_makezd2rsazd2keyzd2pairzd2envz00zz__rsaz00,
		BgL_bgl__makeza7d2rsaza7d2ke2010z00, opt_generic_entry,
		BGl__makezd2rsazd2keyzd2pairzd2zz__rsaz00, BFALSE, -1);
	      DEFINE_STRING(BGl_string1981z00zz__rsaz00,
		BgL_bgl_string1981za700za7za7_2011za7, ".", 1);
	      DEFINE_STRING(BGl_string1982z00zz__rsaz00,
		BgL_bgl_string1982za700za7za7_2012za7, "+", 1);
	      DEFINE_STRING(BGl_string1984z00zz__rsaz00,
		BgL_bgl_string1984za700za7za7_2013za7, "mod-inverse", 11);
	      DEFINE_STRING(BGl_string1985z00zz__rsaz00,
		BgL_bgl_string1985za700za7za7_2014za7,
		"internal error, numbers are not relatively prime", 48);
	      DEFINE_STRING(BGl_string1988z00zz__rsaz00,
		BgL_bgl_string1988za700za7za7_2015za7, "show-trace", 10);
	      DEFINE_EXPORT_BGL_PROCEDURE(BGl_PKCS1zd2padzd2envz00zz__rsaz00,
		BgL_bgl_za762pkcs1za7d2padza7b2016za7, BGl_z62PKCS1zd2padzb0zz__rsaz00, 0L,
		BUNSPEC, 2);
	      DEFINE_STRING(BGl_string1990z00zz__rsaz00,
		BgL_bgl_string1990za700za7za7_2017za7, "size", 4);
	      DEFINE_STRING(BGl_string1992z00zz__rsaz00,
		BgL_bgl_string1992za700za7za7_2018za7, "make-rsa-key-pair", 17);
	      DEFINE_STRING(BGl_string1993z00zz__rsaz00,
		BgL_bgl_string1993za700za7za7_2019za7, "Illegal keyword argument", 24);
	      DEFINE_STRING(BGl_string1994z00zz__rsaz00,
		BgL_bgl_string1994za700za7za7_2020za7,
		"wrong number of arguments: [0..2] expected, provided", 52);
	      DEFINE_STRING(BGl_string1995z00zz__rsaz00,
		BgL_bgl_string1995za700za7za7_2021za7, "/tmp/bigloo/runtime/Unsafe/rsa.scm",
		34);
	      DEFINE_STRING(BGl_string1996z00zz__rsaz00,
		BgL_bgl_string1996za700za7za7_2022za7, "_make-rsa-key-pair", 18);
	      DEFINE_STRING(BGl_string1997z00zz__rsaz00,
		BgL_bgl_string1997za700za7za7_2023za7, "bint", 4);
	      DEFINE_STRING(BGl_string1999z00zz__rsaz00,
		BgL_bgl_string1999za700za7za7_2024za7, "rsa-key", 7);
	      DEFINE_EXPORT_BGL_PROCEDURE(BGl_publiczd2rsazd2keyzd2envzd2zz__rsaz00,
		BgL_bgl_za762publicza7d2rsaza72025za7,
		BGl_z62publiczd2rsazd2keyz62zz__rsaz00, 0L, BUNSPEC, 1);
	      DEFINE_EXPORT_BGL_PROCEDURE(BGl_rsazd2keyzd3zd2envzd3zz__rsaz00,
		BgL_bgl_za762rsaza7d2keyza7d3za72026z00, BGl_z62rsazd2keyzd3z63zz__rsaz00,
		0L, BUNSPEC, 2);
	     
		DEFINE_EXPORT_BGL_PROCEDURE(BGl_rsazd2decryptzd2u8vectorzd2envzd2zz__rsaz00,
		BgL_bgl_za762rsaza7d2decrypt2027z00,
		BGl_z62rsazd2decryptzd2u8vectorz62zz__rsaz00, 0L, BUNSPEC, 2);
	      DEFINE_EXPORT_BGL_PROCEDURE(BGl_privatezd2rsazd2keyzd2envzd2zz__rsaz00,
		BgL_bgl_za762privateza7d2rsa2028z00,
		BGl_z62privatezd2rsazd2keyz62zz__rsaz00, 0L, BUNSPEC, 1);
	      DEFINE_STRING(BGl_string2001z00zz__rsaz00,
		BgL_bgl_string2001za700za7za7_2029za7, "PKCS1-pad", 9);
	      DEFINE_STRING(BGl_string2002z00zz__rsaz00,
		BgL_bgl_string2002za700za7za7_2030za7,
		"not enough space is available for proper padding", 48);
	      DEFINE_STRING(BGl_string2005z00zz__rsaz00,
		BgL_bgl_string2005za700za7za7_2031za7, "PKCS1-unpad", 11);
	      DEFINE_STRING(BGl_string2006z00zz__rsaz00,
		BgL_bgl_string2006za700za7za7_2032za7, "improperly padded message", 25);
	      DEFINE_STRING(BGl_string2007z00zz__rsaz00,
		BgL_bgl_string2007za700za7za7_2033za7, "&rsa-encrypt-string", 19);
	      DEFINE_STRING(BGl_string2008z00zz__rsaz00,
		BgL_bgl_string2008za700za7za7_2034za7, "bstring", 7);
	      DEFINE_STRING(BGl_string2009z00zz__rsaz00,
		BgL_bgl_string2009za700za7za7_2035za7, "&rsa-decrypt-string", 19);
	     
		DEFINE_EXPORT_BGL_PROCEDURE(BGl_rsazd2encryptzd2u8vectorzd2envzd2zz__rsaz00,
		BgL_bgl_za762rsaza7d2encrypt2036z00,
		BGl_z62rsazd2encryptzd2u8vectorz62zz__rsaz00, 0L, BUNSPEC, 3);
	      DEFINE_EXPORT_BGL_PROCEDURE(BGl_PKCS1zd2unpadzd2envz00zz__rsaz00,
		BgL_bgl_za762pkcs1za7d2unpad2037z00, BGl_z62PKCS1zd2unpadzb0zz__rsaz00, 0L,
		BUNSPEC, 1);
	     
		DEFINE_EXPORT_BGL_PROCEDURE(BGl_rsazd2decryptzd2stringzd2envzd2zz__rsaz00,
		BgL_bgl_za762rsaza7d2decrypt2038z00,
		BGl_z62rsazd2decryptzd2stringz62zz__rsaz00, 0L, BUNSPEC, 2);
	     
		DEFINE_EXPORT_BGL_PROCEDURE(BGl_rsazd2encryptzd2stringzd2envzd2zz__rsaz00,
		BgL_bgl_za762rsaza7d2encrypt2039z00,
		BGl_z62rsazd2encryptzd2stringz62zz__rsaz00, 0L, BUNSPEC, 2);

/* GC roots registration */
	static obj_t bgl_gc_roots_register()
	{
#if defined( BGL_GC_ROOTS )
#define ADD_ROOT( addr ) (addr > roots_max ? roots_max = addr : (addr < roots_min ? roots_min = addr : 0))
		void *roots_min = (void *) ULONG_MAX, *roots_max = 0;
		     ADD_ROOT((void *) (&BGl_symbol2004z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_requirezd2initializa7ationz75zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_keyword1987z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_keyword1989z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_list2003z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_symbol1983z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_symbol1991z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_symbol1998z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_list1986z00zz__rsaz00));
		     ADD_ROOT((void *) (&BGl_symbol2000z00zz__rsaz00));
#undef ADD_ROOT
		if   (roots_max > 0)
			     GC_add_roots(roots_min, ((void **) roots_max) + 1);
#endif
		     return BUNSPEC;
	}



/* module-initialization */
	BGL_EXPORTED_DEF obj_t BGl_modulezd2initializa7ationz75zz__rsaz00(long
		BgL_checksumz00_3139, char *BgL_fromz00_3140)
	{
		{
			if (CBOOL(BGl_requirezd2initializa7ationz75zz__rsaz00))
				{
					BGl_requirezd2initializa7ationz75zz__rsaz00 = BBOOL(((bool_t) 0));
					BGl_gczd2rootszd2initz00zz__rsaz00();
					BGl_cnstzd2initzd2zz__rsaz00();
					return BGl_toplevelzd2initzd2zz__rsaz00();
				}
			else
				{
					return BUNSPEC;
				}
		}

	}



/* cnst-init */
	obj_t BGl_cnstzd2initzd2zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			BGl_symbol1983z00zz__rsaz00 =
				bstring_to_symbol(BGl_string1984z00zz__rsaz00);
			BGl_keyword1987z00zz__rsaz00 =
				bstring_to_keyword(BGl_string1988z00zz__rsaz00);
			BGl_keyword1989z00zz__rsaz00 =
				bstring_to_keyword(BGl_string1990z00zz__rsaz00);
			BGl_list1986z00zz__rsaz00 =
				MAKE_YOUNG_PAIR(BGl_keyword1987z00zz__rsaz00,
				MAKE_YOUNG_PAIR(BGl_keyword1989z00zz__rsaz00, BNIL));
			BGl_symbol1991z00zz__rsaz00 =
				bstring_to_symbol(BGl_string1992z00zz__rsaz00);
			BGl_symbol1998z00zz__rsaz00 =
				bstring_to_symbol(BGl_string1999z00zz__rsaz00);
			BGl_symbol2000z00zz__rsaz00 =
				bstring_to_symbol(BGl_string2001z00zz__rsaz00);
			BGl_list2003z00zz__rsaz00 = MAKE_YOUNG_PAIR(BINT(0L), BNIL);
			return (BGl_symbol2004z00zz__rsaz00 =
				bstring_to_symbol(BGl_string2005z00zz__rsaz00), BUNSPEC);
		}

	}



/* gc-roots-init */
	obj_t BGl_gczd2rootszd2initz00zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			return bgl_gc_roots_register();
		}

	}



/* toplevel-init */
	obj_t BGl_toplevelzd2initzd2zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			return BUNSPEC;
		}

	}



/* random-prime */
	obj_t BGl_randomzd2primezd2zz__rsaz00(obj_t BgL_startz00_17,
		obj_t BgL_endz00_18, obj_t BgL_showzd2tracezd2_19)
	{
		{	/* Unsafe/rsa.scm 84 */
			{
				long BgL_nz00_1406;

				if (CBOOL(BgL_showzd2tracezd2_19))
					{	/* Unsafe/rsa.scm 96 */
						{	/* Unsafe/rsa.scm 97 */
							obj_t BgL_arg1253z00_1376;

							{	/* Unsafe/rsa.scm 97 */
								obj_t BgL_tmpz00_3161;

								BgL_tmpz00_3161 = BGL_CURRENT_DYNAMIC_ENV();
								BgL_arg1253z00_1376 =
									BGL_ENV_CURRENT_OUTPUT_PORT(BgL_tmpz00_3161);
							}
							bgl_display_string(BGl_string1981z00zz__rsaz00,
								BgL_arg1253z00_1376);
						}
						{	/* Unsafe/rsa.scm 98 */
							obj_t BgL_arg1254z00_1377;

							{	/* Unsafe/rsa.scm 98 */
								obj_t BgL_tmpz00_3165;

								BgL_tmpz00_3165 = BGL_CURRENT_DYNAMIC_ENV();
								BgL_arg1254z00_1377 =
									BGL_ENV_CURRENT_OUTPUT_PORT(BgL_tmpz00_3165);
							}
							bgl_flush_output_port(BgL_arg1254z00_1377);
						}
					}
				else
					{	/* Unsafe/rsa.scm 96 */
						BFALSE;
					}
				{	/* Unsafe/rsa.scm 100 */
					obj_t BgL_prodzd2smallzd2primesz00_1378;

					BgL_nz00_1406 = 300L;
					{	/* Unsafe/rsa.scm 87 */
						long BgL_g1042z00_1408;

						BgL_g1042z00_1408 = (BgL_nz00_1406 - 1L);
						{
							long BgL_nz00_2342;
							obj_t BgL_pz00_2343;
							long BgL_iz00_2344;

							BgL_nz00_2342 = BgL_g1042z00_1408;
							BgL_pz00_2343 = (bgl_string_to_bignum("2", 16));
							BgL_iz00_2344 = 3L;
						BgL_loopz00_2341:
							if ((BgL_nz00_2342 == 0L))
								{	/* Unsafe/rsa.scm 89 */
									BgL_prodzd2smallzd2primesz00_1378 = BgL_pz00_2343;
								}
							else
								{	/* Unsafe/rsa.scm 91 */
									bool_t BgL_test2043z00_3172;

									{	/* Unsafe/rsa.scm 91 */
										obj_t BgL_arg1330z00_2348;

										{	/* Unsafe/rsa.scm 91 */
											obj_t BgL_arg1331z00_2349;

											BgL_arg1331z00_2349 = bgl_long_to_bignum(BgL_iz00_2344);
											{	/* Unsafe/rsa.scm 91 */
												obj_t BgL_list1332z00_2351;

												{	/* Unsafe/rsa.scm 91 */
													obj_t BgL_arg1333z00_2352;

													BgL_arg1333z00_2352 =
														MAKE_YOUNG_PAIR(BgL_pz00_2343, BNIL);
													BgL_list1332z00_2351 =
														MAKE_YOUNG_PAIR(BgL_arg1331z00_2349,
														BgL_arg1333z00_2352);
												}
												BgL_arg1330z00_2348 =
													BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00
													(BgL_list1332z00_2351);
											}
										}
										BgL_test2043z00_3172 =
											(
											(long) (bgl_bignum_cmp((bgl_string_to_bignum("1", 16)),
													BgL_arg1330z00_2348)) == 0L);
									}
									if (BgL_test2043z00_3172)
										{
											long BgL_iz00_3185;
											obj_t BgL_pz00_3182;
											long BgL_nz00_3180;

											BgL_nz00_3180 = (BgL_nz00_2342 - 1L);
											BgL_pz00_3182 =
												bgl_bignum_mul(BgL_pz00_2343,
												bgl_long_to_bignum(BgL_iz00_2344));
											BgL_iz00_3185 = (BgL_iz00_2344 + 2L);
											BgL_iz00_2344 = BgL_iz00_3185;
											BgL_pz00_2343 = BgL_pz00_3182;
											BgL_nz00_2342 = BgL_nz00_3180;
											goto BgL_loopz00_2341;
										}
									else
										{
											long BgL_iz00_3187;

											BgL_iz00_3187 = (BgL_iz00_2344 + 2L);
											BgL_iz00_2344 = BgL_iz00_3187;
											goto BgL_loopz00_2341;
										}
								}
						}
					}
					{
						obj_t BgL_nz00_1397;

						{
							long BgL_iz00_1381;

							BgL_iz00_1381 = 1L;
						BgL_zc3z04anonymousza31255ze3z87_1382:
							if (CBOOL(BgL_showzd2tracezd2_19))
								{	/* Unsafe/rsa.scm 107 */
									{	/* Unsafe/rsa.scm 108 */
										obj_t BgL_arg1256z00_1383;

										{	/* Unsafe/rsa.scm 108 */
											obj_t BgL_tmpz00_3191;

											BgL_tmpz00_3191 = BGL_CURRENT_DYNAMIC_ENV();
											BgL_arg1256z00_1383 =
												BGL_ENV_CURRENT_OUTPUT_PORT(BgL_tmpz00_3191);
										}
										bgl_display_string(BGl_string1982z00zz__rsaz00,
											BgL_arg1256z00_1383);
									}
									{	/* Unsafe/rsa.scm 109 */
										obj_t BgL_arg1257z00_1384;

										{	/* Unsafe/rsa.scm 109 */
											obj_t BgL_tmpz00_3195;

											BgL_tmpz00_3195 = BGL_CURRENT_DYNAMIC_ENV();
											BgL_arg1257z00_1384 =
												BGL_ENV_CURRENT_OUTPUT_PORT(BgL_tmpz00_3195);
										}
										bgl_flush_output_port(BgL_arg1257z00_1384);
									}
								}
							else
								{	/* Unsafe/rsa.scm 107 */
									BFALSE;
								}
							{	/* Unsafe/rsa.scm 110 */
								obj_t BgL_xz00_1385;

								{	/* Unsafe/rsa.scm 110 */
									obj_t BgL_arg1275z00_1394;

									{	/* Unsafe/rsa.scm 110 */
										obj_t BgL_arg1276z00_1395;

										BgL_arg1276z00_1395 =
											bgl_bignum_sub(BgL_endz00_18, BgL_startz00_17);
										if ((bgl_bignum_to_long(BgL_arg1276z00_1395) == 0L))
											{	/* Unsafe/rsa.scm 110 */
												BgL_arg1275z00_1394 = (bgl_string_to_bignum("0", 16));
											}
										else
											{	/* Unsafe/rsa.scm 110 */
												BgL_arg1275z00_1394 =
													bgl_rand_bignum(BgL_arg1276z00_1395);
											}
									}
									BgL_xz00_1385 =
										bgl_bignum_add(BgL_startz00_17, BgL_arg1275z00_1394);
								}
								{	/* Unsafe/rsa.scm 110 */
									obj_t BgL_nz00_1386;

									if (bgl_bignum_odd(BgL_xz00_1385))
										{	/* Unsafe/rsa.scm 111 */
											BgL_nz00_1386 = BgL_xz00_1385;
										}
									else
										{	/* Unsafe/rsa.scm 111 */
											BgL_nz00_1386 =
												bgl_bignum_add(BgL_xz00_1385, (bgl_string_to_bignum("1",
														16)));
										}
									{	/* Unsafe/rsa.scm 111 */

										{	/* Unsafe/rsa.scm 112 */
											bool_t BgL_test2047z00_3208;

											if (
												((long) (bgl_bignum_cmp(BgL_nz00_1386,
															BgL_endz00_18)) >= 0L))
												{	/* Unsafe/rsa.scm 112 */
													BgL_test2047z00_3208 = ((bool_t) 1);
												}
											else
												{	/* Unsafe/rsa.scm 112 */
													bool_t BgL_test2049z00_3213;

													BgL_nz00_1397 = BgL_nz00_1386;
													{	/* Unsafe/rsa.scm 103 */
														bool_t BgL_test2050z00_3214;

														{	/* Unsafe/rsa.scm 103 */
															obj_t BgL_arg1282z00_1402;

															{	/* Unsafe/rsa.scm 103 */
																obj_t BgL_list1283z00_1403;

																{	/* Unsafe/rsa.scm 103 */
																	obj_t BgL_arg1284z00_1404;

																	BgL_arg1284z00_1404 =
																		MAKE_YOUNG_PAIR
																		(BgL_prodzd2smallzd2primesz00_1378, BNIL);
																	BgL_list1283z00_1403 =
																		MAKE_YOUNG_PAIR(BgL_nz00_1397,
																		BgL_arg1284z00_1404);
																}
																BgL_arg1282z00_1402 =
																	BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00
																	(BgL_list1283z00_1403);
															}
															BgL_test2050z00_3214 =
																(
																(long) (bgl_bignum_cmp((bgl_string_to_bignum
																			("1", 16)), BgL_arg1282z00_1402)) == 0L);
														}
														if (BgL_test2050z00_3214)
															{	/* Unsafe/rsa.scm 103 */
																BgL_test2049z00_3213 =
																	(
																	(long) (bgl_bignum_cmp((bgl_string_to_bignum
																				("1", 16)),
																			BGl_exptzd2modze70z35zz__rsaz00(
																				(bgl_string_to_bignum("2", 16)),
																				bgl_bignum_sub(BgL_nz00_1397,
																					(bgl_string_to_bignum("1", 16))),
																				BgL_nz00_1397))) == 0L);
															}
														else
															{	/* Unsafe/rsa.scm 103 */
																BgL_test2049z00_3213 = ((bool_t) 0);
															}
													}
													if (BgL_test2049z00_3213)
														{	/* Unsafe/rsa.scm 112 */
															BgL_test2047z00_3208 = ((bool_t) 0);
														}
													else
														{	/* Unsafe/rsa.scm 112 */
															BgL_test2047z00_3208 = ((bool_t) 1);
														}
												}
											if (BgL_test2047z00_3208)
												{
													long BgL_iz00_3226;

													BgL_iz00_3226 = (BgL_iz00_1381 + 1L);
													BgL_iz00_1381 = BgL_iz00_3226;
													goto BgL_zc3z04anonymousza31255ze3z87_1382;
												}
											else
												{	/* Unsafe/rsa.scm 112 */
													return BgL_nz00_1386;
												}
										}
									}
								}
							}
						}
					}
				}
			}
		}

	}



/* gcd-ext */
	obj_t BGl_gcdzd2extzd2zz__rsaz00(obj_t BgL_xz00_20, obj_t BgL_yz00_21)
	{
		{	/* Unsafe/rsa.scm 119 */
			{
				obj_t BgL_xz00_2454;
				obj_t BgL_yz00_2455;
				obj_t BgL_u1z00_2456;
				obj_t BgL_u2z00_2457;
				obj_t BgL_v1z00_2458;
				obj_t BgL_v2z00_2459;

				BgL_xz00_2454 = BgL_xz00_20;
				BgL_yz00_2455 = BgL_yz00_21;
				BgL_u1z00_2456 = (bgl_string_to_bignum("1", 16));
				BgL_u2z00_2457 = (bgl_string_to_bignum("0", 16));
				BgL_v1z00_2458 = (bgl_string_to_bignum("0", 16));
				BgL_v2z00_2459 = (bgl_string_to_bignum("1", 16));
			BgL_loopz00_2453:
				if (BXZERO(BgL_yz00_2455))
					{	/* Unsafe/rsa.scm 127 */
						obj_t BgL_list1336z00_2471;

						{	/* Unsafe/rsa.scm 127 */
							obj_t BgL_arg1337z00_2472;

							{	/* Unsafe/rsa.scm 127 */
								obj_t BgL_arg1338z00_2473;

								BgL_arg1338z00_2473 = MAKE_YOUNG_PAIR(BgL_v1z00_2458, BNIL);
								BgL_arg1337z00_2472 =
									MAKE_YOUNG_PAIR(BgL_u1z00_2456, BgL_arg1338z00_2473);
							}
							BgL_list1336z00_2471 =
								MAKE_YOUNG_PAIR(BgL_xz00_2454, BgL_arg1337z00_2472);
						}
						return BgL_list1336z00_2471;
					}
				else
					{	/* Unsafe/rsa.scm 128 */
						obj_t BgL_qz00_2474;
						obj_t BgL_rz00_2475;

						BgL_qz00_2474 = bgl_bignum_quotient(BgL_xz00_2454, BgL_yz00_2455);
						BgL_rz00_2475 = bgl_bignum_remainder(BgL_xz00_2454, BgL_yz00_2455);
						{
							obj_t BgL_v2z00_3242;
							obj_t BgL_v1z00_3241;
							obj_t BgL_u2z00_3238;
							obj_t BgL_u1z00_3237;
							obj_t BgL_yz00_3236;
							obj_t BgL_xz00_3235;

							BgL_xz00_3235 = BgL_yz00_2455;
							BgL_yz00_3236 = BgL_rz00_2475;
							BgL_u1z00_3237 = BgL_u2z00_2457;
							BgL_u2z00_3238 =
								bgl_bignum_sub(BgL_u1z00_2456,
								bgl_bignum_mul(BgL_qz00_2474, BgL_u2z00_2457));
							BgL_v1z00_3241 = BgL_v2z00_2459;
							BgL_v2z00_3242 =
								bgl_bignum_sub(BgL_v1z00_2458,
								bgl_bignum_mul(BgL_qz00_2474, BgL_v2z00_2459));
							BgL_v2z00_2459 = BgL_v2z00_3242;
							BgL_v1z00_2458 = BgL_v1z00_3241;
							BgL_u2z00_2457 = BgL_u2z00_3238;
							BgL_u1z00_2456 = BgL_u1z00_3237;
							BgL_yz00_2455 = BgL_yz00_3236;
							BgL_xz00_2454 = BgL_xz00_3235;
							goto BgL_loopz00_2453;
						}
					}
			}
		}

	}



/* mod-inverse */
	obj_t BGl_modzd2inversezd2zz__rsaz00(obj_t BgL_xz00_22, obj_t BgL_bz00_23)
	{
		{	/* Unsafe/rsa.scm 135 */
			{	/* Unsafe/rsa.scm 136 */
				obj_t BgL_x1z00_1450;

				BgL_x1z00_1450 =
					BGl_modulobxz00zz__r4_numbers_6_5_fixnumz00(BgL_xz00_22, BgL_bz00_23);
				{	/* Unsafe/rsa.scm 136 */
					obj_t BgL_gz00_1451;

					BgL_gz00_1451 =
						BGl_gcdzd2extzd2zz__rsaz00(BgL_x1z00_1450, BgL_bz00_23);
					{	/* Unsafe/rsa.scm 137 */

						{	/* Unsafe/rsa.scm 138 */
							bool_t BgL_test2052z00_3247;

							{	/* Unsafe/rsa.scm 138 */
								obj_t BgL_n1z00_2495;

								BgL_n1z00_2495 = CAR(((obj_t) BgL_gz00_1451));
								BgL_test2052z00_3247 =
									(
									(long) (bgl_bignum_cmp(BgL_n1z00_2495,
											(bgl_string_to_bignum("1", 16)))) == 0L);
							}
							if (BgL_test2052z00_3247)
								{	/* Unsafe/rsa.scm 142 */
									obj_t BgL_auxz00_3253;

									{	/* Unsafe/rsa.scm 142 */
										obj_t BgL_pairz00_2502;

										BgL_pairz00_2502 = CDR(((obj_t) BgL_gz00_1451));
										BgL_auxz00_3253 = CAR(BgL_pairz00_2502);
									}
									BGL_TAIL return
										BGl_modulobxz00zz__r4_numbers_6_5_fixnumz00(BgL_auxz00_3253,
										BgL_bz00_23);
								}
							else
								{	/* Unsafe/rsa.scm 141 */
									obj_t BgL_arg1347z00_1455;

									BgL_arg1347z00_1455 =
										MAKE_YOUNG_PAIR(BgL_xz00_22, BgL_bz00_23);
									return
										BGl_errorz00zz__errorz00(BGl_symbol1983z00zz__rsaz00,
										BGl_string1985z00zz__rsaz00, BgL_arg1347z00_1455);
								}
						}
					}
				}
			}
		}

	}



/* _make-rsa-key-pair */
	obj_t BGl__makezd2rsazd2keyzd2pairzd2zz__rsaz00(obj_t BgL_env1148z00_27,
		obj_t BgL_opt1147z00_26)
	{
		{	/* Unsafe/rsa.scm 147 */
			{	/* Unsafe/rsa.scm 147 */

				{	/* Unsafe/rsa.scm 147 */
					obj_t BgL_showzd2tracezd2_1461;

					BgL_showzd2tracezd2_1461 = BFALSE;
					{	/* Unsafe/rsa.scm 147 */
						obj_t BgL_siza7eza7_1462;

						BgL_siza7eza7_1462 = BINT(1024L);
						{	/* Unsafe/rsa.scm 147 */

							{
								long BgL_iz00_1463;

								BgL_iz00_1463 = 0L;
							BgL_check1151z00_1464:
								if ((BgL_iz00_1463 == VECTOR_LENGTH(BgL_opt1147z00_26)))
									{	/* Unsafe/rsa.scm 147 */
										BNIL;
									}
								else
									{	/* Unsafe/rsa.scm 147 */
										bool_t BgL_test2054z00_3264;

										{	/* Unsafe/rsa.scm 147 */
											obj_t BgL_arg1356z00_1470;

											BgL_arg1356z00_1470 =
												VECTOR_REF(BgL_opt1147z00_26, BgL_iz00_1463);
											BgL_test2054z00_3264 =
												CBOOL(BGl_memqz00zz__r4_pairs_and_lists_6_3z00
												(BgL_arg1356z00_1470, BGl_list1986z00zz__rsaz00));
										}
										if (BgL_test2054z00_3264)
											{
												long BgL_iz00_3268;

												BgL_iz00_3268 = (BgL_iz00_1463 + 2L);
												BgL_iz00_1463 = BgL_iz00_3268;
												goto BgL_check1151z00_1464;
											}
										else
											{	/* Unsafe/rsa.scm 147 */
												obj_t BgL_arg1355z00_1469;

												BgL_arg1355z00_1469 =
													VECTOR_REF(BgL_opt1147z00_26, BgL_iz00_1463);
												BGl_errorz00zz__errorz00(BGl_symbol1991z00zz__rsaz00,
													BGl_string1993z00zz__rsaz00, BgL_arg1355z00_1469);
											}
									}
							}
							{	/* Unsafe/rsa.scm 147 */
								obj_t BgL_index1153z00_1471;

								{
									long BgL_iz00_2519;

									BgL_iz00_2519 = 0L;
								BgL_search1150z00_2518:
									if ((BgL_iz00_2519 == VECTOR_LENGTH(BgL_opt1147z00_26)))
										{	/* Unsafe/rsa.scm 147 */
											BgL_index1153z00_1471 = BINT(-1L);
										}
									else
										{	/* Unsafe/rsa.scm 147 */
											if (
												(BgL_iz00_2519 ==
													(VECTOR_LENGTH(BgL_opt1147z00_26) - 1L)))
												{	/* Unsafe/rsa.scm 147 */
													BgL_index1153z00_1471 =
														BGl_errorz00zz__errorz00
														(BGl_symbol1991z00zz__rsaz00,
														BGl_string1994z00zz__rsaz00,
														BINT(VECTOR_LENGTH(BgL_opt1147z00_26)));
												}
											else
												{	/* Unsafe/rsa.scm 147 */
													obj_t BgL_vz00_2529;

													BgL_vz00_2529 =
														VECTOR_REF(BgL_opt1147z00_26, BgL_iz00_2519);
													if ((BgL_vz00_2529 == BGl_keyword1987z00zz__rsaz00))
														{	/* Unsafe/rsa.scm 147 */
															BgL_index1153z00_1471 =
																BINT((BgL_iz00_2519 + 1L));
														}
													else
														{
															long BgL_iz00_3288;

															BgL_iz00_3288 = (BgL_iz00_2519 + 2L);
															BgL_iz00_2519 = BgL_iz00_3288;
															goto BgL_search1150z00_2518;
														}
												}
										}
								}
								{	/* Unsafe/rsa.scm 147 */
									bool_t BgL_test2058z00_3290;

									{	/* Unsafe/rsa.scm 147 */
										long BgL_n1z00_2533;

										{	/* Unsafe/rsa.scm 147 */
											obj_t BgL_tmpz00_3291;

											if (INTEGERP(BgL_index1153z00_1471))
												{	/* Unsafe/rsa.scm 147 */
													BgL_tmpz00_3291 = BgL_index1153z00_1471;
												}
											else
												{
													obj_t BgL_auxz00_3294;

													BgL_auxz00_3294 =
														BGl_typezd2errorzd2zz__errorz00
														(BGl_string1995z00zz__rsaz00, BINT(5113L),
														BGl_string1996z00zz__rsaz00,
														BGl_string1997z00zz__rsaz00, BgL_index1153z00_1471);
													FAILURE(BgL_auxz00_3294, BFALSE, BFALSE);
												}
											BgL_n1z00_2533 = (long) CINT(BgL_tmpz00_3291);
										}
										BgL_test2058z00_3290 = (BgL_n1z00_2533 >= 0L);
									}
									if (BgL_test2058z00_3290)
										{
											long BgL_auxz00_3300;

											{	/* Unsafe/rsa.scm 147 */
												obj_t BgL_tmpz00_3301;

												if (INTEGERP(BgL_index1153z00_1471))
													{	/* Unsafe/rsa.scm 147 */
														BgL_tmpz00_3301 = BgL_index1153z00_1471;
													}
												else
													{
														obj_t BgL_auxz00_3304;

														BgL_auxz00_3304 =
															BGl_typezd2errorzd2zz__errorz00
															(BGl_string1995z00zz__rsaz00, BINT(5113L),
															BGl_string1996z00zz__rsaz00,
															BGl_string1997z00zz__rsaz00,
															BgL_index1153z00_1471);
														FAILURE(BgL_auxz00_3304, BFALSE, BFALSE);
													}
												BgL_auxz00_3300 = (long) CINT(BgL_tmpz00_3301);
											}
											BgL_showzd2tracezd2_1461 =
												VECTOR_REF(BgL_opt1147z00_26, BgL_auxz00_3300);
										}
									else
										{	/* Unsafe/rsa.scm 147 */
											BFALSE;
										}
								}
							}
							{	/* Unsafe/rsa.scm 147 */
								obj_t BgL_index1154z00_1473;

								{
									long BgL_iz00_2535;

									BgL_iz00_2535 = 0L;
								BgL_search1150z00_2534:
									if ((BgL_iz00_2535 == VECTOR_LENGTH(BgL_opt1147z00_26)))
										{	/* Unsafe/rsa.scm 147 */
											BgL_index1154z00_1473 = BINT(-1L);
										}
									else
										{	/* Unsafe/rsa.scm 147 */
											if (
												(BgL_iz00_2535 ==
													(VECTOR_LENGTH(BgL_opt1147z00_26) - 1L)))
												{	/* Unsafe/rsa.scm 147 */
													BgL_index1154z00_1473 =
														BGl_errorz00zz__errorz00
														(BGl_symbol1991z00zz__rsaz00,
														BGl_string1994z00zz__rsaz00,
														BINT(VECTOR_LENGTH(BgL_opt1147z00_26)));
												}
											else
												{	/* Unsafe/rsa.scm 147 */
													obj_t BgL_vz00_2545;

													BgL_vz00_2545 =
														VECTOR_REF(BgL_opt1147z00_26, BgL_iz00_2535);
													if ((BgL_vz00_2545 == BGl_keyword1989z00zz__rsaz00))
														{	/* Unsafe/rsa.scm 147 */
															BgL_index1154z00_1473 =
																BINT((BgL_iz00_2535 + 1L));
														}
													else
														{
															long BgL_iz00_3326;

															BgL_iz00_3326 = (BgL_iz00_2535 + 2L);
															BgL_iz00_2535 = BgL_iz00_3326;
															goto BgL_search1150z00_2534;
														}
												}
										}
								}
								{	/* Unsafe/rsa.scm 147 */
									bool_t BgL_test2064z00_3328;

									{	/* Unsafe/rsa.scm 147 */
										long BgL_n1z00_2549;

										{	/* Unsafe/rsa.scm 147 */
											obj_t BgL_tmpz00_3329;

											if (INTEGERP(BgL_index1154z00_1473))
												{	/* Unsafe/rsa.scm 147 */
													BgL_tmpz00_3329 = BgL_index1154z00_1473;
												}
											else
												{
													obj_t BgL_auxz00_3332;

													BgL_auxz00_3332 =
														BGl_typezd2errorzd2zz__errorz00
														(BGl_string1995z00zz__rsaz00, BINT(5113L),
														BGl_string1996z00zz__rsaz00,
														BGl_string1997z00zz__rsaz00, BgL_index1154z00_1473);
													FAILURE(BgL_auxz00_3332, BFALSE, BFALSE);
												}
											BgL_n1z00_2549 = (long) CINT(BgL_tmpz00_3329);
										}
										BgL_test2064z00_3328 = (BgL_n1z00_2549 >= 0L);
									}
									if (BgL_test2064z00_3328)
										{
											long BgL_auxz00_3338;

											{	/* Unsafe/rsa.scm 147 */
												obj_t BgL_tmpz00_3339;

												if (INTEGERP(BgL_index1154z00_1473))
													{	/* Unsafe/rsa.scm 147 */
														BgL_tmpz00_3339 = BgL_index1154z00_1473;
													}
												else
													{
														obj_t BgL_auxz00_3342;

														BgL_auxz00_3342 =
															BGl_typezd2errorzd2zz__errorz00
															(BGl_string1995z00zz__rsaz00, BINT(5113L),
															BGl_string1996z00zz__rsaz00,
															BGl_string1997z00zz__rsaz00,
															BgL_index1154z00_1473);
														FAILURE(BgL_auxz00_3342, BFALSE, BFALSE);
													}
												BgL_auxz00_3338 = (long) CINT(BgL_tmpz00_3339);
											}
											BgL_siza7eza7_1462 =
												VECTOR_REF(BgL_opt1147z00_26, BgL_auxz00_3338);
										}
									else
										{	/* Unsafe/rsa.scm 147 */
											BFALSE;
										}
								}
							}
							{	/* Unsafe/rsa.scm 147 */
								obj_t BgL_showzd2tracezd2_1475;

								BgL_showzd2tracezd2_1475 = BgL_showzd2tracezd2_1461;
								return
									BGl_makezd2rsazd2keyzd2pairzd2zz__rsaz00
									(BgL_showzd2tracezd2_1475, BgL_siza7eza7_1462);
							}
						}
					}
				}
			}
		}

	}



/* make-rsa-key-pair */
	BGL_EXPORTED_DEF obj_t BGl_makezd2rsazd2keyzd2pairzd2zz__rsaz00(obj_t
		BgL_showzd2tracezd2_24, obj_t BgL_siza7eza7_25)
	{
		{	/* Unsafe/rsa.scm 147 */
			{	/* Unsafe/rsa.scm 148 */
				long BgL_siza7ezd2pz75_1484;

				{	/* Unsafe/rsa.scm 148 */
					long BgL_tmpz00_3349;

					BgL_tmpz00_3349 = (long) CINT(BgL_siza7eza7_25);
					BgL_siza7ezd2pz75_1484 = (BgL_tmpz00_3349 / 2L);
				}
				{	/* Unsafe/rsa.scm 148 */
					obj_t BgL_startzd2pzd2_1485;

					BgL_startzd2pzd2_1485 =
						bgl_bignum_expt((bgl_string_to_bignum("2", 16)),
						bgl_long_to_bignum(BgL_siza7ezd2pz75_1484));
					{	/* Unsafe/rsa.scm 149 */
						obj_t BgL_endzd2pzd2_1486;

						BgL_endzd2pzd2_1486 =
							bgl_bignum_mul(BgL_startzd2pzd2_1485, (bgl_string_to_bignum("2",
									16)));
						{	/* Unsafe/rsa.scm 150 */
							obj_t BgL_pz00_1487;

							BgL_pz00_1487 =
								BGl_randomzd2primezd2zz__rsaz00(BgL_startzd2pzd2_1485,
								BgL_endzd2pzd2_1486, BgL_showzd2tracezd2_24);
							{	/* Unsafe/rsa.scm 151 */
								obj_t BgL_startzd2nzd2_1488;

								BgL_startzd2nzd2_1488 =
									bgl_bignum_expt((bgl_string_to_bignum("2", 16)),
									bgl_long_to_bignum((long) CINT(BgL_siza7eza7_25)));
								{	/* Unsafe/rsa.scm 152 */
									obj_t BgL_endzd2nzd2_1489;

									BgL_endzd2nzd2_1489 =
										bgl_bignum_mul(BgL_startzd2nzd2_1488,
										(bgl_string_to_bignum("2", 16)));
									{	/* Unsafe/rsa.scm 153 */
										obj_t BgL_startzd2qzd2_1490;

										BgL_startzd2qzd2_1490 =
											bgl_bignum_add(bgl_bignum_quotient(bgl_bignum_sub
												(BgL_startzd2nzd2_1488, (bgl_string_to_bignum("1",
															16))), BgL_pz00_1487), (bgl_string_to_bignum("1",
													16)));
										{	/* Unsafe/rsa.scm 154 */
											obj_t BgL_endzd2qzd2_1491;

											BgL_endzd2qzd2_1491 =
												bgl_bignum_quotient(BgL_endzd2nzd2_1489, BgL_pz00_1487);
											{	/* Unsafe/rsa.scm 155 */

												{

												BgL_zc3z04anonymousza31365ze3z87_1493:
													{	/* Unsafe/rsa.scm 157 */
														obj_t BgL_qz00_1494;

														BgL_qz00_1494 =
															BGl_randomzd2primezd2zz__rsaz00
															(BgL_startzd2qzd2_1490, BgL_endzd2qzd2_1491,
															BgL_showzd2tracezd2_24);
														{	/* Unsafe/rsa.scm 158 */
															bool_t BgL_test2067z00_3365;

															{	/* Unsafe/rsa.scm 158 */
																obj_t BgL_arg1389z00_1524;

																{	/* Unsafe/rsa.scm 158 */
																	obj_t BgL_list1390z00_1525;

																	{	/* Unsafe/rsa.scm 158 */
																		obj_t BgL_arg1391z00_1526;

																		BgL_arg1391z00_1526 =
																			MAKE_YOUNG_PAIR(BgL_qz00_1494, BNIL);
																		BgL_list1390z00_1525 =
																			MAKE_YOUNG_PAIR(BgL_pz00_1487,
																			BgL_arg1391z00_1526);
																	}
																	BgL_arg1389z00_1524 =
																		BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00
																		(BgL_list1390z00_1525);
																}
																BgL_test2067z00_3365 =
																	(
																	(long) (bgl_bignum_cmp(BgL_arg1389z00_1524,
																			(bgl_string_to_bignum("1", 16)))) == 0L);
															}
															if (BgL_test2067z00_3365)
																{	/* Unsafe/rsa.scm 160 */
																	obj_t BgL_nz00_1499;

																	BgL_nz00_1499 =
																		bgl_bignum_mul(BgL_pz00_1487,
																		BgL_qz00_1494);
																	{	/* Unsafe/rsa.scm 160 */
																		obj_t BgL_pzd21zd2_1500;

																		BgL_pzd21zd2_1500 =
																			bgl_bignum_sub(BgL_pz00_1487,
																			(bgl_string_to_bignum("1", 16)));
																		{	/* Unsafe/rsa.scm 161 */
																			obj_t BgL_qzd21zd2_1501;

																			BgL_qzd21zd2_1501 =
																				bgl_bignum_sub(BgL_qz00_1494,
																				(bgl_string_to_bignum("1", 16)));
																			{	/* Unsafe/rsa.scm 162 */
																				obj_t BgL_phiz00_1502;

																				{	/* Unsafe/rsa.scm 163 */
																					obj_t BgL_arg1385z00_1520;
																					obj_t BgL_arg1386z00_1521;

																					BgL_arg1385z00_1520 =
																						bgl_bignum_mul(BgL_pzd21zd2_1500,
																						BgL_qzd21zd2_1501);
																					{	/* Unsafe/rsa.scm 163 */
																						obj_t BgL_list1387z00_1522;

																						{	/* Unsafe/rsa.scm 163 */
																							obj_t BgL_arg1388z00_1523;

																							BgL_arg1388z00_1523 =
																								MAKE_YOUNG_PAIR
																								(BgL_qzd21zd2_1501, BNIL);
																							BgL_list1387z00_1522 =
																								MAKE_YOUNG_PAIR
																								(BgL_pzd21zd2_1500,
																								BgL_arg1388z00_1523);
																						}
																						BgL_arg1386z00_1521 =
																							BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00
																							(BgL_list1387z00_1522);
																					}
																					BgL_phiz00_1502 =
																						bgl_bignum_quotient
																						(BgL_arg1385z00_1520,
																						BgL_arg1386z00_1521);
																				}
																				{	/* Unsafe/rsa.scm 163 */
																					obj_t BgL_ez00_1503;

																					{
																						obj_t BgL_ez00_2590;

																						BgL_ez00_2590 =
																							(bgl_string_to_bignum("10001",
																								16));
																					BgL_loopz00_2589:
																						{	/* Unsafe/rsa.scm 165 */
																							bool_t BgL_test2068z00_3380;

																							{	/* Unsafe/rsa.scm 165 */
																								obj_t BgL_arg1382z00_2592;

																								{	/* Unsafe/rsa.scm 165 */
																									obj_t BgL_list1383z00_2593;

																									{	/* Unsafe/rsa.scm 165 */
																										obj_t BgL_arg1384z00_2594;

																										BgL_arg1384z00_2594 =
																											MAKE_YOUNG_PAIR
																											(BgL_phiz00_1502, BNIL);
																										BgL_list1383z00_2593 =
																											MAKE_YOUNG_PAIR
																											(BgL_ez00_2590,
																											BgL_arg1384z00_2594);
																									}
																									BgL_arg1382z00_2592 =
																										BGl_gcdbxz00zz__r4_numbers_6_5_fixnumz00
																										(BgL_list1383z00_2593);
																								}
																								BgL_test2068z00_3380 =
																									(
																									(long) (bgl_bignum_cmp(
																											(bgl_string_to_bignum("1",
																													16)),
																											BgL_arg1382z00_2592)) ==
																									0L);
																							}
																							if (BgL_test2068z00_3380)
																								{	/* Unsafe/rsa.scm 165 */
																									BgL_ez00_1503 = BgL_ez00_2590;
																								}
																							else
																								{
																									obj_t BgL_ez00_3387;

																									BgL_ez00_3387 =
																										bgl_bignum_add
																										(BgL_ez00_2590,
																										(bgl_string_to_bignum("2",
																												16)));
																									BgL_ez00_2590 = BgL_ez00_3387;
																									goto BgL_loopz00_2589;
																								}
																						}
																					}
																					{	/* Unsafe/rsa.scm 164 */
																						obj_t BgL_dz00_1504;

																						BgL_dz00_1504 =
																							BGl_modzd2inversezd2zz__rsaz00
																							(BgL_ez00_1503, BgL_phiz00_1502);
																						{	/* Unsafe/rsa.scm 168 */

																							if (CBOOL(BgL_showzd2tracezd2_24))
																								{	/* Unsafe/rsa.scm 169 */
																									obj_t BgL_arg1370z00_1505;

																									{	/* Unsafe/rsa.scm 169 */
																										obj_t BgL_tmpz00_3392;

																										BgL_tmpz00_3392 =
																											BGL_CURRENT_DYNAMIC_ENV();
																										BgL_arg1370z00_1505 =
																											BGL_ENV_CURRENT_OUTPUT_PORT
																											(BgL_tmpz00_3392);
																									}
																									bgl_display_char(((unsigned
																												char) 10),
																										BgL_arg1370z00_1505);
																								}
																							else
																								{	/* Unsafe/rsa.scm 169 */
																									BFALSE;
																								}
																							{	/* Unsafe/rsa.scm 171 */
																								obj_t BgL_arg1371z00_1506;
																								obj_t BgL_arg1372z00_1507;

																								{	/* Unsafe/rsa.scm 79 */
																									obj_t BgL_newz00_2604;

																									BgL_newz00_2604 =
																										create_struct
																										(BGl_symbol1998z00zz__rsaz00,
																										(int) (3L));
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3398;

																										BgL_tmpz00_3398 =
																											(int) (2L);
																										STRUCT_SET(BgL_newz00_2604,
																											BgL_tmpz00_3398,
																											BgL_ez00_1503);
																									}
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3401;

																										BgL_tmpz00_3401 =
																											(int) (1L);
																										STRUCT_SET(BgL_newz00_2604,
																											BgL_tmpz00_3401,
																											BgL_nz00_1499);
																									}
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3404;

																										BgL_tmpz00_3404 =
																											(int) (0L);
																										STRUCT_SET(BgL_newz00_2604,
																											BgL_tmpz00_3404,
																											BgL_siza7eza7_25);
																									}
																									BgL_arg1371z00_1506 =
																										BgL_newz00_2604;
																								}
																								{	/* Unsafe/rsa.scm 79 */
																									obj_t BgL_newz00_2608;

																									BgL_newz00_2608 =
																										create_struct
																										(BGl_symbol1998z00zz__rsaz00,
																										(int) (3L));
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3409;

																										BgL_tmpz00_3409 =
																											(int) (2L);
																										STRUCT_SET(BgL_newz00_2608,
																											BgL_tmpz00_3409,
																											BgL_dz00_1504);
																									}
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3412;

																										BgL_tmpz00_3412 =
																											(int) (1L);
																										STRUCT_SET(BgL_newz00_2608,
																											BgL_tmpz00_3412,
																											BgL_nz00_1499);
																									}
																									{	/* Unsafe/rsa.scm 79 */
																										int BgL_tmpz00_3415;

																										BgL_tmpz00_3415 =
																											(int) (0L);
																										STRUCT_SET(BgL_newz00_2608,
																											BgL_tmpz00_3415,
																											BgL_siza7eza7_25);
																									}
																									BgL_arg1372z00_1507 =
																										BgL_newz00_2608;
																								}
																								return
																									MAKE_YOUNG_PAIR
																									(BgL_arg1371z00_1506,
																									BgL_arg1372z00_1507);
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															else
																{	/* Unsafe/rsa.scm 158 */
																	goto BgL_zc3z04anonymousza31365ze3z87_1493;
																}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}

	}



/* public-rsa-key */
	BGL_EXPORTED_DEF obj_t BGl_publiczd2rsazd2keyz00zz__rsaz00(obj_t
		BgL_rsazd2keyzd2pairz00_28)
	{
		{	/* Unsafe/rsa.scm 177 */
			return CAR(((obj_t) BgL_rsazd2keyzd2pairz00_28));
		}

	}



/* &public-rsa-key */
	obj_t BGl_z62publiczd2rsazd2keyz62zz__rsaz00(obj_t BgL_envz00_3091,
		obj_t BgL_rsazd2keyzd2pairz00_3092)
	{
		{	/* Unsafe/rsa.scm 177 */
			return BGl_publiczd2rsazd2keyz00zz__rsaz00(BgL_rsazd2keyzd2pairz00_3092);
		}

	}



/* private-rsa-key */
	BGL_EXPORTED_DEF obj_t BGl_privatezd2rsazd2keyz00zz__rsaz00(obj_t
		BgL_rsazd2keyzd2pairz00_29)
	{
		{	/* Unsafe/rsa.scm 183 */
			return CDR(((obj_t) BgL_rsazd2keyzd2pairz00_29));
		}

	}



/* &private-rsa-key */
	obj_t BGl_z62privatezd2rsazd2keyz62zz__rsaz00(obj_t BgL_envz00_3093,
		obj_t BgL_rsazd2keyzd2pairz00_3094)
	{
		{	/* Unsafe/rsa.scm 183 */
			return BGl_privatezd2rsazd2keyz00zz__rsaz00(BgL_rsazd2keyzd2pairz00_3094);
		}

	}



/* rsa-key= */
	BGL_EXPORTED_DEF obj_t BGl_rsazd2keyzd3z01zz__rsaz00(obj_t
		BgL_rsazd2key1zd2_30, obj_t BgL_rsazd2key2zd2_31)
	{
		{	/* Unsafe/rsa.scm 189 */
			if (
				((long) CINT(STRUCT_REF(
							((obj_t) BgL_rsazd2key1zd2_30),
							(int) (0L))) ==
					(long) CINT(STRUCT_REF(((obj_t) BgL_rsazd2key2zd2_31), (int) (0L)))))
				{	/* Unsafe/rsa.scm 191 */
					bool_t BgL_test2071z00_3435;

					{	/* Unsafe/rsa.scm 191 */
						obj_t BgL_n1z00_2620;
						obj_t BgL_n2z00_2621;

						BgL_n1z00_2620 =
							STRUCT_REF(((obj_t) BgL_rsazd2key1zd2_30), (int) (1L));
						BgL_n2z00_2621 =
							STRUCT_REF(((obj_t) BgL_rsazd2key2zd2_31), (int) (1L));
						BgL_test2071z00_3435 =
							((long) (bgl_bignum_cmp(BgL_n1z00_2620, BgL_n2z00_2621)) == 0L);
					}
					if (BgL_test2071z00_3435)
						{	/* Unsafe/rsa.scm 192 */
							obj_t BgL_n1z00_2626;
							obj_t BgL_n2z00_2627;

							BgL_n1z00_2626 =
								STRUCT_REF(((obj_t) BgL_rsazd2key1zd2_30), (int) (2L));
							BgL_n2z00_2627 =
								STRUCT_REF(((obj_t) BgL_rsazd2key2zd2_31), (int) (2L));
							return
								BBOOL(
								((long) (bgl_bignum_cmp(BgL_n1z00_2626,
											BgL_n2z00_2627)) == 0L));
						}
					else
						{	/* Unsafe/rsa.scm 191 */
							return BFALSE;
						}
				}
			else
				{	/* Unsafe/rsa.scm 190 */
					return BFALSE;
				}
		}

	}



/* &rsa-key= */
	obj_t BGl_z62rsazd2keyzd3z63zz__rsaz00(obj_t BgL_envz00_3095,
		obj_t BgL_rsazd2key1zd2_3096, obj_t BgL_rsazd2key2zd2_3097)
	{
		{	/* Unsafe/rsa.scm 189 */
			return
				BGl_rsazd2keyzd3z01zz__rsaz00(BgL_rsazd2key1zd2_3096,
				BgL_rsazd2key2zd2_3097);
		}

	}



/* PKCS1-pad */
	BGL_EXPORTED_DEF obj_t BGl_PKCS1zd2padzd2zz__rsaz00(obj_t BgL_u8vectz00_32,
		obj_t BgL_finalzd2lenzd2_33)
	{
		{	/* Unsafe/rsa.scm 224 */
			{	/* Unsafe/rsa.scm 225 */
				long BgL_lenz00_1540;

				{	/* Unsafe/rsa.scm 225 */
					obj_t BgL_tmpz00_3456;

					BgL_tmpz00_3456 = ((obj_t) BgL_u8vectz00_32);
					BgL_lenz00_1540 = BGL_HVECTOR_LENGTH(BgL_tmpz00_3456);
				}
				{	/* Unsafe/rsa.scm 225 */
					obj_t BgL_nz00_1541;

					{	/* Unsafe/rsa.scm 226 */
						long BgL_b1101z00_1561;

						BgL_b1101z00_1561 = (BgL_lenz00_1540 + 3L);
						if (INTEGERP(BgL_finalzd2lenzd2_33))
							{	/* Unsafe/rsa.scm 226 */
								BgL_nz00_1541 =
									SUBFX(BgL_finalzd2lenzd2_33, BINT(BgL_b1101z00_1561));
							}
						else
							{	/* Unsafe/rsa.scm 226 */
								BgL_nz00_1541 =
									BGl_2zd2zd2zz__r4_numbers_6_5z00(BgL_finalzd2lenzd2_33,
									BINT(BgL_b1101z00_1561));
							}
					}
					{	/* Unsafe/rsa.scm 226 */

						{	/* Unsafe/rsa.scm 227 */
							bool_t BgL_test2073z00_3466;

							if (INTEGERP(BgL_nz00_1541))
								{	/* Unsafe/rsa.scm 227 */
									BgL_test2073z00_3466 = ((long) CINT(BgL_nz00_1541) < 8L);
								}
							else
								{	/* Unsafe/rsa.scm 227 */
									BgL_test2073z00_3466 =
										BGl_2zc3zc3zz__r4_numbers_6_5z00(BgL_nz00_1541, BINT(8L));
								}
							if (BgL_test2073z00_3466)
								{	/* Unsafe/rsa.scm 227 */
									return
										BGl_errorz00zz__errorz00(BGl_symbol2000z00zz__rsaz00,
										BGl_string2002z00zz__rsaz00, BgL_nz00_1541);
								}
							else
								{	/* Unsafe/rsa.scm 231 */
									obj_t BgL_padz00_1543;

									{	/* Unsafe/rsa.scm 232 */
										obj_t BgL_g1047z00_1544;

										BgL_g1047z00_1544 = BGl_list2003z00zz__rsaz00;
										{
											obj_t BgL_lstz00_1546;
											long BgL_iz00_1547;

											BgL_lstz00_1546 = BgL_g1047z00_1544;
											BgL_iz00_1547 = 0L;
										BgL_zc3z04anonymousza31404ze3z87_1548:
											{	/* Unsafe/rsa.scm 233 */
												bool_t BgL_test2075z00_3474;

												if (INTEGERP(BgL_nz00_1541))
													{	/* Unsafe/rsa.scm 233 */
														BgL_test2075z00_3474 =
															(BgL_iz00_1547 < (long) CINT(BgL_nz00_1541));
													}
												else
													{	/* Unsafe/rsa.scm 233 */
														BgL_test2075z00_3474 =
															BGl_2zc3zc3zz__r4_numbers_6_5z00(BINT
															(BgL_iz00_1547), BgL_nz00_1541);
													}
												if (BgL_test2075z00_3474)
													{	/* Unsafe/rsa.scm 234 */
														obj_t BgL_arg1407z00_1551;
														long BgL_arg1408z00_1552;

														{	/* Unsafe/rsa.scm 234 */
															long BgL_arg1409z00_1553;

															{	/* Unsafe/rsa.scm 234 */
																long BgL_b1103z00_1555;

																{	/* Unsafe/rsa.scm 234 */
																	int BgL_arg1800z00_2638;

																	BgL_arg1800z00_2638 = rand();
																	BgL_b1103z00_1555 =
																		BGl_modulofxz00zz__r4_numbers_6_5_fixnumz00(
																		(long) (BgL_arg1800z00_2638), 255L);
																}
																{	/* Unsafe/rsa.scm 234 */

																	BgL_arg1409z00_1553 =
																		(1L + BgL_b1103z00_1555);
															}}
															BgL_arg1407z00_1551 =
																MAKE_YOUNG_PAIR(BINT(BgL_arg1409z00_1553),
																BgL_lstz00_1546);
														}
														BgL_arg1408z00_1552 = (BgL_iz00_1547 + 1L);
														{
															long BgL_iz00_3489;
															obj_t BgL_lstz00_3488;

															BgL_lstz00_3488 = BgL_arg1407z00_1551;
															BgL_iz00_3489 = BgL_arg1408z00_1552;
															BgL_iz00_1547 = BgL_iz00_3489;
															BgL_lstz00_1546 = BgL_lstz00_3488;
															goto BgL_zc3z04anonymousza31404ze3z87_1548;
														}
													}
												else
													{	/* Unsafe/rsa.scm 235 */
														obj_t BgL_arg1411z00_1557;

														{	/* Unsafe/rsa.scm 235 */
															obj_t BgL_arg1412z00_1558;

															BgL_arg1412z00_1558 =
																MAKE_YOUNG_PAIR(BINT(2L), BgL_lstz00_1546);
															BgL_arg1411z00_1557 =
																MAKE_YOUNG_PAIR(BINT(0L), BgL_arg1412z00_1558);
														}
														BgL_padz00_1543 =
															BGl_listzd2ze3u8vectorz31zz__srfi4z00
															(BgL_arg1411z00_1557);
													}
											}
										}
									}
									return
										BGl_u8vectorzd2appendzd2zz__rsaz00(BgL_padz00_1543,
										BgL_u8vectz00_32);
								}
						}
					}
				}
			}
		}

	}



/* &PKCS1-pad */
	obj_t BGl_z62PKCS1zd2padzb0zz__rsaz00(obj_t BgL_envz00_3098,
		obj_t BgL_u8vectz00_3099, obj_t BgL_finalzd2lenzd2_3100)
	{
		{	/* Unsafe/rsa.scm 224 */
			return
				BGl_PKCS1zd2padzd2zz__rsaz00(BgL_u8vectz00_3099,
				BgL_finalzd2lenzd2_3100);
		}

	}



/* PKCS1-unpad */
	BGL_EXPORTED_DEF obj_t BGl_PKCS1zd2unpadzd2zz__rsaz00(obj_t BgL_u8vectz00_34)
	{
		{	/* Unsafe/rsa.scm 241 */
			{	/* Unsafe/rsa.scm 246 */
				long BgL_lenz00_1564;

				{	/* Unsafe/rsa.scm 246 */
					obj_t BgL_tmpz00_3497;

					BgL_tmpz00_3497 = ((obj_t) BgL_u8vectz00_34);
					BgL_lenz00_1564 = BGL_HVECTOR_LENGTH(BgL_tmpz00_3497);
				}
				{
					long BgL_iz00_1566;

					BgL_iz00_1566 = 0L;
				BgL_zc3z04anonymousza31414ze3z87_1567:
					if ((BgL_iz00_1566 >= BgL_lenz00_1564))
						{	/* Unsafe/rsa.scm 248 */
							return
								BGl_errorz00zz__errorz00(BGl_symbol2004z00zz__rsaz00,
								BGl_string2006z00zz__rsaz00, BgL_u8vectz00_34);
						}
					else
						{	/* Unsafe/rsa.scm 250 */
							long BgL_xz00_1570;

							{	/* Unsafe/rsa.scm 250 */
								uint8_t BgL_arg1432z00_1596;

								{	/* Unsafe/rsa.scm 250 */
									obj_t BgL_tmpz00_3503;

									BgL_tmpz00_3503 = ((obj_t) BgL_u8vectz00_34);
									BgL_arg1432z00_1596 =
										BGL_U8VREF(BgL_tmpz00_3503, BgL_iz00_1566);
								}
								{	/* Unsafe/rsa.scm 250 */
									long BgL_arg1931z00_2648;

									BgL_arg1931z00_2648 = (long) (BgL_arg1432z00_1596);
									BgL_xz00_1570 = (long) (BgL_arg1931z00_2648);
							}}
							if ((BgL_xz00_1570 == 0L))
								{
									long BgL_iz00_3510;

									BgL_iz00_3510 = (BgL_iz00_1566 + 1L);
									BgL_iz00_1566 = BgL_iz00_3510;
									goto BgL_zc3z04anonymousza31414ze3z87_1567;
								}
							else
								{	/* Unsafe/rsa.scm 251 */
									if ((BgL_xz00_1570 == 2L))
										{	/* Unsafe/rsa.scm 256 */
											long BgL_g1048z00_1574;

											BgL_g1048z00_1574 = (BgL_iz00_1566 + 1L);
											{
												long BgL_jz00_1576;

												BgL_jz00_1576 = BgL_g1048z00_1574;
											BgL_zc3z04anonymousza31420ze3z87_1577:
												if ((BgL_jz00_1576 >= BgL_lenz00_1564))
													{	/* Unsafe/rsa.scm 257 */
														return
															BGl_errorz00zz__errorz00
															(BGl_symbol2004z00zz__rsaz00,
															BGl_string2006z00zz__rsaz00, BgL_u8vectz00_34);
													}
												else
													{	/* Unsafe/rsa.scm 259 */
														long BgL_xz00_1580;

														{	/* Unsafe/rsa.scm 259 */
															uint8_t BgL_arg1431z00_1593;

															{	/* Unsafe/rsa.scm 259 */
																obj_t BgL_tmpz00_3518;

																BgL_tmpz00_3518 = ((obj_t) BgL_u8vectz00_34);
																BgL_arg1431z00_1593 =
																	BGL_U8VREF(BgL_tmpz00_3518, BgL_jz00_1576);
															}
															{	/* Unsafe/rsa.scm 259 */
																long BgL_arg1931z00_2659;

																BgL_arg1931z00_2659 =
																	(long) (BgL_arg1431z00_1593);
																BgL_xz00_1580 = (long) (BgL_arg1931z00_2659);
														}}
														if ((BgL_xz00_1580 == 0L))
															{	/* Unsafe/rsa.scm 263 */
																bool_t BgL_test2082z00_3525;

																{	/* Unsafe/rsa.scm 263 */

																	BgL_test2082z00_3525 =
																		((BgL_jz00_1576 - BgL_iz00_1566) < 8L);
																}
																if (BgL_test2082z00_3525)
																	{	/* Unsafe/rsa.scm 263 */
																		return
																			BGl_errorz00zz__errorz00
																			(BGl_symbol2004z00zz__rsaz00,
																			BGl_string2006z00zz__rsaz00,
																			BgL_u8vectz00_34);
																	}
																else
																	{	/* Unsafe/rsa.scm 263 */
																		return
																			BGl_subu8vectorz00zz__rsaz00
																			(BgL_u8vectz00_34, (BgL_jz00_1576 + 1L),
																			BgL_lenz00_1564);
																	}
															}
														else
															{
																long BgL_jz00_3531;

																BgL_jz00_3531 = (BgL_jz00_1576 + 1L);
																BgL_jz00_1576 = BgL_jz00_3531;
																goto BgL_zc3z04anonymousza31420ze3z87_1577;
															}
													}
											}
										}
									else
										{	/* Unsafe/rsa.scm 253 */
											return
												BGl_errorz00zz__errorz00(BGl_symbol2004z00zz__rsaz00,
												BGl_string2006z00zz__rsaz00, BgL_u8vectz00_34);
										}
								}
						}
				}
			}
		}

	}



/* &PKCS1-unpad */
	obj_t BGl_z62PKCS1zd2unpadzb0zz__rsaz00(obj_t BgL_envz00_3101,
		obj_t BgL_u8vectz00_3102)
	{
		{	/* Unsafe/rsa.scm 241 */
			return BGl_PKCS1zd2unpadzd2zz__rsaz00(BgL_u8vectz00_3102);
		}

	}



/* rsa-encrypt-u8vector */
	BGL_EXPORTED_DEF obj_t BGl_rsazd2encryptzd2u8vectorz00zz__rsaz00(obj_t
		BgL_u8vectz00_37, obj_t BgL_rsazd2keyzd2_38, obj_t BgL_finalzd2lenzd2_39)
	{
		{	/* Unsafe/rsa.scm 280 */
			{	/* Unsafe/rsa.scm 283 */
				obj_t BgL_arg1436z00_2672;

				{	/* Unsafe/rsa.scm 283 */
					obj_t BgL_arg1437z00_2673;

					BgL_arg1437z00_2673 =
						BGl_u8vectorzd2ze3bignumz31zz__rsaz00(BGl_PKCS1zd2padzd2zz__rsaz00
						(BgL_u8vectz00_37, BgL_finalzd2lenzd2_39));
					BgL_arg1436z00_2672 =
						BGl_exptzd2modze70z35zz__rsaz00(BgL_arg1437z00_2673,
						STRUCT_REF(((obj_t) BgL_rsazd2keyzd2_38), (int) (2L)),
						STRUCT_REF(((obj_t) BgL_rsazd2keyzd2_38), (int) (1L)));
				}
				return BGl_bignumzd2ze3u8vectorz31zz__rsaz00(BgL_arg1436z00_2672);
			}
		}

	}



/* &rsa-encrypt-u8vector */
	obj_t BGl_z62rsazd2encryptzd2u8vectorz62zz__rsaz00(obj_t BgL_envz00_3103,
		obj_t BgL_u8vectz00_3104, obj_t BgL_rsazd2keyzd2_3105,
		obj_t BgL_finalzd2lenzd2_3106)
	{
		{	/* Unsafe/rsa.scm 280 */
			return
				BGl_rsazd2encryptzd2u8vectorz00zz__rsaz00(BgL_u8vectz00_3104,
				BgL_rsazd2keyzd2_3105, BgL_finalzd2lenzd2_3106);
		}

	}



/* rsa-decrypt-u8vector */
	BGL_EXPORTED_DEF obj_t BGl_rsazd2decryptzd2u8vectorz00zz__rsaz00(obj_t
		BgL_u8vectz00_40, obj_t BgL_rsazd2keyzd2_41)
	{
		{	/* Unsafe/rsa.scm 289 */
			{	/* Unsafe/rsa.scm 293 */
				obj_t BgL_arg1439z00_2679;

				{	/* Unsafe/rsa.scm 293 */
					obj_t BgL_arg1440z00_2680;

					{	/* Unsafe/rsa.scm 293 */
						obj_t BgL_arg1441z00_2681;

						BgL_arg1441z00_2681 =
							BGl_u8vectorzd2ze3bignumz31zz__rsaz00(BgL_u8vectz00_40);
						BgL_arg1440z00_2680 =
							BGl_exptzd2modze70z35zz__rsaz00(BgL_arg1441z00_2681,
							STRUCT_REF(
								((obj_t) BgL_rsazd2keyzd2_41),
								(int) (2L)),
							STRUCT_REF(((obj_t) BgL_rsazd2keyzd2_41), (int) (1L)));
					}
					BgL_arg1439z00_2679 =
						BGl_bignumzd2ze3u8vectorz31zz__rsaz00(BgL_arg1440z00_2680);
				}
				return BGl_PKCS1zd2unpadzd2zz__rsaz00(BgL_arg1439z00_2679);
			}
		}

	}



/* &rsa-decrypt-u8vector */
	obj_t BGl_z62rsazd2decryptzd2u8vectorz62zz__rsaz00(obj_t BgL_envz00_3107,
		obj_t BgL_u8vectz00_3108, obj_t BgL_rsazd2keyzd2_3109)
	{
		{	/* Unsafe/rsa.scm 289 */
			return
				BGl_rsazd2decryptzd2u8vectorz00zz__rsaz00(BgL_u8vectz00_3108,
				BgL_rsazd2keyzd2_3109);
		}

	}



/* expt-mod~0 */
	obj_t BGl_exptzd2modze70z35zz__rsaz00(obj_t BgL_nz00_1637,
		obj_t BgL_ez00_1638, obj_t BgL_mz00_1639)
	{
		{	/* Unsafe/rsa.scm 402 */
		BGl_exptzd2modze70z35zz__rsaz00:
			{	/* Unsafe/rsa.scm 397 */
				bool_t BgL_test2083z00_3557;

				{	/* Unsafe/rsa.scm 397 */
					obj_t BgL_tmpz00_3558;

					BgL_tmpz00_3558 = ((obj_t) BgL_ez00_1638);
					BgL_test2083z00_3557 = BXZERO(BgL_tmpz00_3558);
				}
				if (BgL_test2083z00_3557)
					{	/* Unsafe/rsa.scm 397 */
						return (bgl_string_to_bignum("1", 16));
					}
				else
					{	/* Unsafe/rsa.scm 397 */
						if (bgl_bignum_even(((obj_t) BgL_ez00_1638)))
							{
								obj_t BgL_ez00_3567;
								obj_t BgL_nz00_3564;

								BgL_nz00_3564 =
									BGl_modulobxz00zz__r4_numbers_6_5_fixnumz00(bgl_bignum_mul
									(BgL_nz00_1637, BgL_nz00_1637), BgL_mz00_1639);
								BgL_ez00_3567 =
									bgl_bignum_quotient(((obj_t) BgL_ez00_1638),
									(bgl_string_to_bignum("2", 16)));
								BgL_ez00_1638 = BgL_ez00_3567;
								BgL_nz00_1637 = BgL_nz00_3564;
								goto BGl_exptzd2modze70z35zz__rsaz00;
							}
						else
							{	/* Unsafe/rsa.scm 399 */
								return
									BGl_modulobxz00zz__r4_numbers_6_5_fixnumz00(bgl_bignum_mul
									(BgL_nz00_1637, BGl_exptzd2modze70z35zz__rsaz00(BgL_nz00_1637,
											bgl_bignum_sub(((obj_t) BgL_ez00_1638),
												(bgl_string_to_bignum("1", 16))), BgL_mz00_1639)),
									BgL_mz00_1639);
							}
					}
			}
		}

	}



/* u8vector-append */
	obj_t BGl_u8vectorzd2appendzd2zz__rsaz00(obj_t BgL_v1z00_48,
		obj_t BgL_v2z00_49)
	{
		{	/* Unsafe/rsa.scm 409 */
			{	/* Unsafe/rsa.scm 410 */
				long BgL_len1z00_1650;

				BgL_len1z00_1650 = BGL_HVECTOR_LENGTH(BgL_v1z00_48);
				{	/* Unsafe/rsa.scm 410 */
					long BgL_len2z00_1651;

					BgL_len2z00_1651 = BGL_HVECTOR_LENGTH(BgL_v2z00_49);
					{	/* Unsafe/rsa.scm 411 */
						long BgL_lenz00_1652;

						BgL_lenz00_1652 = (BgL_len1z00_1650 + BgL_len2z00_1651);
						{	/* Unsafe/rsa.scm 412 */
							obj_t BgL_resz00_1653;

							{	/* Llib/srfi4.scm 447 */

								BgL_resz00_1653 =
									BGl_makezd2u8vectorzd2zz__srfi4z00(BgL_lenz00_1652,
									(uint8_t) (0));
							}
							{	/* Unsafe/rsa.scm 413 */

								{
									long BgL_iz00_1655;

									BgL_iz00_1655 = 0L;
								BgL_zc3z04anonymousza31469ze3z87_1656:
									if ((BgL_iz00_1655 < BgL_len1z00_1650))
										{	/* Unsafe/rsa.scm 415 */
											{	/* Unsafe/rsa.scm 417 */
												long BgL_arg1471z00_1658;

												{	/* Unsafe/rsa.scm 417 */
													uint8_t BgL_arg1472z00_1659;

													BgL_arg1472z00_1659 =
														BGL_U8VREF(BgL_v1z00_48, BgL_iz00_1655);
													{	/* Unsafe/rsa.scm 417 */
														long BgL_arg1931z00_2705;

														BgL_arg1931z00_2705 = (long) (BgL_arg1472z00_1659);
														BgL_arg1471z00_1658 = (long) (BgL_arg1931z00_2705);
												}}
												{	/* Unsafe/rsa.scm 417 */
													uint8_t BgL_tmpz00_3584;

													BgL_tmpz00_3584 = (uint8_t) (BgL_arg1471z00_1658);
													BGL_U8VSET(BgL_resz00_1653, BgL_iz00_1655,
														BgL_tmpz00_3584);
												} BUNSPEC;
											}
											{
												long BgL_iz00_3587;

												BgL_iz00_3587 = (BgL_iz00_1655 + 1L);
												BgL_iz00_1655 = BgL_iz00_3587;
												goto BgL_zc3z04anonymousza31469ze3z87_1656;
											}
										}
									else
										{
											long BgL_jz00_1662;

											BgL_jz00_1662 = 0L;
										BgL_zc3z04anonymousza31474ze3z87_1663:
											if ((BgL_jz00_1662 < BgL_len2z00_1651))
												{	/* Unsafe/rsa.scm 420 */
													{	/* Unsafe/rsa.scm 422 */
														long BgL_arg1476z00_1665;
														long BgL_arg1477z00_1666;

														BgL_arg1476z00_1665 =
															(BgL_jz00_1662 + BgL_iz00_1655);
														{	/* Unsafe/rsa.scm 422 */
															uint8_t BgL_arg1478z00_1667;

															BgL_arg1478z00_1667 =
																BGL_U8VREF(BgL_v2z00_49, BgL_jz00_1662);
															{	/* Unsafe/rsa.scm 422 */
																long BgL_arg1931z00_2715;

																BgL_arg1931z00_2715 =
																	(long) (BgL_arg1478z00_1667);
																BgL_arg1477z00_1666 =
																	(long) (BgL_arg1931z00_2715);
														}}
														{	/* Unsafe/rsa.scm 422 */
															uint8_t BgL_tmpz00_3595;

															BgL_tmpz00_3595 = (uint8_t) (BgL_arg1477z00_1666);
															BGL_U8VSET(BgL_resz00_1653, BgL_arg1476z00_1665,
																BgL_tmpz00_3595);
														} BUNSPEC;
													}
													{
														long BgL_jz00_3598;

														BgL_jz00_3598 = (BgL_jz00_1662 + 1L);
														BgL_jz00_1662 = BgL_jz00_3598;
														goto BgL_zc3z04anonymousza31474ze3z87_1663;
													}
												}
											else
												{	/* Unsafe/rsa.scm 420 */
													return BgL_resz00_1653;
												}
										}
								}
							}
						}
					}
				}
			}
		}

	}



/* subu8vector */
	obj_t BGl_subu8vectorz00zz__rsaz00(obj_t BgL_vz00_50, long BgL_startz00_51,
		long BgL_endz00_52)
	{
		{	/* Unsafe/rsa.scm 429 */
			{	/* Unsafe/rsa.scm 430 */
				long BgL_lenz00_1673;

				BgL_lenz00_1673 = (BgL_endz00_52 - BgL_startz00_51);
				{	/* Unsafe/rsa.scm 430 */
					obj_t BgL_resz00_1674;

					{	/* Llib/srfi4.scm 447 */

						BgL_resz00_1674 =
							BGl_makezd2u8vectorzd2zz__srfi4z00(BgL_lenz00_1673,
							(uint8_t) (0));
					}
					{	/* Unsafe/rsa.scm 431 */

						{
							long BgL_iz00_1676;

							BgL_iz00_1676 = BgL_startz00_51;
						BgL_zc3z04anonymousza31480ze3z87_1677:
							if ((BgL_iz00_1676 < BgL_endz00_52))
								{	/* Unsafe/rsa.scm 433 */
									{	/* Unsafe/rsa.scm 435 */
										long BgL_arg1482z00_1679;
										long BgL_arg1483z00_1680;

										BgL_arg1482z00_1679 = (BgL_iz00_1676 - BgL_startz00_51);
										{	/* Unsafe/rsa.scm 435 */
											uint8_t BgL_arg1485z00_1681;

											BgL_arg1485z00_1681 =
												BGL_U8VREF(BgL_vz00_50, BgL_iz00_1676);
											{	/* Unsafe/rsa.scm 435 */
												long BgL_arg1931z00_2727;

												BgL_arg1931z00_2727 = (long) (BgL_arg1485z00_1681);
												BgL_arg1483z00_1680 = (long) (BgL_arg1931z00_2727);
										}}
										{	/* Unsafe/rsa.scm 435 */
											uint8_t BgL_tmpz00_3608;

											BgL_tmpz00_3608 = (uint8_t) (BgL_arg1483z00_1680);
											BGL_U8VSET(BgL_resz00_1674, BgL_arg1482z00_1679,
												BgL_tmpz00_3608);
										} BUNSPEC;
									}
									{
										long BgL_iz00_3611;

										BgL_iz00_3611 = (BgL_iz00_1676 + 1L);
										BgL_iz00_1676 = BgL_iz00_3611;
										goto BgL_zc3z04anonymousza31480ze3z87_1677;
									}
								}
							else
								{	/* Unsafe/rsa.scm 433 */
									return BgL_resz00_1674;
								}
						}
					}
				}
			}
		}

	}



/* bignum->u8vector */
	obj_t BGl_bignumzd2ze3u8vectorz31zz__rsaz00(obj_t BgL_nz00_54)
	{
		{	/* Unsafe/rsa.scm 461 */
			{
				obj_t BgL_nz00_1741;

				{	/* Unsafe/rsa.scm 470 */
					long BgL_siza7eza7_1727;

					BgL_nz00_1741 = BgL_nz00_54;
					{
						long BgL_siza7eza7_2751;
						obj_t BgL_accz00_2752;

						BgL_siza7eza7_2751 = 1L;
						BgL_accz00_2752 = (bgl_string_to_bignum("ff", 16));
					BgL_loopz00_2750:
						if (((long) (bgl_bignum_cmp(BgL_nz00_1741, BgL_accz00_2752)) > 0L))
							{
								obj_t BgL_accz00_3619;
								long BgL_siza7eza7_3617;

								BgL_siza7eza7_3617 = (BgL_siza7eza7_2751 + 1L);
								BgL_accz00_3619 =
									bgl_bignum_mul(BgL_accz00_2752, (bgl_string_to_bignum("ff",
											16)));
								BgL_accz00_2752 = BgL_accz00_3619;
								BgL_siza7eza7_2751 = BgL_siza7eza7_3617;
								goto BgL_loopz00_2750;
							}
						else
							{	/* Unsafe/rsa.scm 466 */
								BgL_siza7eza7_1727 = BgL_siza7eza7_2751;
							}
					}
					{	/* Unsafe/rsa.scm 470 */
						obj_t BgL_resz00_1728;

						{	/* Llib/srfi4.scm 447 */

							BgL_resz00_1728 =
								BGl_makezd2u8vectorzd2zz__srfi4z00(BgL_siza7eza7_1727,
								(uint8_t) (0));
						}
						{	/* Unsafe/rsa.scm 471 */

							{
								long BgL_iz00_2775;
								obj_t BgL_vz00_2776;

								BgL_iz00_2775 = 0L;
								BgL_vz00_2776 = BgL_nz00_54;
							BgL_loopz00_2774:
								if ((BgL_iz00_2775 == BgL_siza7eza7_1727))
									{	/* Unsafe/rsa.scm 474 */
										return BgL_resz00_1728;
									}
								else
									{	/* Unsafe/rsa.scm 474 */
										{	/* Unsafe/rsa.scm 477 */
											long BgL_arg1509z00_2780;

											BgL_arg1509z00_2780 =
												bgl_bignum_to_long(bgl_bignum_remainder(BgL_vz00_2776,
													(bgl_string_to_bignum("100", 16))));
											{	/* Unsafe/rsa.scm 477 */
												uint8_t BgL_tmpz00_3626;

												BgL_tmpz00_3626 = (uint8_t) (BgL_arg1509z00_2780);
												BGL_U8VSET(BgL_resz00_1728, BgL_iz00_2775,
													BgL_tmpz00_3626);
											} BUNSPEC;
										}
										{
											obj_t BgL_vz00_3631;
											long BgL_iz00_3629;

											BgL_iz00_3629 = (BgL_iz00_2775 + 1L);
											BgL_vz00_3631 =
												bgl_bignum_quotient(BgL_vz00_2776,
												(bgl_string_to_bignum("100", 16)));
											BgL_vz00_2776 = BgL_vz00_3631;
											BgL_iz00_2775 = BgL_iz00_3629;
											goto BgL_loopz00_2774;
										}
									}
							}
						}
					}
				}
			}
		}

	}



/* u8vector->bignum */
	obj_t BGl_u8vectorzd2ze3bignumz31zz__rsaz00(obj_t BgL_u8vectz00_55)
	{
		{	/* Unsafe/rsa.scm 483 */
			{	/* Unsafe/rsa.scm 484 */
				long BgL_g1050z00_1752;

				{	/* Unsafe/rsa.scm 484 */
					long BgL_arg1532z00_1765;

					BgL_arg1532z00_1765 = BGL_HVECTOR_LENGTH(BgL_u8vectz00_55);
					BgL_g1050z00_1752 = (BgL_arg1532z00_1765 - 1L);
				}
				{
					long BgL_iz00_2805;
					obj_t BgL_az00_2806;

					BgL_iz00_2805 = BgL_g1050z00_1752;
					BgL_az00_2806 = (bgl_string_to_bignum("0", 16));
				BgL_loopz00_2804:
					if ((BgL_iz00_2805 == -1L))
						{	/* Unsafe/rsa.scm 486 */
							return BgL_az00_2806;
						}
					else
						{	/* Unsafe/rsa.scm 488 */
							obj_t BgL_dz00_2809;

							{	/* Unsafe/rsa.scm 488 */
								long BgL_arg1528z00_2810;

								{	/* Unsafe/rsa.scm 488 */
									uint8_t BgL_arg1531z00_2811;

									BgL_arg1531z00_2811 =
										BGL_U8VREF(BgL_u8vectz00_55, BgL_iz00_2805);
									{	/* Unsafe/rsa.scm 488 */
										long BgL_arg1931z00_2815;

										BgL_arg1931z00_2815 = (long) (BgL_arg1531z00_2811);
										BgL_arg1528z00_2810 = (long) (BgL_arg1931z00_2815);
								}}
								BgL_dz00_2809 = bgl_long_to_bignum(BgL_arg1528z00_2810);
							}
							{
								obj_t BgL_az00_3643;
								long BgL_iz00_3641;

								BgL_iz00_3641 = (BgL_iz00_2805 - 1L);
								BgL_az00_3643 =
									bgl_bignum_add(bgl_bignum_mul(BgL_az00_2806,
										(bgl_string_to_bignum("100", 16))), BgL_dz00_2809);
								BgL_az00_2806 = BgL_az00_3643;
								BgL_iz00_2805 = BgL_iz00_3641;
								goto BgL_loopz00_2804;
							}
						}
				}
			}
		}

	}



/* rsa-encrypt-string */
	BGL_EXPORTED_DEF obj_t BGl_rsazd2encryptzd2stringz00zz__rsaz00(obj_t
		BgL_strz00_57, obj_t BgL_keyz00_58)
	{
		{	/* Unsafe/rsa.scm 520 */
			{	/* Unsafe/rsa.scm 521 */
				obj_t BgL_runner1576z00_1825;

				{	/* Unsafe/rsa.scm 522 */
					obj_t BgL_l01120z00_1802;

					{	/* Unsafe/rsa.scm 525 */
						obj_t BgL_arg1558z00_1811;

						{	/* Unsafe/rsa.scm 525 */
							obj_t BgL_arg1559z00_1812;
							long BgL_arg1560z00_1813;

							{	/* Unsafe/rsa.scm 525 */
								obj_t BgL_arg1563z00_1814;

								{	/* Unsafe/rsa.scm 525 */
									obj_t BgL_l01117z00_1815;

									BgL_l01117z00_1815 =
										BGl_stringzd2ze3listz31zz__r4_strings_6_7z00(BgL_strz00_57);
									{
										obj_t BgL_l1116z00_1817;

										BgL_l1116z00_1817 = BgL_l01117z00_1815;
									BgL_zc3z04anonymousza31564ze3z87_1818:
										if (NULLP(BgL_l1116z00_1817))
											{	/* Unsafe/rsa.scm 525 */
												BgL_arg1563z00_1814 = BgL_l01117z00_1815;
											}
										else
											{	/* Unsafe/rsa.scm 525 */
												{	/* Unsafe/rsa.scm 525 */
													long BgL_arg1567z00_1820;

													BgL_arg1567z00_1820 =
														(CCHAR(CAR(((obj_t) BgL_l1116z00_1817))));
													{	/* Unsafe/rsa.scm 525 */
														obj_t BgL_auxz00_3655;
														obj_t BgL_tmpz00_3653;

														BgL_auxz00_3655 = BINT(BgL_arg1567z00_1820);
														BgL_tmpz00_3653 = ((obj_t) BgL_l1116z00_1817);
														SET_CAR(BgL_tmpz00_3653, BgL_auxz00_3655);
												}}
												{	/* Unsafe/rsa.scm 525 */
													obj_t BgL_arg1569z00_1822;

													BgL_arg1569z00_1822 =
														CDR(((obj_t) BgL_l1116z00_1817));
													{
														obj_t BgL_l1116z00_3660;

														BgL_l1116z00_3660 = BgL_arg1569z00_1822;
														BgL_l1116z00_1817 = BgL_l1116z00_3660;
														goto BgL_zc3z04anonymousza31564ze3z87_1818;
													}
												}
											}
									}
								}
								BgL_arg1559z00_1812 =
									BGl_listzd2ze3u8vectorz31zz__srfi4z00(BgL_arg1563z00_1814);
							}
							BgL_arg1560z00_1813 = (STRING_LENGTH(BgL_strz00_57) + 12L);
							{	/* Unsafe/rsa.scm 283 */
								obj_t BgL_arg1436z00_2832;

								{	/* Unsafe/rsa.scm 283 */
									obj_t BgL_arg1437z00_2833;

									BgL_arg1437z00_2833 =
										BGl_u8vectorzd2ze3bignumz31zz__rsaz00
										(BGl_PKCS1zd2padzd2zz__rsaz00(BgL_arg1559z00_1812,
											BINT(BgL_arg1560z00_1813)));
									BgL_arg1436z00_2832 =
										BGl_exptzd2modze70z35zz__rsaz00(BgL_arg1437z00_2833,
										STRUCT_REF(((obj_t) BgL_keyz00_58), (int) (2L)),
										STRUCT_REF(((obj_t) BgL_keyz00_58), (int) (1L)));
								}
								BgL_arg1558z00_1811 =
									BGl_bignumzd2ze3u8vectorz31zz__rsaz00(BgL_arg1436z00_2832);
						}}
						BgL_l01120z00_1802 =
							BGl_u8vectorzd2ze3listz31zz__srfi4z00(BgL_arg1558z00_1811);
					}
					{
						obj_t BgL_l1119z00_1804;

						BgL_l1119z00_1804 = BgL_l01120z00_1802;
					BgL_zc3z04anonymousza31553ze3z87_1805:
						if (NULLP(BgL_l1119z00_1804))
							{	/* Unsafe/rsa.scm 523 */
								BgL_runner1576z00_1825 = BgL_l01120z00_1802;
							}
						else
							{	/* Unsafe/rsa.scm 523 */
								{	/* Unsafe/rsa.scm 523 */
									unsigned char BgL_arg1555z00_1807;

									BgL_arg1555z00_1807 =
										((long) CINT(CAR(((obj_t) BgL_l1119z00_1804))));
									{	/* Unsafe/rsa.scm 523 */
										obj_t BgL_auxz00_3684;
										obj_t BgL_tmpz00_3682;

										BgL_auxz00_3684 = BCHAR(BgL_arg1555z00_1807);
										BgL_tmpz00_3682 = ((obj_t) BgL_l1119z00_1804);
										SET_CAR(BgL_tmpz00_3682, BgL_auxz00_3684);
								}}
								{	/* Unsafe/rsa.scm 523 */
									obj_t BgL_arg1557z00_1809;

									BgL_arg1557z00_1809 = CDR(((obj_t) BgL_l1119z00_1804));
									{
										obj_t BgL_l1119z00_3689;

										BgL_l1119z00_3689 = BgL_arg1557z00_1809;
										BgL_l1119z00_1804 = BgL_l1119z00_3689;
										goto BgL_zc3z04anonymousza31553ze3z87_1805;
									}
								}
							}
					}
				}
				return
					BGl_listzd2ze3stringz31zz__r4_strings_6_7z00(BgL_runner1576z00_1825);
			}
		}

	}



/* &rsa-encrypt-string */
	obj_t BGl_z62rsazd2encryptzd2stringz62zz__rsaz00(obj_t BgL_envz00_3110,
		obj_t BgL_strz00_3111, obj_t BgL_keyz00_3112)
	{
		{	/* Unsafe/rsa.scm 520 */
			{	/* Unsafe/rsa.scm 521 */
				obj_t BgL_auxz00_3691;

				if (STRINGP(BgL_strz00_3111))
					{	/* Unsafe/rsa.scm 521 */
						BgL_auxz00_3691 = BgL_strz00_3111;
					}
				else
					{
						obj_t BgL_auxz00_3694;

						BgL_auxz00_3694 =
							BGl_typezd2errorzd2zz__errorz00(BGl_string1995z00zz__rsaz00,
							BINT(21891L), BGl_string2007z00zz__rsaz00,
							BGl_string2008z00zz__rsaz00, BgL_strz00_3111);
						FAILURE(BgL_auxz00_3694, BFALSE, BFALSE);
					}
				return
					BGl_rsazd2encryptzd2stringz00zz__rsaz00(BgL_auxz00_3691,
					BgL_keyz00_3112);
			}
		}

	}



/* rsa-decrypt-string */
	BGL_EXPORTED_DEF obj_t BGl_rsazd2decryptzd2stringz00zz__rsaz00(obj_t
		BgL_strz00_59, obj_t BgL_keyz00_60)
	{
		{	/* Unsafe/rsa.scm 532 */
			{	/* Unsafe/rsa.scm 533 */
				obj_t BgL_runner1592z00_1847;

				{	/* Unsafe/rsa.scm 534 */
					obj_t BgL_l01126z00_1826;

					{	/* Unsafe/rsa.scm 537 */
						obj_t BgL_arg1583z00_1835;

						{	/* Unsafe/rsa.scm 537 */
							obj_t BgL_arg1584z00_1836;

							{	/* Unsafe/rsa.scm 537 */
								obj_t BgL_arg1586z00_1837;

								{	/* Unsafe/rsa.scm 537 */
									obj_t BgL_l01123z00_1838;

									BgL_l01123z00_1838 =
										BGl_stringzd2ze3listz31zz__r4_strings_6_7z00(BgL_strz00_59);
									{
										obj_t BgL_l1122z00_1840;

										BgL_l1122z00_1840 = BgL_l01123z00_1838;
									BgL_zc3z04anonymousza31587ze3z87_1841:
										if (NULLP(BgL_l1122z00_1840))
											{	/* Unsafe/rsa.scm 537 */
												BgL_arg1586z00_1837 = BgL_l01123z00_1838;
											}
										else
											{	/* Unsafe/rsa.scm 537 */
												{	/* Unsafe/rsa.scm 537 */
													long BgL_arg1589z00_1843;

													BgL_arg1589z00_1843 =
														(CCHAR(CAR(((obj_t) BgL_l1122z00_1840))));
													{	/* Unsafe/rsa.scm 537 */
														obj_t BgL_auxz00_3708;
														obj_t BgL_tmpz00_3706;

														BgL_auxz00_3708 = BINT(BgL_arg1589z00_1843);
														BgL_tmpz00_3706 = ((obj_t) BgL_l1122z00_1840);
														SET_CAR(BgL_tmpz00_3706, BgL_auxz00_3708);
												}}
												{	/* Unsafe/rsa.scm 537 */
													obj_t BgL_arg1591z00_1845;

													BgL_arg1591z00_1845 =
														CDR(((obj_t) BgL_l1122z00_1840));
													{
														obj_t BgL_l1122z00_3713;

														BgL_l1122z00_3713 = BgL_arg1591z00_1845;
														BgL_l1122z00_1840 = BgL_l1122z00_3713;
														goto BgL_zc3z04anonymousza31587ze3z87_1841;
													}
												}
											}
									}
								}
								BgL_arg1584z00_1836 =
									BGl_listzd2ze3u8vectorz31zz__srfi4z00(BgL_arg1586z00_1837);
							}
							{	/* Unsafe/rsa.scm 293 */
								obj_t BgL_arg1439z00_2847;

								{	/* Unsafe/rsa.scm 293 */
									obj_t BgL_arg1440z00_2848;

									{	/* Unsafe/rsa.scm 293 */
										obj_t BgL_arg1441z00_2849;

										BgL_arg1441z00_2849 =
											BGl_u8vectorzd2ze3bignumz31zz__rsaz00
											(BgL_arg1584z00_1836);
										BgL_arg1440z00_2848 =
											BGl_exptzd2modze70z35zz__rsaz00(BgL_arg1441z00_2849,
											STRUCT_REF(((obj_t) BgL_keyz00_60), (int) (2L)),
											STRUCT_REF(((obj_t) BgL_keyz00_60), (int) (1L)));
									}
									BgL_arg1439z00_2847 =
										BGl_bignumzd2ze3u8vectorz31zz__rsaz00(BgL_arg1440z00_2848);
								}
								BgL_arg1583z00_1835 =
									BGl_PKCS1zd2unpadzd2zz__rsaz00(BgL_arg1439z00_2847);
						}}
						BgL_l01126z00_1826 =
							BGl_u8vectorzd2ze3listz31zz__srfi4z00(BgL_arg1583z00_1835);
					}
					{
						obj_t BgL_l1125z00_1828;

						BgL_l1125z00_1828 = BgL_l01126z00_1826;
					BgL_zc3z04anonymousza31577ze3z87_1829:
						if (NULLP(BgL_l1125z00_1828))
							{	/* Unsafe/rsa.scm 535 */
								BgL_runner1592z00_1847 = BgL_l01126z00_1826;
							}
						else
							{	/* Unsafe/rsa.scm 535 */
								{	/* Unsafe/rsa.scm 535 */
									unsigned char BgL_arg1579z00_1831;

									BgL_arg1579z00_1831 =
										((long) CINT(CAR(((obj_t) BgL_l1125z00_1828))));
									{	/* Unsafe/rsa.scm 535 */
										obj_t BgL_auxz00_3734;
										obj_t BgL_tmpz00_3732;

										BgL_auxz00_3734 = BCHAR(BgL_arg1579z00_1831);
										BgL_tmpz00_3732 = ((obj_t) BgL_l1125z00_1828);
										SET_CAR(BgL_tmpz00_3732, BgL_auxz00_3734);
								}}
								{	/* Unsafe/rsa.scm 535 */
									obj_t BgL_arg1582z00_1833;

									BgL_arg1582z00_1833 = CDR(((obj_t) BgL_l1125z00_1828));
									{
										obj_t BgL_l1125z00_3739;

										BgL_l1125z00_3739 = BgL_arg1582z00_1833;
										BgL_l1125z00_1828 = BgL_l1125z00_3739;
										goto BgL_zc3z04anonymousza31577ze3z87_1829;
									}
								}
							}
					}
				}
				return
					BGl_listzd2ze3stringz31zz__r4_strings_6_7z00(BgL_runner1592z00_1847);
			}
		}

	}



/* &rsa-decrypt-string */
	obj_t BGl_z62rsazd2decryptzd2stringz62zz__rsaz00(obj_t BgL_envz00_3113,
		obj_t BgL_strz00_3114, obj_t BgL_keyz00_3115)
	{
		{	/* Unsafe/rsa.scm 532 */
			{	/* Unsafe/rsa.scm 533 */
				obj_t BgL_auxz00_3741;

				if (STRINGP(BgL_strz00_3114))
					{	/* Unsafe/rsa.scm 533 */
						BgL_auxz00_3741 = BgL_strz00_3114;
					}
				else
					{
						obj_t BgL_auxz00_3744;

						BgL_auxz00_3744 =
							BGl_typezd2errorzd2zz__errorz00(BGl_string1995z00zz__rsaz00,
							BINT(22352L), BGl_string2009z00zz__rsaz00,
							BGl_string2008z00zz__rsaz00, BgL_strz00_3114);
						FAILURE(BgL_auxz00_3744, BFALSE, BFALSE);
					}
				return
					BGl_rsazd2decryptzd2stringz00zz__rsaz00(BgL_auxz00_3741,
					BgL_keyz00_3115);
			}
		}

	}



/* object-init */
	obj_t BGl_objectzd2initzd2zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			return BUNSPEC;
		}

	}



/* generic-init */
	obj_t BGl_genericzd2initzd2zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			return BUNSPEC;
		}

	}



/* method-init */
	obj_t BGl_methodzd2initzd2zz__rsaz00(void)
	{
		{	/* Unsafe/rsa.scm 16 */
			return BUNSPEC;
		}

	}

#ifdef __cplusplus
}
#endif
