add powermod for BigInt