--- Day changed Tue Jul 26 2016 00:11 -!- aalex [~aalex@64.187.177.58] has quit [Ping timeout: 250 seconds] 00:15 -!- aalex [~aalex@64.187.177.58] has joined #secp256k1 00:40 -!- aalex [~aalex@64.187.177.58] has quit [Ping timeout: 252 seconds] 00:45 -!- aalex [~aalex@64.187.177.58] has joined #secp256k1 01:43 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has joined #secp256k1 03:27 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has quit [Ping timeout: 252 seconds] 03:34 -!- afk11 [~afk11@109.255.154.81] has joined #secp256k1 03:34 -!- afk11 [~afk11@109.255.154.81] has quit [Changing host] 03:34 -!- afk11 [~afk11@unaffiliated/afk11] has joined #secp256k1 04:57 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has joined #secp256k1 05:08 -!- afk11 [~afk11@unaffiliated/afk11] has quit [Ping timeout: 276 seconds] 09:06 -!- mdavid613 [~Adium@cpe-172-251-161-231.socal.res.rr.com] has joined #secp256k1 09:06 -!- mdavid613 [~Adium@cpe-172-251-161-231.socal.res.rr.com] has quit [Max SendQ exceeded] 09:07 -!- mdavid613 [~Adium@cpe-172-251-161-231.socal.res.rr.com] has joined #secp256k1 10:48 -!- arubi [~ese168@unaffiliated/arubi] has quit [Ping timeout: 258 seconds] 10:50 -!- arubi [~ese168@unaffiliated/arubi] has joined #secp256k1 12:16 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has quit [Ping timeout: 258 seconds] 12:58 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has joined #secp256k1 16:06 -!- aalex_ [~aalex@64.187.177.58] has joined #secp256k1 16:08 -!- aalex [~aalex@64.187.177.58] has quit [Ping timeout: 244 seconds] 18:11 -!- maaku [~quassel@173-228-107-141.dsl.static.fusionbroadband.com] has quit [Quit: No Ping reply in 180 seconds.] 18:12 -!- maaku [~quassel@173-228-107-141.dsl.static.fusionbroadband.com] has joined #secp256k1 18:29 -!- molly [~molly@unaffiliated/molly] has quit [Ping timeout: 244 seconds] 18:30 -!- moli [~molly@unaffiliated/molly] has joined #secp256k1 18:33 -!- molz [~molly@unaffiliated/molly] has joined #secp256k1 18:36 -!- moli [~molly@unaffiliated/molly] has quit [Ping timeout: 240 seconds] 19:05 -!- mdavid613 [~Adium@cpe-172-251-161-231.socal.res.rr.com] has quit [Quit: Leaving.] 20:23 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has quit [Ping timeout: 252 seconds] 23:52 -!- jl2012 [uid133844@gateway/web/irccloud.com/x-bcwfshnpybdflran] has quit [Ping timeout: 250 seconds] 23:52 -!- jl2012 [uid133844@gateway/web/irccloud.com/x-vrmatxqqogmrpfzo] has joined #secp256k1 --- Log closed Wed Jul 27 00:38:29 2016 --- Log opened Wed Jul 27 00:39:06 2016 00:39 -!- kanzure [~kanzure@unaffiliated/kanzure] has joined #secp256k1 00:39 -!- Irssi: #secp256k1: Total of 33 nicks [0 ops, 0 halfops, 0 voices, 33 normal] 00:40 -!- aalex_ [~aalex@64.187.177.58] has joined #secp256k1 00:49 -!- Irssi: Join to #secp256k1 was synced in 679 secs --- Log closed Wed Jul 27 01:11:00 2016 --- Log opened Wed Jul 27 01:11:40 2016 01:11 -!- kanzure [~kanzure@unaffiliated/kanzure] has joined #secp256k1 01:11 -!- Irssi: #secp256k1: Total of 34 nicks [0 ops, 0 halfops, 0 voices, 34 normal] 01:22 -!- Irssi: Join to #secp256k1 was synced in 678 secs 01:31 -!- aalex_ [~aalex@64.187.177.58] has quit [Ping timeout: 276 seconds] 01:35 -!- aalex_ [~aalex@64.187.177.58] has joined #secp256k1 01:40 -!- aalex_ [~aalex@64.187.177.58] has quit [Max SendQ exceeded] 01:41 -!- aalex_ [~aalex@64.187.177.58] has joined #secp256k1 02:01 -!- aalex_ [~aalex@64.187.177.58] has quit [Ping timeout: 265 seconds] 02:04 -!- aalex_ [~aalex@64.187.177.58] has joined #secp256k1 06:43 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has joined #secp256k1 07:53 -!- maaku [~quassel@173-228-107-141.dsl.static.fusionbroadband.com] has quit [Ping timeout: 244 seconds] 07:53 -!- maaku [~quassel@173-228-107-141.dsl.static.fusionbroadband.com] has joined #secp256k1 09:14 -!- mdavid613 [~Adium@cpe-104-172-191-85.socal.res.rr.com] has joined #secp256k1 09:45 -!- mdavid613 [~Adium@cpe-104-172-191-85.socal.res.rr.com] has quit [Quit: Leaving.] 09:49 -!- mdavid613 [~Adium@cpe-104-172-191-85.socal.res.rr.com] has joined #secp256k1 10:33 -!- aalex__ [~aalex@64.187.177.58] has joined #secp256k1 10:34 -!- aalex_ [~aalex@64.187.177.58] has quit [Ping timeout: 252 seconds] 10:44 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has quit [Ping timeout: 276 seconds] 11:07 -!- jtimon [~quassel@55.31.134.37.dynamic.jazztel.es] has joined #secp256k1 13:52 < mdavid613> hey all, question for you. I'm trying DER serialize a signature created with secp256k1_ecdsa_sign() using secp256k1_ecdsa_signature_serialize_der(). It looks like I'm getting an immediate return on the first while loop in secp256k1_ecdsa_sig_serialize() for some unknown reason (which it looks like it shouldn't be doing). Has anyone else experienced this? 13:53 < mdavid613> the two lines in my code are: 13:53 < mdavid613> secp256k1_ecdsa_sign(secpCtx, &keySig, MSG, partnerKey, NULL, NULL); 13:53 < mdavid613> secp256k1_ecdsa_signature_serialize_der(secpCtx, partnerKeySigDER, &partnerKeySigDERLen, &keySig); 13:55 < mdavid613> in this case, "lenR > 1 && rp[0] == 0 && rp[1] < 0x80" evaluated to false, so we should just go to the next one-liner while loop, but it's just popping out 14:03 < gmaxwell> mdavid613: see secp256k1.h outputlen is an in/out variable and needs to have the size of the buffer (large enough to hold the worst case output) in it initially. Thats my guess at your issue. 14:04 < gmaxwell> (e.g. it should be 74 going in) 14:07 < mdavid613> thanks greg! :) 14:14 < mdavid613> strangely it seems like it should be 71. I would think the serialization function would update outputlen to be the size of the DER-encoded data 14:15 < gmaxwell> it updates it, but it needs to know the size of the buffer going in. 14:15 < gmaxwell> I believe the worst case seralization is 74 bytes. 14:16 < gmaxwell> (think of it this way, if you incorrectly believe the worst case was 70 bytes, made your buffer that large, and it used whatever it needed, it sometimes would write beyond the end of your buffer). 14:17 < mdavid613> completely understood. in this case my buffer is 255 and I'm passing in the outputlen as 255. outputlen after the call is currently 0 though. I'll check the code and see what's up 14:17 < gmaxwell> hm. okay well then I was wrong about the theory. if you're passing in 255 then it should be good to go in terms of that. 14:18 < mdavid613> yeah, at this point the issue is that I need to know the outputlen so I can encode the data. but I'll take a look and see what's causing this 14:18 < gmaxwell> Are you checking the return of secp256k1_ecdsa_sign? (e.g. maybe your problem is further up and your private key was invalid. 14:19 < gmaxwell> mdavid613: the reason the legnth being returned is zero is because the seralization is failing for some reason. 14:19 < sipa> mdavid613: did the sign fubction succeed? 14:19 < mdavid613> the private is key is valid, this is for an example so I have a hardcoded privatekey 14:19 < mdavid613> the sign function succeeds correctly 14:19 < mdavid613> and when I specifically set the outputlen to 71, my server sign validates the signature correctly 14:20 < gmaxwell> my initial theory was that you weren't giving it a big enough buffer (since thats a common failure mode), but if that isn't the case my next guess would be because the sign failed. 14:20 < mdavid613> so I think it's purely the function is returning the outputlen incorrectly 14:20 < gmaxwell> (A common mistake people make is to call that function in a loop and not reset the output size between uses) 14:22 < mdavid613> I can see that happening. because this is a simple example program for a library, everything is defined very specifically and only used once 14:23 < gmaxwell> mdavid613: could you share more of the code? 14:23 -!- droark [~droark@c-24-22-36-12.hsd1.or.comcast.net] has quit [Ping timeout: 260 seconds] 14:24 < mdavid613> http://pastebin.com/yk5nwBbu 14:25 < mdavid613> so this works with partnerKeySigDERLen set to 255, but my encoding the DER data later only works with 71 specified 14:29 < gmaxwell> can you add a printf to print partnerKeySigDERLen immediately after line 29 in that paste? 14:43 < mdavid613> strange, it's now 71 14:44 < mdavid613> apparently, my IDE'd debugger is just a POS 14:45 < mdavid613> thanks for the help greg, I really appreciate it. 14:45 < mdavid613> looks like all is well now 18:43 -!- mdavid613 [~Adium@cpe-104-172-191-85.socal.res.rr.com] has quit [Quit: Leaving.] 21:05 -!- aalex__ [~aalex@64.187.177.58] has quit [Ping timeout: 260 seconds] 21:21 -!- aalex__ [~aalex@64.187.177.58] has joined #secp256k1