-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding random tests against a naive implementation #641
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
993637e
Started adding ecc-secp256k1 for cross testing
elichai 3e09aed
Added ecc-secp25k61 rust naive implementation to the Makefile
elichai 6cca824
Updated the ecc_secp256k1 headers
elichai c69d5ee
Updated the rust ecc-secp256k1 tests and added signing tests
elichai 44fd9c6
Added cleanup and ifdefs for naive tests
elichai b0c6f80
Added rust to travis and fixed the makefile
elichai 5428407
Added sha2 verification for ecc-secp256k1 rust lib
elichai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,4 @@ build-aux/compile | |
build-aux/test-driver | ||
src/stamp-h1 | ||
libsecp256k1.pc | ||
ecc-secp256k1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5df36775e75973184332352108340a033cc8971c37f91bed7986e7a18b18a387 ecc-secp256k1.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Sign an ECDSA Signature | ||
* The message should be a hashed 32 bytes. | ||
* Input: msg -> pointer to 32 bytes message. | ||
* privkey -> pointer to 32 bytes private key. | ||
* Output: sig_out -> pointer to a 64 bytes buffer. | ||
* Returns: | ||
* 1 - Finished successfully. | ||
* 0 - Failed. | ||
*/ | ||
int ecc_secp256k1_ecdsa_sign(unsigned char *sig_out, | ||
const unsigned char *msg, | ||
const unsigned char *privkey); | ||
|
||
/** | ||
* Verify a ECDSA Signature | ||
* Accepts either compressed(33 btes) or uncompressed(65 bytes) public key. using the flag (1==compressed, 0==uncompressed). | ||
* Input: sig -> pointer to 64 bytes signature. | ||
* msg -> 32 bytes result of a hash. (***Make Sure you hash the message yourself! otherwise it's easily broken***) | ||
* pubkey -> pointer to 33 or 65 bytes pubkey depending on the compressed flag. | ||
* compressed -> 1 for compressed, 0 for uncompressed. | ||
* Returns: | ||
* 1 - The signature is valid. | ||
* 0 - Signature is not valid. | ||
* -1 - Some other problem. | ||
*/ | ||
int ecc_secp256k1_ecdsa_verify(const unsigned char *sig, | ||
const unsigned char *msg, | ||
const unsigned char *pubkey, | ||
int compressed); | ||
|
||
/** | ||
* Sign a Schnorr Signature | ||
* The message should be a hashed 32 bytes. | ||
* Input: msg -> pointer to 32 bytes message. | ||
* privkey -> pointer to 32 bytes private key. | ||
* Output: sig_out -> pointer to a 64 bytes buffer. | ||
* Returns: | ||
* 1 - Finished successfully. | ||
* 0 - Failed. | ||
*/ | ||
int ecc_secp256k1_schnorr_sign(unsigned char *sig_out, | ||
const unsigned char *msg, | ||
const unsigned char *privkey); | ||
|
||
/** | ||
* Verify a Schnorr Signature | ||
* Accepts either compressed(33 btes) or uncompressed(65 bytes) public key. using the flag (1==compressed, 0==uncompressed). | ||
* Input: sig -> pointer to 64 bytes signature. | ||
* msg -> 32 bytes result of a hash. (***Make Sure you hash the message yourself! otherwise it's easily broken***) | ||
* pubkey -> pointer to 33 or 65 bytes pubkey depending on the compressed flag. | ||
* compressed -> 1 for compressed, 0 for uncompressed. | ||
* Returns: | ||
* 1 - The signature is valid. | ||
* 0 - Signature is not valid. | ||
* -1 - Some other problem. | ||
*/ | ||
int ecc_secp256k1_schnorr_verify(const unsigned char *sig, | ||
const unsigned char *msg, | ||
const unsigned char *pubkey, | ||
int compressed); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copying libraries and header files around will be confusing. Can't you avoid it by directly linking to the files in the
ecc-secp256k1
dir?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was simpler by yeah it's possible to link directly into the files there.
about the header, don't you want it to be under source control here?