Skip to content

Instantly share code, notes, and snippets.

@Parr0sky
Parr0sky / ecc.py
Last active October 16, 2022 07:08 — forked from bellbind/ecc.py
[python]basics of elliptic curve cryptography
# Basics of Elliptic Curve Cryptography implementation on Python
import collections
import decimal
decimal.getcontext().prec = 5
def inv(n, q):
"""div on PN modulo a/b mod q as a * inv(b, q) mod q
>>> assert n * inv(n, q) % q == 1
"""
for i in range(q):