質問編集履歴
3
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
def ec_third(A):
|
42
42
|
t=((3*A[0]**2+a)*inv(2*A[1],p))%p
|
43
|
-
l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2),p)%p
|
43
|
+
l=((t*(t**2-3*A[0]))*inv((3*A[0]-t**2),p)%p
|
44
44
|
x=(l**2-t**2+A[0])%p
|
45
45
|
y=(l*(t**2-3*A[0])-(t*(-t**2+3*A[0])-A[1]))%p
|
46
46
|
return x.y
|
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
```
|
14
14
|
File "<ipython-input-28-356c4629e9d3>", line 22
|
15
|
-
x=(l-t**2+A[0])%p
|
15
|
+
x=(l**2-t**2+A[0])%p
|
16
16
|
^
|
17
17
|
SyntaxError: invalid syntax
|
18
18
|
```
|
@@ -41,7 +41,7 @@
|
|
41
41
|
def ec_third(A):
|
42
42
|
t=((3*A[0]**2+a)*inv(2*A[1],p))%p
|
43
43
|
l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2),p)%p
|
44
|
-
x=(l-t**2+A[0])%p
|
44
|
+
x=(l**2-t**2+A[0])%p
|
45
45
|
y=(l*(t**2-3*A[0])-(t*(-t**2+3*A[0])-A[1]))%p
|
46
46
|
return x.y
|
47
47
|
|
1
追加の問題が発生したため
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,50 +2,19 @@
|
|
2
2
|
|
3
3
|
楕円曲線における楕円加算について計算の高速化について研究しており、最初に
|
4
4
|
Pから一気に3Pを求めるプログラミングを作っています
|
5
|
+
お二人とも素早いご回答のおかげで先ほどのエラーはなくなりました、しかしあらたに別のエラーが表示されてしまい・・。もしよろしければこちらもご回答いただけたら幸いです。
|
5
|
-
し
|
6
|
+
よろしくお願いします
|
6
|
-
TypeError Traceback (most recent call last)
|
7
|
-
<ipython-input-17-8e5da736a2de> in <module>
|
8
|
-
26
|
9
|
-
27
|
10
|
-
---> 28 G3=ec_third(G)
|
11
|
-
29 print(G3)
|
12
|
-
30
|
13
7
|
|
14
|
-
<ipython-input-17-8e5da736a2de> in ec_third(A)
|
15
|
-
19 def ec_third(A):
|
16
|
-
20 t=((3*A[0]**2+a)*inv(2*A[1],p))%p
|
17
|
-
---> 21 l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2))%p
|
18
|
-
22 x=(l-t**2+A[0])%p
|
19
|
-
23 y=(l*(t**2-3*A[0])-(t*(-t**2+3*A[0])-A[1]))%p
|
20
8
|
|
21
|
-
TypeError: inv() missing 1 required positional argument: 'p'
|
22
9
|
|
23
|
-
と出てしまいます。どこが間違ているのでしょうか?よろしくお願いします
|
24
|
-
ここに質問の内容を詳しく書いてください。
|
25
|
-
|
26
|
-
|
27
|
-
|
28
10
|
### 発生している問題・エラーメッセージ
|
29
11
|
|
30
12
|
|
31
13
|
```
|
32
|
-
TypeError Traceback (most recent call last)
|
33
|
-
<ipython-input-17-8e5da736a2de> in <module>
|
34
|
-
26
|
35
|
-
27
|
36
|
-
---> 28 G3=ec_third(G)
|
37
|
-
29 print(G3)
|
38
|
-
30
|
39
|
-
|
40
|
-
<ipython-input-
|
14
|
+
File "<ipython-input-28-356c4629e9d3>", line 22
|
41
|
-
19 def ec_third(A):
|
42
|
-
20 t=((3*A[0]**2+a)*inv(2*A[1],p))%p
|
43
|
-
---> 21 l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2))%p
|
44
|
-
|
15
|
+
x=(l-t**2+A[0])%p
|
45
|
-
|
16
|
+
^
|
46
|
-
|
47
|
-
|
17
|
+
SyntaxError: invalid syntax
|
48
|
-
|
49
18
|
```
|
50
19
|
|
51
20
|
### 該当のソースコード
|
@@ -71,7 +40,7 @@
|
|
71
40
|
|
72
41
|
def ec_third(A):
|
73
42
|
t=((3*A[0]**2+a)*inv(2*A[1],p))%p
|
74
|
-
l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2))%p
|
43
|
+
l=((t*(t**2-3*A[0]))*inv(3*A[0]-t**2),p)%p
|
75
44
|
x=(l-t**2+A[0])%p
|
76
45
|
y=(l*(t**2-3*A[0])-(t*(-t**2+3*A[0])-A[1]))%p
|
77
46
|
return x.y
|