For faster navigation, this Iframe is preloading the Wikiwand page for 离散对数的波拉德ρ算法.

离散对数的波拉德ρ算法

此条目翻译品质不佳。 (2018年4月17日)翻译者可能不熟悉中文或原文语言,也可能使用了机器翻译。请协助翻译本条目或重新编写,并注意避免翻译腔的问题。明显拙劣的翻译请改挂((d|G13))提交删除。

离散对数的波拉德ρ算法约翰·波拉德英语John Pollard (mathematician)1978年所发明解决离散对数问题的算法。

算法的目标是求 使得 ,其中 属于一个由 生成的 循环群 。该算法寻找 , , , 使得 。若他们基于的群是一个 阶的循环群,则 是方程 的其中一个解。

为求得 , , , , 该算法使用 Floyd判圈算法 在数列 中寻找一个环。 假设映射 是近似于随机的,则有可能在约 步后发现一个环。可使用一下规则来生成一个此类映射:将 分割为三个不相交的子集 ,且其所含元素数量大致相等,如果 则将 加倍; 如果 则将 自增; 如果 则将 自增。

算法

[编辑]

使 G 是一个 p 阶的 循环群, 且有 , 以及一个分割 , 定义映射

并据以下方式定义映射

 输入 a: a 是 G 的生成元, b: G 的一个元素
 输出 整数 x 使得 ax = b, 或者失败

 初始化 a0 ← 0, b0 ← 0, x0 ← 1 ∈ G, 

 i ← 1
 loop
     xif(xi-1), 
     aig(xi-1, ai-1), 
     bih(xi-1, bi-1)

     x2if(f(x2i-2)), 
     a2ig(f(x2i-2), g(x2i-2, a2i-2)), 
     b2ih(f(x2i-2), h(x2i-2, b2i-2))

     if xi = x2i then
         rbi - b2i
         if r = 0 return failure
         xr−1(a2i - ai) mod p
         return x
     else # xix2i
         ii+1, 
         break loop
     end if
  end loop

举例

[编辑]

例如一个由 2 模 生成的群(群的阶是,2是生成元,生成群的元素模1019同余)。这个算法可由以下 C++ 程序实现。

 #include <stdio.h>
 
 const int n = 1018, N = n + 1;  /* N = 1019 -- 素数       */
 const int alpha = 2;            /* 生成元                 */
 const int beta = 5;             /* 2^{10} = 1024 = 5 (N) */
 
 void new_xab( int& x, int& a, int& b ) {
   switch( x%3 ) {
   case 0: x = x*x     % N;  a =  a*2  % n;  b =  b*2  % n;  break;
   case 1: x = x*alpha % N;  a = (a+1) % n;                  break;
   case 2: x = x*beta  % N;                  b = (b+1) % n;  break;
   }
 }
 
 int main(void) {
   int x=1, a=0, b=0;
   int X=x, A=a, B=b;
   for(int i = 1; i < n; ++i ) {
     new_xab( x, a, b );
     new_xab( X, A, B );
     new_xab( X, A, B );
     printf( "%3d  %4d %3d %3d  %4d %3d %3d\n", i, x, a, b, X, A, B );
     if( x == X ) break;
   }
   return 0;
 }

结果如下 (已截断):

 i     x   a   b     X   A   B
------------------------------
 1     2   1   0    10   1   1
 2    10   1   1   100   2   2
 3    20   2   1  1000   3   3
 4   100   2   2   425   8   6
 5   200   3   2   436  16  14
 6  1000   3   3   284  17  15
 7   981   4   3   986  17  17
 8   425   8   6   194  17  19
..............................
48   224 680 376    86 299 412
49   101 680 377   860 300 413
50   505 680 378   101 300 415
51  1010 681 378  1010 301 416

可见 以及 。 正如预期,其中 是一个解。由于 不是素数,因此存在另一个解 ,使得 成立。

复杂度

[编辑]

时间复杂度近似于 。如果配合使用 Pohlig-Hellman 算法英语Pohlig-Hellman algorithm,则整体时间复杂度近似于 ,其中 的最大质因数。

参考文献

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
离散对数的波拉德ρ算法
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?