Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Aug 16, 2023
1 parent 2fc158f commit 87911a0
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions include/mcl/invmod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,26 @@ void mulUnit(SintT<N+1>&z, const SintT<N>& x, INT y)
z.sign = x.sign ^ (y < 0);
}

template<int N>
struct InvModT {
typedef SintT<N> Sint;
#if MCL_SIZEOF_UNIT == 4
typedef int32_t INT;
static const int modL = 30;
typedef int32_t INT;
static const int modL = 30;
#else
typedef int64_t INT;
static const int modL = 62;
typedef int64_t INT;
static const int modL = 62;
#endif
static const INT modN = INT(1) << modL;
static const INT half = modN / 2;
static const INT MASK = modN - 1;
static const INT modN = INT(1) << modL;
static const INT half = modN / 2;
static const INT MASK = modN - 1;

struct Quad {
INT u, v, q, r;
};

template<int N>
struct InvModT {
typedef SintT<N> Sint;
Sint M;
INT Mi;
struct Quad {
INT u, v, q, r;
};
void init(const mpz_class& mM)
{
toSint(M, mM);
Expand Down

0 comments on commit 87911a0

Please sign in to comment.