amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 10:44:08 AM Last edit: January 16, 2015, 10:56:01 AM by amaclin |
|
Is there a simple way to use https://github.com/bitcoin/secp256k1 with rfc6979 support in Windows/Qt environment? I do not have enough experience with boost, gmp and many other mubmo-jumbo packages I feel myself lost reading the words "sudo", "apt-get", "autotools", "make" etc. I had big troubles with installing/compiling OpenSSL (but I've solved them) I want to have just a way to include header file with two methods something like void sign ( const char* privkey, const char* digest, char* r, char* s ); // every pointer to 32-byte memory buffer bool verify ( const char* digest, const char* pub, const int pubLen, const char* sig, const int sigLen ); Let us say that I have fresh 1) Windows installation 2) Qt/mingw installation
|
|
|
|
gmaxwell
Moderator
Legendary
Offline
Activity: 4284
Merit: 8816
|
|
January 16, 2015, 02:56:42 PM Last edit: January 16, 2015, 03:12:52 PM by gmaxwell |
|
You should probably not be using the library right now, especially not if you're having problems using what is a very basic C library. It is preproduction experimental software, as it says so quite explicitly on the website.
I probably will never stop being horrified at people's capacity for rushing head long into using software that even its authors tell them not to use. It makes it much harder to work in the open, because you now have to worry about what harm inadequately tested software is causing people (and their users) who ignore warnings.
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 03:00:17 PM |
|
As an aside has the OpenSSL project planned to change to the RFC sig implementation?
(if not then I might work on getting a MSVC Windows build of this library as I have developed a Wallet package that I would prefer uses deterministic sigs)
|
|
|
|
amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 03:11:37 PM |
|
You should probably not be using the library right now, especially not if you're having problems using what is a very basic C library. It is preproduction experimental software.
I want use it after understanding how it works. But I can not even compile a very basic example, something like #include "secp256k1.h" void main ( ) { QByteArray privkey ( "Hello, world! " ); privkey.resize ( 32 ); QByteArray digest ( "This is a digest " ); digest.resize ( 32 ); qDebug ( ) << QString ( sign ( privkey, digest ).toHex ( ) ); }
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 03:17:14 PM |
|
You do release that your snippet doesn't have any #include's for Qt?
And that "void main" is non-standard C++ (are their still books teaching people to code "void main" these days?).
|
|
|
|
amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 03:25:26 PM |
|
You do release that your snippet doesn't have any #include's for Qt? And that "void main" is non-standard C++ (are their still books teaching people to code "void main" these days?).
This code was written in browser, not in C++ editor. This is only an example how do I see the usage of library. Do you think that this snippet would be better with #include <QString> #include <QByteArray>
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 03:27:02 PM |
|
This code was written in browser, not in C++ editor. This is only an example how do I see the usage of library.
Okay - but it's hard to help out if you don't post the actual code you are trying compile. Do you think that this snippet would be better with #include <QString> #include <QByteArray>
It would make it somewhat easier to know for sure what your problem is considering in the OP indicated you were not that well versed in C++. You should post the compile errors for a start.
|
|
|
|
amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 03:41:26 PM |
|
You should post the compile errors for a start.
num_gmp.h:10: Error: gmp.h: No such file or directory #include <gmp.h> ^
|
|
|
|
fsb4000
Legendary
Offline
Activity: 1400
Merit: 1000
|
|
January 16, 2015, 03:55:43 PM |
|
You should post the compile errors for a start.
num_gmp.h:10: Error: gmp.h: No such file or directory #include <gmp.h> ^ http://habrahabr.ru/sandbox/53707/
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 04:37:56 PM |
|
num_gmp.h:10: Error: gmp.h: No such file or directory #include <gmp.h> ^ So you are missing GMP - is there a windows version of that library?
|
|
|
|
amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 04:47:21 PM |
|
So you are missing GMP - is there a windows version of that library? I've missed everything. No boost, stl, std, c++11, generics, templates, namespaces, packages... Only Windows + Qt from the box. I've never used gmp, I even do not know what is it and can I trust it. I know that ECDSA sign is a function of three arguments: key, digest and kwhere key is my secret key, k is temporary secret value (random of derived from secret) and digest is public known hash of some data
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 04:50:53 PM |
|
I think you are going to have problems - if it uses GMP then you need GMP (unless there is some macro that makes that not necessary).
I doubt it uses high level stuff (like STL) as it is basically a C library (I haven't looked at the source code yet - just took a quick look at the README).
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
January 16, 2015, 04:56:24 PM |
|
As I want to upgrade my Wallet package to use deterministic sigs I will probably be using this library myself soon.
If you aren't in a huge hurry then perhaps just wait for me to fork it (as CIYAM can be compiled with MSVC so I'll work out how it can be done using MSVC rather than a Linux to Windows environment).
|
|
|
|
amaclin (OP)
Legendary
Offline
Activity: 1260
Merit: 1019
|
|
January 16, 2015, 05:01:39 PM |
|
I think you are going to have problems What else can we do on Sunday? {*}
|
|
|
|
samson
Legendary
Offline
Activity: 2097
Merit: 1070
|
|
January 18, 2015, 12:37:13 AM |
|
The PolarSSL C library does all that you want and it's easy to use.
If you want to write programs which do raw transactions, sha256 / ripemd160 hashing, signature creation and verification, etc it's all there.
There's a library called picocoin which I think someone in this thread created and someone else has converted it to work with polarssl instead of openssl. I believe that work was completed.
|
|
|
|
|