ERR_print_errors(out);
ERR_print_errors_fp(stderr);
int main(int argc, char *argv[])	{	BN_CTX *ctx;	BIO *out;	char *outfile=NULL;	results = 0;	RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't	                                       * even check its return value	                                       * (which we should) */	argc--;	argv++;	while (argc >= 1)		{		if (strcmp(*argv,"-results") == 0)			results=1;		else if (strcmp(*argv,"-out") == 0)			{			if (--argc < 1) break;			outfile= *(++argv);			}		argc--;		argv++;		}	ctx=BN_CTX_new();	if (ctx == NULL) exit(1);	out=BIO_new(BIO_s_file());	if (out == NULL) exit(1);	if (outfile == NULL)		{		BIO_set_fp(out,stdout,BIO_NOCLOSE);		}	else		{		if (!BIO_write_filename(out,outfile))			{			perror(outfile);			exit(1);			}		}	if (!results)		BIO_puts(out,"obase=16\nibase=16\n");	fprintf(stderr,"test BN_add\n");	if (!test_add(out)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_sub\n");	if (!test_sub(out)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_lshift1\n");	if (!test_lshift1(out)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_lshift (fixed)\n");	if (!test_lshift(out,ctx,BN_bin2bn(lst,sizeof(lst)-1,NULL)))	    goto err;	fflush(stdout);	fprintf(stderr,"test BN_lshift\n");	if (!test_lshift(out,ctx,NULL)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_rshift1\n");	if (!test_rshift1(out)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_rshift\n");	if (!test_rshift(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_sqr\n");	if (!test_sqr(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_mul\n");	if (!test_mul(out)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_div\n");	if (!test_div(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_div_recp\n");	if (!test_div_recp(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_mod\n");	if (!test_mod(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_mod_mul\n");	if (!test_mod_mul(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_mont\n");	if (!test_mont(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_mod_exp\n");	if (!test_mod_exp(out,ctx)) goto err;	fflush(stdout);	fprintf(stderr,"test BN_exp\n");	if (!test_exp(out,ctx)) goto err;	fflush(stdout);	BN_CTX_free(ctx);	BIO_free(out);/**/	exit(0);err:	BIO_puts(out,"1\n"); /* make sure bc fails if we are piping to it */	ERR_load_crypto_strings();	ERR_print_errors(out);	exit(1);	return(1);	}