static int test_exp_mod_zero() {
	BIGNUM *a = NULL, *p = NULL, *m = NULL;
	BIGNUM *r = NULL;
	BN_CTX *ctx = BN_CTX_new();
	int ret = 1;

	m = BN_new();
	if(!m) goto err;
	BN_one(m);

	a = BN_new();
	if(!a) goto err;
	BN_one(a);

	p = BN_new();
	if(!p) goto err;
	BN_zero(p);

	r = BN_new();
	if(!r) goto err;
	BN_mod_exp(r, a, p, m, ctx);
	BN_CTX_free(ctx);

	if (BN_is_zero(r))
		ret = 0;
	else
		{
		printf("1**0 mod 1 = ");
		BN_print_fp(stdout, r);
		printf(", should be 0\n");
		}

err:
	BN_free(r);
	BN_free(a);
	BN_free(p);
	BN_free(m);

	return ret;
}