From him at richardkiss.com Sat Oct 3 18:02:39 2015 From: him at richardkiss.com (Richard Kiss) Date: Sat, 3 Oct 2015 11:02:39 -0700 Subject: [Lightning-dev] Onion routing strawman proposal In-Reply-To: <20151003163855.GA22873@navy> References: <877fn5om6g.fsf@rustcorp.com.au> <20151003163855.GA22873@navy> Message-ID: > > > Ah, it looks like the problem is that libsec256k1 actually goes a step > further and runs SHA256(y||x), where "x" is the value I'm getting and y > is '\x02' is the y value is even and '\x03' if it's odd. If I try both, > one of them turns out right: > > Secret1: d9946724c6bd8d5b58bdd2256a0251816a42f9707c794427a410075e4dbb199c > Secret2: 105e0c04f0a910d72dcf2683c21903ba08cd8b225e4124afc41bb2341dc40f49 > > Unfortunately openssl throws away y and just gives us x, so I'm not sure > if I can work out the right secret directly. I guess I can run the HMAC > twice and pick the value that worked? > > Okay, we'll see if we can get any further tomorrow. > > Cheers, > aj > My open source library pycoin has a function that will give you Y from X, so you can use that or just pilfer enough code to reproduce it (it's not native, but it's not a very complex operation). https://github.com/richardkiss/pycoin/blob/master/pycoin/ecdsa/ecdsa.py#L115 Richard -- http://richardkiss.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: