Want more features on Pastebin? Sign Up, it's FREE!
Guest

MOV

By: a guest on Jan 24th, 2013  |  syntax: Python  |  size: 0.39 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. F.<x> = GF(8111)[]
  2. K.<x> = GF(8111^3, name='x', modulus=x^3 + 4*x - 11)
  3. E  = EllipticCurve(GF(8111), [1,300])
  4. E_ = EllipticCurve(K, [1,300])
  5.  
  6. n = E.order()
  7. P = E.random_element()
  8. Q = ZZ.random_element(n) * P
  9.  
  10. P_ = E_(P)
  11. Q_ = E_(Q)
  12.  
  13. R = E_.random_element() * (E_.order() // E.order()^2)
  14.  
  15.  
  16. W1 = P_.weil_pairing(R, n)
  17. W2 = Q_.weil_pairing(R, n)
  18. u = log(W2, W1)
  19.  
  20. assert(P*u == Q)
clone this paste RAW Paste Data