亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gf2x.txt

?? 大數運算類
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
GF2X InvMod(const GF2X& a, const GF2X& f);
// x = a^{-1} % f, error is a is not invertible

long InvModStatus(GF2X& x, const GF2X& a, const GF2X& f);
// if (a, f) = 1, returns 0 and sets x = a^{-1} % f; otherwise,
// returns 1 and sets x = (a, f)


// for modular exponentiation, see below



/**************************************************************************\

                     Modular Arithmetic with Pre-Conditioning

If you need to do a lot of arithmetic modulo a fixed f, build
GF2XModulus F for f.  This pre-computes information about f that
speeds up subsequent computations.

As an example, the following routine computes the product modulo f of a vector
of polynomials.

#include <NTL/GF2X.h>

void product(GF2X& x, const vec_GF2X& v, const GF2X& f)
{
   GF2XModulus F(f);
   GF2X res;
   res = 1;
   long i;
   for (i = 0; i < v.length(); i++)
      MulMod(res, res, v[i], F); 
   x = res;
}


Note that automatic conversions are provided so that a GF2X can
be used wherever a GF2XModulus is required, and a GF2XModulus
can be used wherever a GF2X is required.

The GF2XModulus routines optimize several important special cases:

  - f = X^n + X^k + 1, where k <= min((n+1)/2, n-NTL_BITS_PER_LONG)

  - f = X^n + X^{k_3} + X^{k_2} + X^{k_1} + 1,
      where k_3 <= min((n+1)/2, n-NTL_BITS_PER_LONG)

  - f = X^n + g, where deg(g) is small


\**************************************************************************/

class GF2XModulus {
public:
   GF2XModulus(); // initially in an unusable state
   ~GF2XModulus();

   GF2XModulus(const GF2XModulus&);  // copy

   GF2XModulus& operator=(const GF2XModulus&);   // assignment

   GF2XModulus(const GF2X& f); // initialize with f, deg(f) > 0

   operator const GF2X& () const; 
   // read-only access to f, implicit conversion operator

   const GF2X& val() const; 
   // read-only access to f, explicit notation

   long WordLength() const;
   // returns word-length of resisues
};

void build(GF2XModulus& F, const GF2X& f);
// pre-computes information about f and stores it in F; deg(f) > 0.
// Note that the declaration GF2XModulus F(f) is equivalent to
// GF2XModulus F; build(F, f).

// In the following, f refers to the polynomial f supplied to the
// build routine, and n = deg(f).

long deg(const GF2XModulus& F);  // return deg(f)

void MulMod(GF2X& x, const GF2X& a, const GF2X& b, const GF2XModulus& F);
GF2X MulMod(const GF2X& a, const GF2X& b, const GF2XModulus& F);
// x = (a * b) % f; deg(a), deg(b) < n

void SqrMod(GF2X& x, const GF2X& a, const GF2XModulus& F);
GF2X SqrMod(const GF2X& a, const GF2XModulus& F);
// x = a^2 % f; deg(a) < n

void MulByXMod(GF2X& x, const GF2X& a, const GF2XModulus& F);
GF2X MulByXMod(const GF2X& a, const GF2XModulus& F);
// x = (a * X) mod F

void PowerMod(GF2X& x, const GF2X& a, const ZZ& e, const GF2XModulus& F);
GF2X PowerMod(const GF2X& a, const ZZ& e, const GF2XModulus& F);

void PowerMod(GF2X& x, const GF2X& a, long e, const GF2XModulus& F);
GF2X PowerMod(const GF2X& a, long e, const GF2XModulus& F);

// x = a^e % f; deg(a) < n (e may be negative)

void PowerXMod(GF2X& x, const ZZ& e, const GF2XModulus& F);
GF2X PowerXMod(const ZZ& e, const GF2XModulus& F);

void PowerXMod(GF2X& x, long e, const GF2XModulus& F);
GF2X PowerXMod(long e, const GF2XModulus& F);

// x = X^e % f (e may be negative)


void rem(GF2X& x, const GF2X& a, const GF2XModulus& F);
// x = a % f

void DivRem(GF2X& q, GF2X& r, const GF2X& a, const GF2XModulus& F);
// q = a/f, r = a%f

void div(GF2X& q, const GF2X& a, const GF2XModulus& F);
// q = a/f

// operator notation:

GF2X operator/(const GF2X& a, const GF2XModulus& F);
GF2X operator%(const GF2X& a, const GF2XModulus& F);

GF2X& operator/=(GF2X& x, const GF2XModulus& F);
GF2X& operator%=(GF2X& x, const GF2XModulus& F);


/**************************************************************************\

                             vectors of GF2X's

\**************************************************************************/

NTL_vector_decl(GF2X,vec_GF2X)
// vec_GF2X

NTL_eq_vector_decl(GF2X,vec_GF2X)
// == and !=

NTL_io_vector_decl(GF2X,vec_GF2X)
// I/O operators


/**************************************************************************\

                              Modular Composition

Modular composition is the problem of computing g(h) mod f for
polynomials f, g, and h.

The algorithm employed is that of Brent & Kung (Fast algorithms for
manipulating formal power series, JACM 25:581-595, 1978), which uses
O(n^{1/2}) modular polynomial multiplications, and O(n^2) scalar
operations.



\**************************************************************************/

void CompMod(GF2X& x, const GF2X& g, const GF2X& h, const GF2XModulus& F);
GF2X CompMod(const GF2X& g, const GF2X& h, const GF2XModulus& F);
// x = g(h) mod f; deg(h) < n

void Comp2Mod(GF2X& x1, GF2X& x2, const GF2X& g1, const GF2X& g2,
              const GF2X& h, const GF2XModulus& F);
// xi = gi(h) mod f (i=1,2), deg(h) < n.

void CompMod3(GF2X& x1, GF2X& x2, GF2X& x3, 
              const GF2X& g1, const GF2X& g2, const GF2X& g3,
              const GF2X& h, const GF2XModulus& F);
// xi = gi(h) mod f (i=1..3), deg(h) < n


/**************************************************************************\

                     Composition with Pre-Conditioning

If a single h is going to be used with many g's then you should build
a GF2XArgument for h, and then use the compose routine below.  The
routine build computes and stores h, h^2, ..., h^m mod f.  After this
pre-computation, composing a polynomial of degree roughly n with h
takes n/m multiplies mod f, plus n^2 scalar multiplies.  Thus,
increasing m increases the space requirement and the pre-computation
time, but reduces the composition time.

\**************************************************************************/


struct GF2XArgument {
   vec_GF2X H;
};

void build(GF2XArgument& H, const GF2X& h, const GF2XModulus& F, long m);
// Pre-Computes information about h.  m > 0, deg(h) < n

void CompMod(GF2X& x, const GF2X& g, const GF2XArgument& H, 
             const GF2XModulus& F);

GF2X CompMod(const GF2X& g, const GF2XArgument& H, 
             const GF2XModulus& F);


extern long GF2XArgBound;

// Initially 0.  If this is set to a value greater than zero, then
// composition routines will allocate a table of no than about
// GF2XArgBound KB.  Setting this value affects all compose routines
// and the power projection and minimal polynomial routines below, 
// and indirectly affects many routines in GF2XFactoring.

/**************************************************************************\

                     Power Projection routines

\**************************************************************************/

void project(GF2& x, const vec_GF2& a, const GF2X& b);
GF2 project(const vec_GF2& a, const GF2X& b);
// x = inner product of a with coefficient vector of b


void ProjectPowers(vec_GF2& x, const vec_GF2& a, long k,
                   const GF2X& h, const GF2XModulus& F);

vec_GF2 ProjectPowers(const vec_GF2& a, long k,
                   const GF2X& h, const GF2XModulus& F);

// Computes the vector 

//   (project(a, 1), project(a, h), ..., project(a, h^{k-1} % f).  

// Restriction: must have a.length <= deg(F) and deg(h) < deg(F).
// This operation is really the "transpose" of the modular composition 
// operation.

void ProjectPowers(vec_GF2& x, const vec_GF2& a, long k,
                   const GF2XArgument& H, const GF2XModulus& F);

vec_GF2 ProjectPowers(const vec_GF2& a, long k,
                   const GF2XArgument& H, const GF2XModulus& F);

// same as above, but uses a pre-computed GF2XArgument


// lower-level routines for transposed modular multiplication:

class GF2XTransMultiplier { /* ... */ };

void build(GF2XTransMultiplier& B, const GF2X& b, const GF2XModulus& F);

// build a GF2XTransMultiplier to use in the following routine:

void UpdateMap(vec_GF2& x, const vec_GF2& a, const GF2XTransMultiplier& B,
         const GF2XModulus& F);

vec_GF2 UpdateMap(const vec_GF2& a, const GF2XTransMultiplier& B,
         const GF2XModulus& F);

// Computes the vector

//   project(a, b), project(a, (b*X)%f), ..., project(a, (b*X^{n-1})%f)

// Restriction: must have a.length() <= deg(F) and deg(b) < deg(F).
// This is really the transpose of modular multiplication.
// Input may have "high order" zeroes stripped.
// Output always has high order zeroes stripped.


/**************************************************************************\

                              Minimum Polynomials

All of these routines implement the algorithm from [Shoup, J. Symbolic
Comp. 17:371-391, 1994] and [Shoup, J. Symbolic Comp. 20:363-397,
1995], based on transposed modular composition and the
Berlekamp/Massey algorithm.

\**************************************************************************/


void MinPolySeq(GF2X& h, const vec_GF2& a, long m);
// computes the minimum polynomial of a linealy generated sequence; m
// is a bound on the degree of the polynomial; required: a.length() >=
// 2*m

void ProbMinPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F, long m);
GF2X ProbMinPolyMod(const GF2X& g, const GF2XModulus& F, long m);

void ProbMinPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F);
GF2X ProbMinPolyMod(const GF2X& g, const GF2XModulus& F);

// computes the monic minimal polynomial if (g mod f).  m = a bound on
// the degree of the minimal polynomial; in the second version, this
// argument defaults to n.  The algorithm is probabilistic; it always
// returns a divisor of the minimal polynomial, possibly a proper divisor.

void MinPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F, long m);
GF2X MinPolyMod(const GF2X& g, const GF2XModulus& F, long m);

void MinPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F);
GF2X MinPolyMod(const GF2X& g, const GF2XModulus& F);

// same as above, but guarantees that result is correct

void IrredPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F, long m);
GF2X IrredPolyMod(const GF2X& g, const GF2XModulus& F, long m);

void IrredPolyMod(GF2X& h, const GF2X& g, const GF2XModulus& F);
GF2X IrredPolyMod(const GF2X& g, const GF2XModulus& F);

// same as above, but assumes that F is irreducible, or at least that
// the minimal poly of g is itself irreducible.  The algorithm is
// deterministic (and is always correct).


/**************************************************************************\

                                Traces

\**************************************************************************/


void TraceMod(GF2& x, const GF2X& a, const GF2XModulus& F);
GF2 TraceMod(const GF2X& a, const GF2XModulus& F);

void TraceMod(GF2& x, const GF2X& a, const GF2X& f);
GF2 TraceMod(const GF2X& a, const GF2X& f);
// x = Trace(a mod f); deg(a) < deg(f)


void TraceVec(vec_GF2& S, const GF2X& f);
vec_GF2 TraceVec(const GF2X& f);
// S[i] = Trace(X^i mod f), i = 0..deg(f)-1; 0 < deg(f)

// The above routines implement the asymptotically fast trace
// algorithm from [von zur Gathen and Shoup, Computational Complexity,
// 1992].


/**************************************************************************\

                           Miscellany

\**************************************************************************/


void clear(GF2X& x) // x = 0
void set(GF2X& x); // x = 1

void GF2X::normalize();  
// f.normalize() strips leading zeros from f.rep.

void GF2X::SetMaxLength(long n);
// f.SetMaxLength(n) pre-allocate spaces for n coefficients.  The
// polynomial that f represents is unchanged.

void GF2X::kill();
// f.kill() sets f to 0 and frees all memory held by f.  Equivalent to
// f.rep.kill().

GF2X::GF2X(INIT_SIZE_TYPE, long n);
// GF2X(INIT_SIZE, n) initializes to zero, but space is pre-allocated
// for n coefficients

static const GF2X& zero();
// GF2X::zero() is a read-only reference to 0

void swap(GF2X& x, GF2X& y); 
// swap x and y (via "pointer swapping")

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久午夜精品| 99精品视频在线免费观看| 欧美三级电影网| 亚洲国产综合在线| 欧美三片在线视频观看 | 91精品国产91久久综合桃花| 亚洲激情综合网| 欧美三级蜜桃2在线观看| 日韩极品在线观看| 久久久www成人免费无遮挡大片| 国产综合色在线视频区| 国产精品欧美一区喷水| 97se亚洲国产综合自在线| 一区二区国产视频| 欧美不卡激情三级在线观看| 风间由美一区二区av101| 最新中文字幕一区二区三区| 欧美日韩在线电影| 久久99久久久久久久久久久| 中文字幕高清不卡| 欧美在线免费观看视频| 老色鬼精品视频在线观看播放| 国产日本欧美一区二区| 在线亚洲人成电影网站色www| 蜜臀av一区二区在线免费观看 | 日韩中文字幕91| 久久亚洲影视婷婷| 97久久精品人人爽人人爽蜜臀| 亚洲五月六月丁香激情| 26uuu久久天堂性欧美| 一道本成人在线| 久久99深爱久久99精品| 亚洲三级在线观看| 日韩三级在线免费观看| 成人免费高清视频在线观看| 婷婷久久综合九色综合绿巨人| 久久毛片高清国产| 欧美精品乱人伦久久久久久| 国产成人免费视频网站| 日本在线不卡视频| 最新国产成人在线观看| 26uuu亚洲| 3751色影院一区二区三区| av亚洲精华国产精华精华| 美女视频第一区二区三区免费观看网站| 中文字幕av一区二区三区免费看| 欧美区一区二区三区| av亚洲精华国产精华精| 九九热在线视频观看这里只有精品| 亚洲人成人一区二区在线观看| 欧美成人精精品一区二区频| 欧美午夜在线观看| 99麻豆久久久国产精品免费优播| 久久精品国产77777蜜臀| 亚洲综合另类小说| 国产精品国产自产拍在线| 精品国产91久久久久久久妲己| 欧美视频你懂的| 91麻豆自制传媒国产之光| 福利91精品一区二区三区| 美女视频网站久久| 免费久久99精品国产| 午夜av区久久| 亚洲愉拍自拍另类高清精品| 自拍视频在线观看一区二区| 国产色产综合产在线视频| 精品久久久久久无| 欧美一级片免费看| 欧美日韩一级二级| 欧美色涩在线第一页| 欧美伊人精品成人久久综合97| 91免费国产在线| 北条麻妃一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 国产精品自在欧美一区| 国内不卡的二区三区中文字幕| 美女任你摸久久| 看国产成人h片视频| 日本成人在线电影网| 日本亚洲天堂网| 男男成人高潮片免费网站| 日产欧产美韩系列久久99| 日本不卡在线视频| 日产国产欧美视频一区精品 | 久久国产免费看| 激情成人综合网| 国内精品写真在线观看| 国产美女av一区二区三区| 国产精华液一区二区三区| 国产91丝袜在线观看| 成人国产在线观看| 色综合天天在线| 欧美精品xxxxbbbb| 精品乱码亚洲一区二区不卡| 久久这里只有精品首页| 国产欧美一区二区在线| 1000精品久久久久久久久| 亚洲激情一二三区| 日本欧美在线看| 国产麻豆一精品一av一免费| 成人av午夜电影| 欧美怡红院视频| 欧美成人三级在线| 国产精品久久夜| 亚洲h在线观看| 久久99精品国产.久久久久久| 国产精品一二三区在线| 成人黄色软件下载| 欧美午夜不卡视频| 精品福利一区二区三区免费视频| 国产欧美日产一区| 一区二区三区免费在线观看| 青青草伊人久久| 波多野结衣中文字幕一区二区三区| 在线视频欧美精品| 欧美电视剧在线看免费| 国产精品欧美一级免费| 午夜一区二区三区在线观看| 韩国成人在线视频| 在线精品亚洲一区二区不卡| 日韩欧美色综合网站| 中文字幕一区二区三区蜜月 | 国产在线麻豆精品观看| 99久久精品国产一区二区三区| 欧美日韩午夜精品| 日本一区二区不卡视频| 日韩中文字幕av电影| 成人一级视频在线观看| 91麻豆精品91久久久久同性| 国产精品电影一区二区三区| 欧美aⅴ一区二区三区视频| 99视频有精品| 久久综合色播五月| 亚洲国产日韩在线一区模特| 国产精品自拍一区| 6080日韩午夜伦伦午夜伦| 成人免费视频国产在线观看| 亚洲精品网站在线观看| 日韩一区中文字幕| 麻豆精品国产91久久久久久| 一本色道**综合亚洲精品蜜桃冫| 亚洲另类中文字| 国产成人三级在线观看| 欧美一级高清大全免费观看| 亚洲女人小视频在线观看| 国产传媒日韩欧美成人| 日韩精品一区二区三区视频播放| 一区二区三区免费观看| 成人av在线播放网址| 久久免费美女视频| 久久99热99| 日韩欧美一区二区免费| 亚洲第一福利一区| 日本黄色一区二区| 亚洲精品一二三区| 91在线国内视频| 中文字幕中文字幕中文字幕亚洲无线| 极品销魂美女一区二区三区| 欧美一区午夜视频在线观看| 午夜精品久久久久久久久久| 91精品91久久久中77777| 亚洲色图都市小说| 色综合色狠狠天天综合色| 中文字幕一区二区三区色视频| 成人精品小蝌蚪| 亚洲国产精品高清| 成人午夜电影小说| 中文字幕不卡在线观看| 成人涩涩免费视频| 国产精品伦理在线| a级高清视频欧美日韩| 国产精品高潮久久久久无| 中日韩av电影| 成人美女在线观看| 中文字幕在线观看一区二区| 丁香婷婷综合色啪| 国产精品国产三级国产aⅴ入口 | 欧美国产精品久久| 成人午夜激情视频| 亚洲精品欧美二区三区中文字幕| 91在线视频播放地址| 一区二区三区久久| 欧美日韩一级黄| 免费在线视频一区| 久久噜噜亚洲综合| av电影一区二区| 亚洲综合精品自拍| 欧美一区二区日韩| 国产在线观看一区二区| 国产精品全国免费观看高清| 91网上在线视频| 亚洲国产视频一区二区| 欧美一区二区网站| 国产精品一区二区x88av| 国产精品人成在线观看免费| 色噜噜狠狠成人中文综合| 日韩在线播放一区二区| 久久综合999| 日本高清视频一区二区| 日本aⅴ亚洲精品中文乱码|