Skip to content

Instantly share code, notes, and snippets.

View yuntai's full-sized avatar
🏠
Working from home

yuntai yuntai

🏠
Working from home
View GitHub Profile
@yuntai
yuntai / schnorr.py
Last active April 4, 2018 05:15
schnorr, BN & mu signature with ProgrammingBlockchain codebase
import ecc
from ecc import PrivateKey
from random import randint
from helper import double_sha256, little_endian_to_int
# patch
ecc.FieldElement.__neg__ = lambda self: self.__class__(self.prime - self.num, self.prime)
ecc.Point.__sub__ = lambda self, other: self + (-other)
ecc.Point.__neg__ = lambda self: self.__class__(None, None, self.a, self.b) if self.x is None else self.__class__(self.x, -self.y, self.a, self.b)
@charliek
charliek / fastly_talk.md
Created November 25, 2015 23:13
Globally Distributed Purging System Links