Use BN_div instead of BN_mod

BN_mod is not available on all plateform and can be replaced by BN_div
with dv set as NULL.