bn_is_perfect_square
if (!bn_is_perfect_square(&is_perfect_square, n, ctx))
int bn_is_perfect_square(int *out_perfect, const BIGNUM *n, BN_CTX *ctx);