我試圖在楓樹實施費爾馬攻擊,但它給了我一個錯誤,指出Error,
(unexpected
。超級初學者與楓樹,所以如果任何人誰有一定的經驗可以幫助,這將不勝感激。使用楓實施費馬攻擊
而且,我試圖因素的整數,125位長。有誰知道在楓樹任何有效的算法或任何其他程序可以處理和係數的這種大整數?
FermatAtttack:=proc(n::And(posint,odd), maxnumsteps::posint:=10^7,(numsteps::truefalse:=false))
local x, k, r, i, y:
x:=isqrt(n);
if x^2 < n then
x:= x+1
end if;
k:=2*x+1;
r:=x^2-n;
for i to maxnumsteps while not issqr(r) do
r:=r+k;
k:=k+2
end do;
if issqr(r) then
x:=(k-1)/2;
y:=isqrt(r)
else
error "%1 could not facot in %2 iteratioons", n, maxnumsteps
end if;
if not numsteps then
x-y, x+y
else
x-y, x+y, i
end if;
end proc: