--- Log opened Sat Sep 02 00:00:11 2023 00:07 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has joined #secp256k1 00:35 -!- elichai2 [sid212594@id-212594.hampstead.irccloud.com] has quit [Server closed connection] 00:35 -!- elichai2 [sid212594@id-212594.hampstead.irccloud.com] has joined #secp256k1 03:41 -!- bob_x1 [~bob_x@user/bob-x1/x-8934932] has joined #secp256k1 05:37 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has quit [Quit: My iMac has gone to sleep. ZZZzzz…] 06:07 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has joined #secp256k1 07:07 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has quit [Quit: My iMac has gone to sleep. ZZZzzz…] 07:08 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has joined #secp256k1 09:43 -!- real_or_random [sid554204@user/real-or-random/x-4440763] has quit [Server closed connection] 09:43 -!- real_or_random [sid554204@user/real-or-random/x-4440763] has joined #secp256k1 13:01 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has quit [Quit: My iMac has gone to sleep. ZZZzzz…] 13:46 -!- Guest87 [~Guest87@105.99.52.115] has joined #secp256k1 13:46 < Guest87> hey i'm new to C, i come from Rust please where to found docs about this library ? 13:47 < Guest87> i don't found a library about api to call from this api 13:47 < sipa> the API is documented in the header files: https://github.com/bitcoin-core/secp256k1/blob/master/include/secp256k1.h (and others) 13:48 < Guest87> thanks for your feedback sipa, there isn't a website for documentations ? like javascript python and rust ? 13:49 < sipa> no 13:50 < sipa> C doesn't have a universally adopted package ecosystem 13:50 < Guest87> okay looks good to me, thank you so much have a good day 13:51 -!- Guest87 [~Guest87@105.99.52.115] has quit [Client Quit] 14:11 -!- Guest87 [~Guest87@105.99.52.115] has joined #secp256k1 14:12 < Guest87> hey it's me again, i would like to ask for code review if possible, i'm new to C and it's not really comfortable to me to read the docs in this format, so is this.  a. safe way to gen a private & pbkey ? 14:12 < Guest87> #include 14:12 < Guest87> #include 14:12 < Guest87> #include 14:12 < Guest87> #include 14:12 < Guest87> int main() { 14:12 < Guest87>     secp256k1_context *context = secp256k1_context_create( 14:12 < Guest87>         SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); 14:12 < Guest87>     if (context == NULL) { 14:12 < Guest87>         fprintf(stderr, "Could not create secp256k1 context.\n"); 14:12 < Guest87>         return 1; 14:12 < Guest87>     } 14:12 < Guest87>     // Generate a cryptographically secure random private key. Replace this with your own RNG if needed. 14:12 < Guest87>     unsigned char private_key[32]; 14:12 < Guest87>     FILE *frand = fopen("/dev/urandom", "r"); 14:12 < Guest87>     if (frand == NULL) { 14:12 < Guest87>         fprintf(stderr, "Could not open /dev/urandom.\n"); 14:12 < Guest87>         secp256k1_context_destroy(context); 14:12 < Guest87>         return 1; 14:12 < Guest87>         return 1; 14:12 < Guest87>     } 14:12 < Guest87>     // Print compressed public key 14:12 < Guest87>     printf("Compressed Public Key: "); 14:12 < Guest87>     for (size_t i = 0; i < compressed_pubkey_size; ++i) { 14:12 < Guest87>         printf("%02x", compressed_pubkey[i]); 14:12 < Guest87>     } 14:12 < Guest87>     printf("\n"); 14:12 < Guest87>     secp256k1_context_destroy(context); 14:12 < Guest87>     return 0; 14:12 < Guest87> } 14:16 < Guest87> i think the first thing i made totally wrong is generating pseudo random with dev/urandom 14:16 < Guest87> but i don't really know what are options to work with them in C 14:16 < Guest87> i'm discovering 14:17 < Guest87> also i really would like to have advice what do you guys use to read library because it's really not comfortable to use grep or to read from the repo 14:17 < sipa> please don't copy paste into IRC 14:18 < Guest87> oh i didn"t know i wasn't allowed, i'm sorry 14:19 < sipa> no worries; just use a paste site in the future 14:19 < sipa> this code isn't computing any public key 14:19 < sipa> compressed_pubkey isn't even declared 14:20 < Guest87> here is my output 14:20 < Guest87> Private Key: d782bf5255de3a2a632ebd1c2dc366ec3f88b6a4d7d071b3d4a1961abf35cee4 14:20 < Guest87> Compressed Public Key: 02e7fd6905ea463a76d435d5abdf50baed8c2988432dd9e8cc3f0cc5eb8fbca433 14:20 < Guest87> isn't this a public key? 14:20 < sipa> yes, but that's not what the code you pasted does 14:20 < sipa> maybe a few lines are lissing? 14:20 < Guest87> well it was generated by my code 14:21 < sipa> you may want to look at our examples? k to Edit 14:21 < sipa> https://github.com/bitcoin-core/secp256k1/blob/master/examples/ecdsa.c 14:23 < sipa> you don't need the CONTEXT_SIGN and CONTEXT_VERIFY anymore 14:23 -!- Guest33 [~Guest87@105.100.19.241] has joined #secp256k1 14:24 < Guest33> i lost my internet, can you repeat what you told me please 14:24 < sipa> you may want to look at our examples? 14:24 < sipa> https://github.com/bitcoin-core/secp256k1/blob/master/examples/ecdsa.c 14:24 < sipa> you don't need the CONTEXT_SIGN and CONTEXT_VERIFY anymore 14:25 -!- Guest87 [~Guest87@105.99.52.115] has quit [Ping timeout: 246 seconds] 14:25 < Guest33> i don't really like to read example etc i means i know what i'm doing actually it's just different syntax and different way to read library with C .. 14:26 < sipa> ok, then i don't know what you're asking 14:26 < Guest33> CONTEXT_SIGN: This flag indicates that the context should be prepared for signing operations 14:27 < Guest33> and the second is for verifying signatures 14:27 < sipa> they're deprecated 14:27 < sipa> you don't need them anymore 14:27 < sipa> /** Deprecated context flags. These flags are treated equivalent to SECP256K1_CONTEXT_NONE. */0 14:28 < sipa> maybe you're using an old version? 14:28 < Guest33> hmm yeah i think so, i really need a better way to read documentation 14:28 < Guest33> because as i told you, it's really not comfortable like this 14:30 < sipa> if you're quoting this "CONTEXT_SIGN: This flag indicates that the context should be prepared for signing operations" from secp256k1.h, you're using an old version 14:30 < sipa> as that line does not appear in the latest release, v0.3.2 14:32 -!- Guest33 [~Guest87@105.100.19.241] has quit [Quit: Client closed] 14:48 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has joined #secp256k1 15:10 -!- tromp [~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl] has quit [Read error: Connection reset by peer] 15:49 -!- bob_x1 [~bob_x@user/bob-x1/x-8934932] has quit [Remote host closed the connection] 15:49 -!- bob_x1 [~bob_x@user/bob-x1/x-8934932] has joined #secp256k1 16:11 -!- jonatack1 [~jonatack@user/jonatack] has joined #secp256k1 16:13 -!- jon_atack [~jonatack@user/jonatack] has quit [Ping timeout: 245 seconds] 16:21 -!- jonatack2 [~jonatack@user/jonatack] has joined #secp256k1 16:24 -!- jonatack1 [~jonatack@user/jonatack] has quit [Ping timeout: 246 seconds] 17:00 -!- Netsplit *.net <-> *.split quits: kanzure, johnzweng 17:00 -!- Netsplit over, joins: johnzweng 17:05 -!- kanzure [~kanzure@user/kanzure] has joined #secp256k1 17:22 -!- nickler_ [~nickler@static.219.205.69.159.clients.your-server.de] has quit [Server closed connection] 17:22 -!- nickler [~nickler@static.219.205.69.159.clients.your-server.de] has joined #secp256k1 21:36 -!- jonatack2 [~jonatack@user/jonatack] has quit [Read error: Connection reset by peer] 21:37 -!- jonatack2 [~jonatack@user/jonatack] has joined #secp256k1 --- Log closed Sun Sep 03 00:00:11 2023