aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-10-09 14:34:38 +0200
committerRiccardo Spagni <ric@spagni.net>2016-10-09 14:34:38 +0200
commitfe43461c2bb93c27d267dda0d7511ec601222eca (patch)
tree3284b5cfb361e3cb37abbeb03faf7f6a64e93bb7 /src
parentMerge pull request #1192 (diff)
parentringct: use const refs as parameters where appropriate (diff)
downloadmonero-fe43461c2bb93c27d267dda0d7511ec601222eca.tar.xz
Merge pull request #1194
3126ba7 ringct: use const refs as parameters where appropriate (moneromooo-monero) d8eae67 tests: add performance test for ge_frombytes_vartime (moneromooo-monero) 3cb2436 core: remove some unused code (moneromooo-monero) 1eaa3e8 tests: add performance tests for rct signatures (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_format_utils.cpp3
-rw-r--r--src/ringct/rctSigs.cpp4
-rw-r--r--src/ringct/rctSigs.h4
-rw-r--r--src/ringct/rctTypes.h2
4 files changed, 5 insertions, 8 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp
index 64f8eb924..870e8f0d8 100644
--- a/src/cryptonote_core/cryptonote_format_utils.cpp
+++ b/src/cryptonote_core/cryptonote_format_utils.cpp
@@ -658,10 +658,7 @@ namespace cryptonote
}
else
{
- bool all_rct_inputs = true;
size_t n_total_outs = sources[0].outputs.size(); // only for non-simple rct
- BOOST_FOREACH(const tx_source_entry& src_entr, sources)
- all_rct_inputs &= !(src_entr.mask == rct::identity());
// the non-simple version is slightly smaller, but assumes all real inputs
// are on the same index, so can only be used if there just one ring.
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp
index ed1f8cc0e..85d21e805 100644
--- a/src/ringct/rctSigs.cpp
+++ b/src/ringct/rctSigs.cpp
@@ -150,7 +150,7 @@ namespace rct {
// Gen creates a signature which proves that for some column in the keymatrix "pk"
// the signer knows a secret key for each row in that column
// Ver verifies that the MG sig was created correctly
- mgSig MLSAG_Gen(key message, const keyM & pk, const keyV & xx, const unsigned int index, size_t dsRows) {
+ mgSig MLSAG_Gen(const key &message, const keyM & pk, const keyV & xx, const unsigned int index, size_t dsRows) {
mgSig rv;
size_t cols = pk.size();
CHECK_AND_ASSERT_THROW_MES(cols >= 2, "Error! What is c if cols = 1!");
@@ -239,7 +239,7 @@ namespace rct {
// Gen creates a signature which proves that for some column in the keymatrix "pk"
// the signer knows a secret key for each row in that column
// Ver verifies that the MG sig was created correctly
- bool MLSAG_Ver(key message, const keyM & pk, const mgSig & rv, size_t dsRows) {
+ bool MLSAG_Ver(const key &message, const keyM & pk, const mgSig & rv, size_t dsRows) {
size_t cols = pk.size();
CHECK_AND_ASSERT_MES(cols >= 2, false, "Error! What is c if cols = 1!");
diff --git a/src/ringct/rctSigs.h b/src/ringct/rctSigs.h
index f1c906d5e..11d771818 100644
--- a/src/ringct/rctSigs.h
+++ b/src/ringct/rctSigs.h
@@ -90,8 +90,8 @@ namespace rct {
// the signer knows a secret key for each row in that column
// Ver verifies that the MG sig was created correctly
keyV keyImageV(const keyV &xx);
- mgSig MLSAG_Gen(key message, const keyM & pk, const keyV & xx, const unsigned int index, size_t dsRows);
- bool MLSAG_Ver(key message, const keyM &pk, const mgSig &sig, size_t dsRows);
+ mgSig MLSAG_Gen(const key &message, const keyM & pk, const keyV & xx, const unsigned int index, size_t dsRows);
+ bool MLSAG_Ver(const key &message, const keyM &pk, const mgSig &sig, size_t dsRows);
//mgSig MLSAG_Gen_Old(const keyM & pk, const keyV & xx, const int index);
//proveRange and verRange
diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h
index bfafebb83..25f6f9bc9 100644
--- a/src/ringct/rctTypes.h
+++ b/src/ringct/rctTypes.h
@@ -415,7 +415,7 @@ namespace rct {
// then the value in the first 8 bytes is returned
xmr_amount h2d(const key &test);
//32 byte key to int[64]
- void h2b(bits amountb2, key & test);
+ void h2b(bits amountb2, const key & test);
//int[64] to 32 byte key
void b2h(key & amountdh, bits amountb2);
//int[64] to uint long long