barrywhitehat / baby_jubjub_ecc Goto Github PK
View Code? Open in Web Editor NEWaltbn128 twisted ewards curve point addion, point multiplicaion, eddsa signature verificaion and pedersen commiments
License: GNU General Public License v3.0
altbn128 twisted ewards curve point addion, point multiplicaion, eddsa signature verificaion and pedersen commiments
License: GNU General Public License v3.0
In the ed25519 test example, the private string sk is used to generate the public key (see https://github.com/barryWhiteHat/baby_jubjub_ecc/blob/master/tests/ed25519.py#L172 )and also the signature but its value was not defined.
See find_group_hash
@ https://github.com/daira/zcash-test-vectors/blob/master/sapling_generators.py#L31
def group_hash(D, M):
digest = blake2s(person=D)
digest.update(CRS)
digest.update(M)
p = Point.from_bytes(digest.digest())
if not p:
return None
q = p * JUBJUB_COFACTOR
if q == Point.ZERO:
return None
return q
def find_group_hash(D, M):
i = 0
while True:
p = group_hash(D, M + bytes([i]))
if p:
return p
i += 1
assert i < 256
We use the base point
("base point " , Fq(17777552123799933955779906779655732241715742912184938656739573121738514868268), Fq(2626589144620713026669568689430873010625803728049924121243784502389097019475) )
when we should use the generator point.
('geneator :', 16540640123574156134436876038791482806971768689494387082833631921987005038935, 20819045374670962167435360035096875258406992893633759881276124905556507972311)
This should be a quick fix.
We can generate a pubic that is greater than the feild modulous as follows
sk = 123123123
[pub_key_x, pub_key_y] = ed.publickey(sk)
print(pub_key_x, pub_key_y)
So we can fix this by doing
def __int__(self):
return(self.s%r_q)
Tho we should dig a little deeper on this and see if there is a deeper problem.
https://github.com/hyraxZK/inner_curves/blob/master/bin/find_curveparams.sage
This tool will find Montgomery and Edwards curves over a given field, however it has hard-coded restrictions on the prime modulo (for fast square root)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.