Saying Goodbye to Napier’s Logs, and Hello To Elliptic Curves

Coding

`from secp256k1 import curve,scalar_mult,point_addimport randomprint("Basepoint:\t", curve.g)a  = random.randrange(1, curve.n)aG = scalar_mult(a, curve.g)b = random.randrange(1, curve.n)bG = scalar_mult(b, curve.g)x  = random.randrange(1, curve.n)xG = scalar_mult(x, curve.g)y  = random.randrange(1, curve.n)yG = scalar_mult(y, curve.g)k_a = point_add(scalar_mult(a,bG),scalar_mult(x,yG))k_b = point_add(scalar_mult(b,aG),scalar_mult(y,xG))print("\nAlice\'s secret key (a):\t", a)print("Alice\'s public key:\t", aG)print("\nBob\'s secret key (b):\t", b)print("Bob\'s public key:\t", bG)print("==========================")print("\nAlice\'s session secret key (x):\t", x)print("Alice\'s  session public key (xG):\t", xG)print("\nBob\'s  session secret key (y):\t", y)print("Bob\'s  session public key (yG):\t", yG)print("\n==========================")print("Shared Alice: abG+xyG: \t", (k_a[0]))print("Shared Bob: baG+yxG: \t", (k_b[0]))print("\n\n======Checking=========")res=(a*b+x*y) % curve.nres=scalar_mult(res, curve.g)print("\n(ab+xy)G \t", (res[0]))`
`Basepoint:   (55066263022277343669578718895168534326250603453777594175500187360389116729240, 32670510020758816978083085130507043184471273380659243275938904335757337482424)Alice's secret key (a):  78415154667220249194754078918779762453056721468760306709254177946012547971141Alice's public key:  (99105229714153207673156985070193448370065961398966381789878734693715465172209, 110624902362275410698479512352481561725899665806375931075445037591290365955025)Bob's secret key (b):    54561616670816631735058850292883594875584010720685581360400314879317249503108Bob's public key:    (113733186086318903761015041328623689948056538055691950119005093813948221458090, 107903521773313888319620134964700827003653413067839301511388495653810557170752)==========================Alice's session secret key (a):  76616834241497302450896773294650589907854814474518231453401510983257719855837Alice's  session public key:     (24023634351058590672106977617527332391972478575360369234145700134892339616865, 100885767930009484943614670462898176000583227593861181472494539077386853703775)Bob's  session secret key (b):   71626425417421697561804712872377867220787646273545079991058910835106706879356Bob's  session public key:   (5390516305312861583780866553511006508889363046035935478179214543880844748571, 108167309578588334529715598304887530494245835449345803403114120670801894220810)==========================Shared Alice: abG+xyG:   81373250065694576718644623930446201904803357573717034878729887795363849635428Shared Bob: baG+yxG:     81373250065694576718644623930446201904803357573717034878729887795363849635428======Checking=========(ab+xy)G     81373250065694576718644623930446201904803357573717034878729887795363849635428`

Written by