Content deleted Content added
→Algorithm: Simplify pseudocode (step 1): Clarify computation of x_{2i}, a_{2i} and b_{2i} by introducing x_{2i-1}, a_{2i-1} and b_{2i-1} temporaries. |
fix link in references |
||
(One intermediate revision by one other user not shown) | |||
Line 38:
'''output:''' An integer ''x'' such that ''a<sup>x</sup>'' = ''b'', or failure
Initialise ''i'' ← 0, ''a''<sub>0</sub> ← 0, ''b''<sub>0</sub> ← 0, ''x''<sub>0</sub> ← 1 ∈ ''G''
'''loop'''
''
''a<sub>i</sub>'' ← ''g''(''x''<sub>''i''-1</sub>, ''a''<sub>''i''-1</sub>),▼
''b<sub>i</sub>'' ← ''h''(''x''<sub>''i''-1</sub>, ''b''<sub>''i''-1</sub>)▼
''x
''a
''b
''x''<sub>2''i''</sub> ← ''f''(''x''<sub>2''i''-1</sub>),▼
''x'
'''if''' r = 0 '''return failure'''▼
''b'
'''return''' ''r''<sup><span class="nowrap" style="padding-left:0.1em">−1</span></sup>(''a''<sub>2''i''</sub> − ''a<sub>i</sub>'') mod ''n''
==Example==
Line 121 ⟶ 117:
{{Reflist}}
*{{cite journal |first=J. M. |last=Pollard |title=Monte Carlo methods for index computation (mod ''p'') |journal=[[Mathematics of Computation]] |volume=32 |year=1978 |issue=143 |pages=918–924 |doi= 10.2307/2006496 |jstor=2006496 }}
*{{cite book |first1=Alfred J. |last1=Menezes |first2=Paul C. |last2=van Oorschot |first3=Scott A. |last3=Vanstone |chapter-url=
{{Number-theoretic algorithms}}
|