diff options
author | subtly <subtly@users.noreply.github.com> | 2014-11-05 21:13:27 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2014-11-05 21:13:27 +0800 |
commit | 4aeeb68d77f84a86ab6447eb7f28951b4904b79c (patch) | |
tree | ec919e96b5323ae0d49e91f0cc7987384e094770 /crypto.cpp | |
parent | 127747fd4e92506f80cc570d801871425a568f9b (diff) | |
download | dexon-solidity-4aeeb68d77f84a86ab6447eb7f28951b4904b79c.tar.gz dexon-solidity-4aeeb68d77f84a86ab6447eb7f28951b4904b79c.tar.zst dexon-solidity-4aeeb68d77f84a86ab6447eb7f28951b4904b79c.zip |
coding standards, documentation, new exception syntax
Diffstat (limited to 'crypto.cpp')
-rw-r--r-- | crypto.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(cryptopp_vs_secp256k1) } } -BOOST_AUTO_TEST_CASE(cryptopp_cryptopp_ecdsav) +BOOST_AUTO_TEST_CASE(cryptopp_cryptopp_secp256k1libport) { // cryptopp implementation of secp256k1lib sign_compact w/recid parameter and recovery of public key from signature @@ -128,6 +128,12 @@ BOOST_AUTO_TEST_CASE(cryptopp_cryptopp_ecdsav) Integer s = (kInv * (Integer(secret.asBytes().data(), 32)*r + heInt)) % q; BOOST_REQUIRE(!!r && !!s); +/* + // For future reference: + // According to maths, this codepath can't be reached, however, it's in secp256k1. + // Commenting this out diverges from codebase implementation. + // To be removed after upstream PR and proof are evaulated. + if (s > params.GetSubgroupOrder()) { // note: this rarely happens @@ -135,6 +141,7 @@ BOOST_AUTO_TEST_CASE(cryptopp_cryptopp_ecdsav) if (recid) recid ^= 1; } + */ Signature sig; r.Encode(sig.data(), 32); |