Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = 2**256 - 2**32 - 2**9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
- a = 0x0000000000000000000000000000000000000000000000000000000000000000
- b = 0x0000000000000000000000000000000000000000000000000000000000000007
- F = GF(p)
- eccurve = EllipticCurve(F,[a, b])
- curve = eccurve
- ord = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
- Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
- Gy = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
- G = curve(Gx,Gy,1)
- #This is a setion with data about Q !!! Wea are not calculating Q and we need find a x and calculate Qz=x*G=Q. We are know Q,G but dont know x !!!
- Q = curve(0x8b05b0603abd75b0c57489e451f811e1afe54a8715045cdf4888333f3ebc6e8b,0x1d10f88145db40fb889e2ddce81bda7c27f5b615acd6179dbb30f4fe7f40fb39)
- print(Q)
- R = Zmod(ord)
- #end of section
- ##In this section calculated G2,y and Q = G2*y
- x0 = R(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
- y = 1/x0
- G2 = ZZ( y ) *Q
- Q2 = ZZ(x0) * G2
- ##End of section
- #This section after x was find. Find a x and paste to this code:
- #x = ....
- #Qresult=ZZ (x) * G
- #print("Q==Qresult'", Q == Qresult)
- #end of section
- print("Q==Q2'", Q2 == Q)
- print("Q",Q)
- print("Q2",Q2)
- print("y",y)
- print("G",G)
- print("G2",G2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement