aboutsummaryrefslogtreecommitdiffstats
path: root/crypto.cpp
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2014-11-05 21:13:27 +0800
committersubtly <subtly@users.noreply.github.com>2014-11-05 21:13:27 +0800
commit4aeeb68d77f84a86ab6447eb7f28951b4904b79c (patch)
treeec919e96b5323ae0d49e91f0cc7987384e094770 /crypto.cpp
parent127747fd4e92506f80cc570d801871425a568f9b (diff)
downloaddexon-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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto.cpp b/crypto.cpp
index 82950f09..b0785aca 100644
--- a/crypto.cpp
+++ b/crypto.cpp
@@ -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);