BN_exp
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
bn_check(BN_exp(a, a, p, ctx));