Ask Your Question

vescapam's profile - activity

2020-12-14 19:51:13 +0200 received badge  Student (source)
2019-08-28 14:53:07 +0200 received badge  Famous Question (source)
2017-11-08 11:23:51 +0200 received badge  Famous Question (source)
2017-01-15 22:43:03 +0200 received badge  Notable Question (source)
2017-01-10 15:10:34 +0200 received badge  Popular Question (source)
2017-01-10 15:10:34 +0200 received badge  Notable Question (source)
2016-09-27 14:06:14 +0200 received badge  Popular Question (source)
2012-06-17 19:29:35 +0200 commented answer How to construc a generator point of an elliptic curve?

Thank you!!!!, i know another method but i think that hhis is better.

2012-06-17 19:28:51 +0200 marked best answer How to construc a generator point of an elliptic curve?
sage: E1=EllipticCurve(GF(8209),[1,0,0,333,6166])
sage: P=E1.gen(0);P
(3714 : 7019 : 1)
sage: P.order()
8210
2012-06-17 01:43:54 +0200 asked a question How to construc a generator point of an elliptic curve?

I have taht elliptic curve defined in sage:

E1=EllipticCurve(GF(8209),[1,0,0,333,6166])

How can i construct a generator point of an elliptic curve?

Thank you very much.

2012-06-17 00:43:04 +0200 asked a question How can I find an irreductible polinomial?

Hi friends,

I just working with elliptic curves with this data:

p=8209
E1=EllipticCurve(GF(p),[1,0,0,333,6166])
F=GF(p)
FX.<x>=F[]

But when I try that, SAGE says me that I need a irrecductible polinomal. Can i can culculate with SAGE?, Any command?

F2.<alpha>=GF(p^2, name='alpha', modulus= ???)
2012-06-16 19:36:08 +0200 answered a question Problems with points and list in SAGE

Using append function.

Thanks for the viewrs.

2012-06-16 18:56:04 +0200 asked a question Problems with points and list in SAGE

Hello friends,

I have four points over an elliptic curve and i have to construct a sequence extracting coordenates,

How can do that?

Points:

(6348039923579989430201202900193104 : 8938521987039088802825634947748141 : 1) (8643096444775125481487734216988008 : 6864928103481412954792333412052240 : 1) (973908846866146057275353494784191 : 9861631015033931062261694737198367 : 1) (8383448090631515106692264575702532 : 9578344834536210940942664141057339 : 1)

Secuence:

seq1=[6348039923579989430201202900193104,8938521987039088802825634947748141, 8643096444775125481487734216988008, 6864928103481412954792333412052240, 973908846866146057275353494784191, 9861631015033931062261694737198367, 8383448090631515106692264575702532, 9578344834536210940942664141057339]

Thank you very much.

2012-06-16 18:33:58 +0200 marked best answer Problem with the lift_x fuction in SAGE

Reading through a Python tutorial would be helpful, I think. You could catch the ValueError using a try/except pair:

p=(10^34+1000).next_prime() 
E=EllipticCurve(GF(p),[0,57])

for i in range(10):
    print i,
    try:
        print E.lift_x(i)
    except ValueError:  
        print 'is not on the curve'

gives

0 is not on the curve
1 is not on the curve
2 is not on the curve
3 is not on the curve
4 (4 : 11 : 1)
5 is not on the curve
6 is not on the curve
7 (7 : 20 : 1)
8 (8 : 4398486930972910766515963067497788 : 1)
9 (9 : 1034823061610515416790842872226417 : 1)

If you simply want a random point on the curve and you don't care about it being the 'next' one, you can use .random_element():

sage: E.random_element()
(9537865290021818371758914785117256 : 7089648854090040163853290659008613 : 1)
sage: E.random_element()
(8894960861306214748776439558874048 : 5076442993216186749708177737959875 : 1)
sage: E.random_element()
(713560432970815994889067437364213 : 4835570217047194554079202261200998 : 1)
2012-06-16 18:33:51 +0200 commented answer Problem with the lift_x fuction in SAGE

Thank you very much. Well explained. You are a genius. :)

2012-06-16 17:59:54 +0200 asked a question Problem with the lift_x fuction in SAGE

Hello,

When I work with an elliptic curve and i apply E.lift_x(1407284663933896236729058440000) i obtain the point (1407284663933896236729058440000 : 4215171991512676773155222850458328 : 1) and works fine.

My problem is when i have a value of x that don't in the curve and aplly E.lift_x(x) and it's generate a Raise of Error and stop my program. Well, i have to increment the value of x end try to another point E.lift_x(x+1) and works fine but the problem is that i can't reach that because Raise of Error stop my loop.

How can i debug that? Another fuction like lift_x?

Thank very much. I wait yor answers.

2012-06-16 10:39:57 +0200 received badge  Scholar (source)
2012-06-16 10:39:57 +0200 marked best answer Problems with SAGE operations

The following example (with your curve but changed Pa,u1,u2,r ) shows that "SAGE operations" are OK

p=(10^34+1000).next_prime()
E=EllipticCurve(GF(p),[0,57]);
x,y=(4259903772238643554901244696272038,3809941931717614434052814194698091)
E.is_on_curve(x,y)
#True
P=E(x,y)
n=P.order()
d=ZZ.random_element(n)   # Priv key
Pa=d*P                   # Pub key

kE=ZZ.random_element(n)  # Eph key
R=kE*P
r=Integer(R.xy()[0])     # first part of the signature
hx=ZZ.random_element(n)  # hash of the message
s=Mod((hx+d*r)*inverse_mod(kE,n),n)  # second part
w=s^-1
u1=Integer(Mod(w*hx,n))
u2=Integer(Mod(w*r,n))
Q=u1*P+u2*Pa
Integer(Q.xy()[0])==r    # Verification
#True
2012-06-16 10:39:54 +0200 received badge  Supporter (source)
2012-06-16 10:39:46 +0200 commented answer Problems with SAGE operations

Thank you very much. You are a great SAGE programmer!!!

2012-06-15 19:55:16 +0200 asked a question Problems with SAGE operations

I have defined in SAGE one Elliptic curve, two points: P and P_a and theree integers u1,u2 and n.

p=(10^34+1000).next_prime()

E=EllipticCurve(GF(p),[0,57]);

P= E(9128294291047160967288425267449898,3015386503039089432053383415473448)

P_a= E(4259903772238643554901244696272038,3809941931717614434052814194698091)

u1=32670546509638242125495495

u2=10120953885076574089031876

n=74226928212769886074449493

Q = Integer(u1)P+Integer(u2)P_a

v = mod(Q[0],n)

print v

Now i try to calculate the coordinates of a new point Q, and modular n of the first, called v.

Q = Integer(u1)P+Integer(u2)P_a

v = mod(Q[0],n]

The result that i obtained is 49823540439822066091848818, but desired is 2715371088067745779674921

Where is the mistake? I'm going crazy because i don't understand it.

Can you help me? Thank you very much.!!!!!!!

2012-06-15 17:44:29 +0200 asked a question How can I define this elliptic curve in SAGE?

Hello,

I have this eeliptic curve y^2+xy = x^3+33x+6166 over Fp, p=8209. How can i define that curve using SAGE?

F=GF(8209);

E=EllipticCurve(F,[????????]);

Thank you very much!!!!

2012-06-15 11:15:24 +0200 answered a question Calculate the y coordinate of a point of a elliptic curve with SAGE?

sage: E.lift_x(1407284663933896236729058440000)

(1407284663933896236729058440000 : 4215171991512676773155222850458328 : 1)

2012-06-15 11:13:19 +0200 received badge  Editor (source)
2012-06-15 10:25:19 +0200 asked a question Calculate the y coordinate of a point of a elliptic curve with SAGE?

I defined with SAGE:

p=(10^34+1000).next_prime() 
E=EllipticCurve(GF(p),[0,57])

My problem is:

I know the x coordinate of a P of the Elliptic Curve 1407284663933896236729058440000

How can I calculate the y coordinate with SAGE?. Any fuction?

E([1407284663933896236729058440000, ??????])
2012-06-15 10:22:38 +0200 asked a question ECDSA verification signature with SAGE

In the ECDSA algorithm (verification signature) you have to calculate a new point using the next formula: (x0,y0) = u1*P+u2*P_a

How can I calculate the coordenates of this new point?, i try that sentence in SAGE but it doesn't work.

X = (Integer(u1)*P)+(Integer(u2)*P_a)

Can you help me?. Thank you very much.

You can download code and try to execute in SAGE here: https://dl.dropbox.com/u/39374382/que...